From 0dbf8623f07a78ad99a83280d5c2f85a2fbb03fa Mon Sep 17 00:00:00 2001 From: ihzero Date: Sun, 31 Dec 2023 10:20:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0iframe=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/live-video/index.vue | 129 ++++++++++++++------------- src/components/live-video/index1.vue | 2 +- 2 files changed, 69 insertions(+), 62 deletions(-) diff --git a/src/components/live-video/index.vue b/src/components/live-video/index.vue index c5d2fe5..3610897 100644 --- a/src/components/live-video/index.vue +++ b/src/components/live-video/index.vue @@ -1,6 +1,9 @@
\ No newline at end of file + document.write('')
\ No newline at end of file diff --git a/dist/build/h5/static/js/index.2563d81e.js b/dist/build/h5/static/js/index.44bb60fc.js similarity index 93% rename from dist/build/h5/static/js/index.2563d81e.js rename to dist/build/h5/static/js/index.44bb60fc.js index 4aae20b..63a459f 100644 --- a/dist/build/h5/static/js/index.2563d81e.js +++ b/dist/build/h5/static/js/index.44bb60fc.js @@ -1 +1 @@ -(function(t){function a(a){for(var n,r,p=a[0],s=a[1],g=a[2],d=0,c=[];d0&&void 0!==arguments[0]?arguments[0]:"加载中...",a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];uni.showLoading({title:t,mask:a})}function g(){uni.hideLoading()}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3,n=arguments.length>3?arguments[3]:void 0;uni.showToast({title:t,icon:a,mask:!1,duration:e,success:function(){n&&n()}})}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";uni.setNavigationBarTitle({title:t})}function c(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};uni.previewImage({current:t,urls:a,complete:function(t){e(t)}})}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};uni.chooseImage({count:t,sizeType:["compressed"],sourceType:["album","camera"],success:function(t){var e=t.tempFilePaths;a(e)},fail:function(){e()}})}function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["album","camera"];uni.chooseVideo({sourceType:e,success:function(a){console.log(a);var e=a.tempFilePath;t(e,a)},fail:function(){a()}})}function f(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};uni.previewMedia({current:t,sources:a,complete:function(t){e(t)}})}function b(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};console.log(t,"|"),uni.compressImage({src:t,quality:a,success:function(t){console.log(t.tempFilePath),e(t.tempFilePath)},fail:function(t){console.log("失败"),n(t)}})}function h(t,a){try{uni.setStorageSync(t,a)}catch(e){}}function y(t,a){try{uni.setStorage({key:t,data:a})}catch(e){}}function w(t){try{return uni.getStorageSync(t)}catch(a){}}function _(t){try{uni.removeStorageSync(t)}catch(a){}}function v(){try{uni.clearStorageSync()}catch(t){}}function x(t){uni.showTabBarRedDot({index:t})}function C(t){uni.hideTabBarRedDot({index:t})}function k(){var t=getCurrentPages(),a=t[t.length-2];console.log(t,a),a?uni.navigateBack():uni.switchTab({url:"/pages/index/index"})}function S(t,a){if(!t)return"";var e=new Date(t),n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var i in/(y+)/.test(a)&&(a=a.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+i+")").test(a)&&(a=a.replace(RegExp.$1,1==RegExp.$1.length?n[i]:("00"+n[i]).substr((""+n[i]).length)));return a}function P(t){var a=/^1\d{10}$/;return!!a.test(t)}function T(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",e=[];return console.log(a),t.map((function(t){return[t]})).forEach((function(t){var n=(0,p.default)(t,1),i=Object.assign({},((0,r.default)(n[0]),n[0])),s=e.find((function(t){var e=(0,p.default)(t,1),n=Object.assign({},((0,r.default)(e[0]),e[0]));return n[a]===i[a]}));s?e.forEach((function(t,n){var o=(0,p.default)(t,1),s=Object.assign({},((0,r.default)(o[0]),o[0]));s[a]===i[a]&&e[n].push(i)})):e.push([(0,o.default)({},i)])})),e}function A(t,a,e){for(var n="",i=e-a,o=0;oo)return 1;if(i1&&void 0!==arguments[1]?arguments[1]:function(){},e=t;wx.requestSubscribeMessage({tmplIds:e,success:function(t){console.log(t,"成功");var n,o=0,r=(0,i.default)(e);try{for(r.s();!(n=r.n()).done;){var p=n.value;"accept"===t[p]&&(o+=1)}}catch(s){r.e(s)}finally{r.f()}0==o||a(t)},fail:function(t){20004==t.errCode?console.log("用户拒绝了",t):a(res)}})}function D(t){var a=/^(([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4}(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9])|([3][0-1]))\d{3}[0-9xX]$/;if(!a.test(t))return{status:0,msg:"身份证号码不合规"};var e=t.substr(6,4),n=t.substr(10,2),i=t.substr(12,2),o=Date.parse(n+"-"+i+"-"+e),r=Date.parse(new Date),p=new Date(e,n,0).getDate();if(o>r||i>p)return{status:0,msg:"出生日期不合规"};for(var s=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2),g=new Array("1","0","X","9","8","7","6","5","4","3","2"),d=t.split(""),u=0,c=0;c<17;c++)u+=parseInt(d[c])*parseInt(s[c]);return d[17].toUpperCase()!=g[u%11].toUpperCase()?{status:0,msg:"身份证校验码不合规"}:{status:1,msg:"校验通过"}}function B(t){var a=new RegExp("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$");return a.test(t)}function N(t){var a=/[1-9]\d{12,18}/;return a.test(t)}function L(t){var a=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;return a.test(t)}function U(){var t=new Date,a=new Date(t);a.setDate(t.getDate()-7);var e=new Date(t);return e.setDate(t.getDate()-1),{startDate:a,endDate:e}}function I(){var t=new Date,a=new Date(t);a.setMonth(t.getMonth()-1);var e=new Date(t);return e.setDate(t.getDate()-1),{startDate:a,endDate:e}}e("ac1f"),e("00b4"),e("5319"),e("4d63"),e("c607"),e("2c3e"),e("25f0"),e("d3b7"),e("159b"),e("d81d"),e("7db0"),e("14d9"),e("e25e"),e("fb6a")},"8eac":function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("f3f3"));e("d3b7"),e("159b"),e("b64b");var o=n(e("cca2")),r=n(e("2974")),p=n(e("d606")),s=e("3bf7"),g=function(t,a){var e={};return t.forEach((function(t){(0,s.isUndefined)(a[t])||(e[t]=a[t])})),e};a.default=function(t){return new Promise((function(a,e){var n,d=(0,o.default)((0,r.default)(t.baseURL,t.url),t.params),u={url:d,header:t.header,complete:function(n){t.fullPath=d,n.config=t;try{"string"===typeof n.data&&(n.data=JSON.parse(n.data))}catch(i){}(0,p.default)(a,e,n)}};if("UPLOAD"===t.method){delete u.header["content-type"],delete u.header["Content-Type"];var c={filePath:t.filePath,name:t.name},m=["files","file","timeout","formData"];n=uni.uploadFile((0,i.default)((0,i.default)((0,i.default)({},u),c),g(m,t)))}else if("DOWNLOAD"===t.method)(0,s.isUndefined)(t["timeout"])||(u["timeout"]=t["timeout"]),n=uni.downloadFile(u);else{var l=["data","method","timeout","dataType","responseType","withCredentials"];n=uni.request((0,i.default)((0,i.default)({},u),g(l,t)))}t.getTask&&t.getTask(n,t)}))}},9154:function(t,a,e){var n=e("24fb");a=n(!1),a.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.yn-select-list[data-v-2137a64a]{display:flex;flex-direction:column;flex:1}.u-select-input-list[data-v-2137a64a]{position:relative;flex:1;display:flex;flex-direction:row;border-radius:%?8?%;min-height:%?72?%;border:1px solid #dcdfe6;padding:0 %?20?%}.u-select-input-list .select_wrapper[data-v-2137a64a]{flex:1;display:flex;flex-direction:column;justify-content:center;font-size:%?28?%;color:#000}.u-select-input-list .right-icon .u-icon__icon[data-v-2137a64a]{margin-left:%?10?%;color:#c0c4cc}',""]),t.exports=a},"94d5":function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.userInfo=a.token=a.showAppbar=void 0;a.userInfo=function(t){return t.userInfo},a.token=function(t){return t.user_access_token},a.showAppbar=function(t){return t.showAppbar}},9580:function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;a.default={baseURL:"",header:{},method:"GET",dataType:"json",responseType:"text",custom:{},timeout:6e4,withCredentials:!1,validateStatus:function(t){return t>=200&&t<300}}},"9b17":function(t,a,e){"use strict";e.r(a);var n=e("458f"),i=e("a5cb");for(var o in i)["default"].indexOf(o)<0&&function(t){e.d(a,t,(function(){return i[t]}))}(o);e("ad9b");var r,p=e("f0c5"),s=Object(p["a"])(i["default"],n["b"],n["c"],!1,null,"2137a64a",null,!1,n["a"],r);a["default"]=s.exports},"9fb0":function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.USER_INFO=a.USERKEY=a.USERACCESSTOKEN=void 0;a.USER_INFO="USER_INFO",a.USERACCESSTOKEN="USERACCESSTOKEN",a.USERKEY="USERKEY"},a5cb:function(t,a,e){"use strict";e.r(a);var n=e("7f73"),i=e.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){e.d(a,t,(function(){return n[t]}))}(o);a["default"]=i.a},abc2:function(t,a,e){"use strict";function n(){this.handlers=[]}e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("14d9"),e("d3b7"),e("159b"),n.prototype.use=function(t,a){return this.handlers.push({fulfilled:t,rejected:a}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){this.handlers.forEach((function(a){null!==a&&t(a)}))};a.default=n},ad9b:function(t,a,e){"use strict";var n=e("23f0"),i=e.n(n);i.a},bb58:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("f3f3"));e("d3b7"),e("159b");var o=e("3bf7"),r=function(t,a,e){var n={};return t.forEach((function(t){(0,o.isUndefined)(e[t])?(0,o.isUndefined)(a[t])||(n[t]=a[t]):n[t]=e[t]})),n};a.default=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=a.method||t.method||"GET",n={baseURL:t.baseURL||"",method:e,url:a.url||"",params:a.params||{},custom:(0,i.default)((0,i.default)({},t.custom||{}),a.custom||{}),header:(0,o.deepMerge)(t.header||{},a.header||{})},p=["getTask","validateStatus"];if(n=(0,i.default)((0,i.default)({},n),r(p,t,a)),"DOWNLOAD"===e)(0,o.isUndefined)(a.timeout)?(0,o.isUndefined)(t.timeout)||(n["timeout"]=t["timeout"]):n["timeout"]=a["timeout"];else if("UPLOAD"===e){delete n.header["content-type"],delete n.header["Content-Type"];var s=["files","file","filePath","name","timeout","formData"];s.forEach((function(t){(0,o.isUndefined)(a[t])||(n[t]=a[t])})),(0,o.isUndefined)(n.timeout)&&!(0,o.isUndefined)(t.timeout)&&(n["timeout"]=t["timeout"])}else{var g=["data","timeout","dataType","responseType","withCredentials"];n=(0,i.default)((0,i.default)({},n),r(g,t,a))}return n}},be8f:function(t,a,e){var n=e("62f5").default;e("d3b7"),uni.addInterceptor({returnValue:function(t){return!t||"object"!==n(t)&&"function"!==typeof t||"function"!==typeof t.then?t:new Promise((function(a,e){t.then((function(t){return t[0]?e(t[0]):a(t[1])}))}))}})},cca2:function(t,a,e){"use strict";e("7a82");var n=e("4a46").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=r,e("ac1f"),e("5319"),e("d401"),e("d3b7"),e("25f0"),e("e9c4"),e("14d9"),e("c975"),e("fb6a");var i=n(e("3bf7"));function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r(t,a){if(!a)return t;var e;if(i.isURLSearchParams(a))e=a.toString();else{var n=[];i.forEach(a,(function(t,a){null!==t&&"undefined"!==typeof t&&(i.isArray(t)?a+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),n.push(o(a)+"="+o(t))})))})),e=n.join("&")}if(e){var r=t.indexOf("#");-1!==r&&(t=t.slice(0,r)),t+=(-1===t.indexOf("?")?"?":"&")+e}return t}},d606:function(t,a,e){"use strict";function n(t,a,e){var n=e.config.validateStatus,i=e.statusCode;!i||n&&!n(i)?a(e):t(e)}e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=n},dd03:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("4360")),o=n(e("0cc2"));a.default={onLaunch:function(t){var a=t.query,e=a.appbar,n=a.token;n&&o.default.setAccessToken(n),"hidden"==e?(i.default.commit("showAppbar",!1),this.hideNavBar()):i.default.commit("showAppbar",!0)},methods:{hideNavBar:function(){this.$nextTick((function(){var t=document.getElementsByTagName("uni-page-head");t[0]&&(t[0].style.display="none")}))}}}},e250:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("d3b7"),e("159b"),e("3c65"),e("14d9");var i=n(e("f3f3")),o=n(e("276c")),r=n(e("e954")),p=n(e("19f4")),s=n(e("abc2")),g=n(e("bb58")),d=n(e("9580")),u=e("3bf7");a.default=function(){function t(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(this,t),(0,u.isPlainObject)(a)||(a={},console.warn("设置全局参数必须接收一个Object")),this.config=(0,i.default)((0,i.default)({},d.default),a),this.interceptors={request:new s.default,response:new s.default}}return(0,r.default)(t,[{key:"setConfig",value:function(t){this.config=t(this.config)}},{key:"middleware",value:function(t){t=(0,g.default)(this.config,t);var a=[p.default,void 0],e=Promise.resolve(t);this.interceptors.request.forEach((function(t){a.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){a.push(t.fulfilled,t.rejected)}));while(a.length)e=e.then(a.shift(),a.shift());return e}},{key:"request",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.middleware(t)}},{key:"get",value:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.middleware((0,i.default)({url:t,method:"GET"},a))}},{key:"post",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"POST"},e))}},{key:"put",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"PUT"},e))}},{key:"delete",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"DELETE"},e))}},{key:"connect",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"CONNECT"},e))}},{key:"head",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"HEAD"},e))}},{key:"options",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"OPTIONS"},e))}},{key:"trace",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"TRACE"},e))}},{key:"upload",value:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.url=t,a.method="UPLOAD",this.middleware(a)}},{key:"download",value:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.url=t,a.method="DOWNLOAD",this.middleware(a)}}]),t}()},e799:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("d3b7"),e("caad"),e("2532"),e("d9e2"),e("d401");var i=n(e("4360"));function o(t,a){var e,n,o=a.value,r=i.default.getters&&(null!==(e=null===(n=i.default.getters.userInfo)||void 0===n?void 0:n.permissions_slug)&&void 0!==e?e:[]);if(!(o&&o instanceof Array))throw new Error("need roles! Like v-permission=\"['admin','editor']\"");if(o.length>0){var p=o,s=r.some((function(t){return p.includes(t)}));s||t.parentNode&&t.parentNode.removeChild(t)}}a.default={inserted:function(t,a){o(t,a)},update:function(t,a){o(t,a)}}},ea0b:function(t,a,e){var n=e("24fb");a=n(!1),a.push([t.i,'/* windicss layer base */*,::before,::after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}*{--tw-ring-inset:var(--tw-empty,);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}::moz-focus-inner{border-style:none;padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}b{font-weight:bolder}uni-button, uni-input{font-family:inherit;font-size:100%;line-height:1.15;margin:0;padding:0;line-height:inherit;color:inherit}uni-button{text-transform:none;background-color:initial;background-image:none}uni-button, [type="button"], [type="reset"], [type="submit"]{-webkit-appearance:button}uni-button, [role="button"]{cursor:pointer}uni-canvas, img{display:block;vertical-align:middle}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}img{border-style:solid;max-width:100%;height:auto}uni-input::-webkit-input-placeholder{opacity:1;color:#9ca3af}uni-input::placeholder{opacity:1;color:#9ca3af}uni-input::webkit-input-placeholder{opacity:1;color:#9ca3af}uni-input::-moz-placeholder{opacity:1;color:#9ca3af}uni-input:-ms-input-placeholder{opacity:1;color:#9ca3af}uni-input::-ms-input-placeholder{opacity:1;color:#9ca3af}\n/* windicss layer components */.flex-center{display:flex;align-items:center;justify-content:center}\n/* windicss layer utilities */.container{width:100%}.space-y-20rpx > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(%?20?% * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(%?20?% * var(--tw-space-y-reverse))}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-hex-76E9F0{--tw-bg-opacity:1;background-color:rgba(118,233,240,var(--tw-bg-opacity))}.bg-hex-F7B379{--tw-bg-opacity:1;background-color:rgba(247,179,121,var(--tw-bg-opacity))}.bg-hex-EB313E{--tw-bg-opacity:1;background-color:rgba(235,49,62,var(--tw-bg-opacity))}.rounded-md{border-radius:.375rem}.border-solid{border-style:solid}.border{border-width:1px}.border-0\\.5px{border-width:.5px}.flex{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.grid{display:-ms-grid;display:grid}.hidden{display:none}.flex-row{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row}.flex-col{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.items-center{-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.justify-between{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.flex-1{-webkit-box-flex:1;-ms-flex:1 1 0%;-webkit-flex:1 1 0%;flex:1 1 0%}.font-bold{font-weight:700}.h-full{height:100%}.\\!h-full{height:100%!important}.h-90rpx{height:%?90?%}.h-86rpx{height:%?86?%}.h-80rpx{height:%?80?%}.h-120rpx{height:%?120?%}.h-16rpx{height:%?16?%}.h-20rpx{height:%?20?%}.h-80vh{height:80vh}.h-500rpx{height:%?500?%}.text-base{font-size:1rem;line-height:1.5rem}.text-34rpx{font-size:%?34?%;line-height:1}.text-28rpx{font-size:%?28?%;line-height:1}.text-32rpx{font-size:%?32?%;line-height:1}.text-30rpx{font-size:%?30?%;line-height:1}.text-42rpx{font-size:%?42?%;line-height:1}.text-24rpx{font-size:%?24?%;line-height:1}.leading-86rpx{line-height:%?86?%}.my-20rpx{margin-top:%?20?%;margin-bottom:%?20?%}.mx-30rpx{margin-left:%?30?%;margin-right:%?30?%}.my-12rpx{margin-top:%?12?%;margin-bottom:%?12?%}.my-10rpx{margin-top:%?10?%;margin-bottom:%?10?%}.mx-20rpx{margin-left:%?20?%;margin-right:%?20?%}.mr-20px{margin-right:20px}.mt-20rpx{margin-top:%?20?%}.ml-1{margin-left:.25rem}.ml-16rpx{margin-left:%?16?%}.ml-10rpx{margin-left:%?10?%}.mr-20rpx{margin-right:%?20?%}.ml-4rpx{margin-left:%?4?%}.mb-20rpx{margin-bottom:%?20?%}.max-h-1200rpx{max-height:%?1200?%}.opacity-50{opacity:.5}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.p-30rpx{padding:%?30?%}.p-20rpx{padding:%?20?%}.p-16rpx{padding:%?16?%}.px-20rpx{padding-left:%?20?%;padding-right:%?20?%}.px{padding-left:1px;padding-right:1px}.px-10rpx{padding-left:%?10?%;padding-right:%?10?%}.py-10rpx{padding-top:%?10?%;padding-bottom:%?10?%}.py-20rpx{padding-top:%?20?%;padding-bottom:%?20?%}.px-26rpx{padding-left:%?26?%;padding-right:%?26?%}.pb-20rpx{padding-bottom:%?20?%}.\\!pointer-events-none{pointer-events:none!important}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.left-0{left:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px -1px rgba(0,0,0,0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);-webkit-box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.text-center{text-align:center}.text-hex-fa3534{--tw-text-opacity:1;color:rgba(250,53,52,var(--tw-text-opacity))}.text-hex-2979ff{--tw-text-opacity:1;color:rgba(41,121,255,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.indent{text-indent:1.5rem}.content-type{content:"type"}.content-box{content:"box"}.ordinal{--tw-ordinal:ordinal;--tw-slashed-zero:var(--tw-empty,);--tw-numeric-figure:var(--tw-empty,);--tw-numeric-spacing:var(--tw-empty,);--tw-numeric-fraction:var(--tw-empty,);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.invisible{visibility:hidden}.w-full{width:100%}.w-120rpx{width:%?120?%}.w-16rpx{width:%?16?%}.w-140rpx{width:%?140?%}.gap-20rpx{grid-gap:%?20?%;gap:%?20?%}.gap-x-20rpx{-webkit-column-gap:%?20?%;-moz-column-gap:%?20?%;grid-column-gap:%?20?%;column-gap:%?20?%}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate:0;--tw-rotate-x:0;--tw-rotate-y:0;--tw-rotate-z:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;-webkit-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) translateZ(var(--tw-translate-z)) rotate(var(--tw-rotate)) rotateX(var(--tw-rotate-x)) rotateY(var(--tw-rotate-y)) rotate(var(--tw-rotate-z)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) scaleZ(var(--tw-scale-z));-ms-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) translateZ(var(--tw-translate-z)) rotate(var(--tw-rotate)) rotateX(var(--tw-rotate-x)) rotateY(var(--tw-rotate-y)) rotate(var(--tw-rotate-z)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) scaleZ(var(--tw-scale-z));transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) translateZ(var(--tw-translate-z)) rotate(var(--tw-rotate)) rotateX(var(--tw-rotate-x)) rotateY(var(--tw-rotate-y)) rotate(var(--tw-rotate-z)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) scaleZ(var(--tw-scale-z))}.transition{-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,filter,backdrop-filter;-o-transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,-webkit-box-shadow,transform,-webkit-transform,filter,backdrop-filter;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;-o-transition-duration:.15s;transition-duration:.15s}.filter{--tw-blur:var(--tw-empty,);--tw-brightness:var(--tw-empty,);--tw-contrast:var(--tw-empty,);--tw-grayscale:var(--tw-empty,);--tw-hue-rotate:var(--tw-empty,);--tw-invert:var(--tw-empty,);--tw-saturate:var(--tw-empty,);--tw-sepia:var(--tw-empty,);--tw-drop-shadow:var(--tw-empty,);-webkit-filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur{--tw-blur:blur(8px)}',""]),t.exports=a},ef9e:function(t,a,e){var n=e("ea0b");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=e("4f06").default;i("d88fd794",n,!0,{sourceMap:!1,shadowMode:!1})},fcc2:function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n={userInfo:{},user_access_token:"",user_key:"",showAppbar:!0};a.default=n}}); \ No newline at end of file +(function(t){function a(a){for(var n,r,p=a[0],s=a[1],g=a[2],d=0,c=[];d0&&void 0!==arguments[0]?arguments[0]:"加载中...",a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];uni.showLoading({title:t,mask:a})}function g(){uni.hideLoading()}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3,n=arguments.length>3?arguments[3]:void 0;uni.showToast({title:t,icon:a,mask:!1,duration:e,success:function(){n&&n()}})}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";uni.setNavigationBarTitle({title:t})}function c(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};uni.previewImage({current:t,urls:a,complete:function(t){e(t)}})}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};uni.chooseImage({count:t,sizeType:["compressed"],sourceType:["album","camera"],success:function(t){var e=t.tempFilePaths;a(e)},fail:function(){e()}})}function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["album","camera"];uni.chooseVideo({sourceType:e,success:function(a){console.log(a);var e=a.tempFilePath;t(e,a)},fail:function(){a()}})}function f(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};uni.previewMedia({current:t,sources:a,complete:function(t){e(t)}})}function b(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};console.log(t,"|"),uni.compressImage({src:t,quality:a,success:function(t){console.log(t.tempFilePath),e(t.tempFilePath)},fail:function(t){console.log("失败"),n(t)}})}function h(t,a){try{uni.setStorageSync(t,a)}catch(e){}}function y(t,a){try{uni.setStorage({key:t,data:a})}catch(e){}}function w(t){try{return uni.getStorageSync(t)}catch(a){}}function _(t){try{uni.removeStorageSync(t)}catch(a){}}function v(){try{uni.clearStorageSync()}catch(t){}}function x(t){uni.showTabBarRedDot({index:t})}function C(t){uni.hideTabBarRedDot({index:t})}function k(){var t=getCurrentPages(),a=t[t.length-2];console.log(t,a),a?uni.navigateBack():uni.switchTab({url:"/pages/index/index"})}function S(t,a){if(!t)return"";var e=new Date(t),n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var i in/(y+)/.test(a)&&(a=a.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+i+")").test(a)&&(a=a.replace(RegExp.$1,1==RegExp.$1.length?n[i]:("00"+n[i]).substr((""+n[i]).length)));return a}function P(t){var a=/^1\d{10}$/;return!!a.test(t)}function T(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",e=[];return console.log(a),t.map((function(t){return[t]})).forEach((function(t){var n=(0,p.default)(t,1),i=Object.assign({},((0,r.default)(n[0]),n[0])),s=e.find((function(t){var e=(0,p.default)(t,1),n=Object.assign({},((0,r.default)(e[0]),e[0]));return n[a]===i[a]}));s?e.forEach((function(t,n){var o=(0,p.default)(t,1),s=Object.assign({},((0,r.default)(o[0]),o[0]));s[a]===i[a]&&e[n].push(i)})):e.push([(0,o.default)({},i)])})),e}function A(t,a,e){for(var n="",i=e-a,o=0;oo)return 1;if(i1&&void 0!==arguments[1]?arguments[1]:function(){},e=t;wx.requestSubscribeMessage({tmplIds:e,success:function(t){console.log(t,"成功");var n,o=0,r=(0,i.default)(e);try{for(r.s();!(n=r.n()).done;){var p=n.value;"accept"===t[p]&&(o+=1)}}catch(s){r.e(s)}finally{r.f()}0==o||a(t)},fail:function(t){20004==t.errCode?console.log("用户拒绝了",t):a(res)}})}function D(t){var a=/^(([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4}(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9])|([3][0-1]))\d{3}[0-9xX]$/;if(!a.test(t))return{status:0,msg:"身份证号码不合规"};var e=t.substr(6,4),n=t.substr(10,2),i=t.substr(12,2),o=Date.parse(n+"-"+i+"-"+e),r=Date.parse(new Date),p=new Date(e,n,0).getDate();if(o>r||i>p)return{status:0,msg:"出生日期不合规"};for(var s=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2),g=new Array("1","0","X","9","8","7","6","5","4","3","2"),d=t.split(""),u=0,c=0;c<17;c++)u+=parseInt(d[c])*parseInt(s[c]);return d[17].toUpperCase()!=g[u%11].toUpperCase()?{status:0,msg:"身份证校验码不合规"}:{status:1,msg:"校验通过"}}function B(t){var a=new RegExp("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$");return a.test(t)}function N(t){var a=/[1-9]\d{12,18}/;return a.test(t)}function L(t){var a=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;return a.test(t)}function U(){var t=new Date,a=new Date(t);a.setDate(t.getDate()-7);var e=new Date(t);return e.setDate(t.getDate()-1),{startDate:a,endDate:e}}function I(){var t=new Date,a=new Date(t);a.setMonth(t.getMonth()-1);var e=new Date(t);return e.setDate(t.getDate()-1),{startDate:a,endDate:e}}e("ac1f"),e("00b4"),e("5319"),e("4d63"),e("c607"),e("2c3e"),e("25f0"),e("d3b7"),e("159b"),e("d81d"),e("7db0"),e("14d9"),e("e25e"),e("fb6a")},"8eac":function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("f3f3"));e("d3b7"),e("159b"),e("b64b");var o=n(e("cca2")),r=n(e("2974")),p=n(e("d606")),s=e("3bf7"),g=function(t,a){var e={};return t.forEach((function(t){(0,s.isUndefined)(a[t])||(e[t]=a[t])})),e};a.default=function(t){return new Promise((function(a,e){var n,d=(0,o.default)((0,r.default)(t.baseURL,t.url),t.params),u={url:d,header:t.header,complete:function(n){t.fullPath=d,n.config=t;try{"string"===typeof n.data&&(n.data=JSON.parse(n.data))}catch(i){}(0,p.default)(a,e,n)}};if("UPLOAD"===t.method){delete u.header["content-type"],delete u.header["Content-Type"];var c={filePath:t.filePath,name:t.name},m=["files","file","timeout","formData"];n=uni.uploadFile((0,i.default)((0,i.default)((0,i.default)({},u),c),g(m,t)))}else if("DOWNLOAD"===t.method)(0,s.isUndefined)(t["timeout"])||(u["timeout"]=t["timeout"]),n=uni.downloadFile(u);else{var l=["data","method","timeout","dataType","responseType","withCredentials"];n=uni.request((0,i.default)((0,i.default)({},u),g(l,t)))}t.getTask&&t.getTask(n,t)}))}},9154:function(t,a,e){var n=e("24fb");a=n(!1),a.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.yn-select-list[data-v-2137a64a]{display:flex;flex-direction:column;flex:1}.u-select-input-list[data-v-2137a64a]{position:relative;flex:1;display:flex;flex-direction:row;border-radius:%?8?%;min-height:%?72?%;border:1px solid #dcdfe6;padding:0 %?20?%}.u-select-input-list .select_wrapper[data-v-2137a64a]{flex:1;display:flex;flex-direction:column;justify-content:center;font-size:%?28?%;color:#000}.u-select-input-list .right-icon .u-icon__icon[data-v-2137a64a]{margin-left:%?10?%;color:#c0c4cc}',""]),t.exports=a},"94d5":function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.userInfo=a.token=a.showAppbar=void 0;a.userInfo=function(t){return t.userInfo},a.token=function(t){return t.user_access_token},a.showAppbar=function(t){return t.showAppbar}},9580:function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;a.default={baseURL:"",header:{},method:"GET",dataType:"json",responseType:"text",custom:{},timeout:6e4,withCredentials:!1,validateStatus:function(t){return t>=200&&t<300}}},"9b17":function(t,a,e){"use strict";e.r(a);var n=e("458f"),i=e("a5cb");for(var o in i)["default"].indexOf(o)<0&&function(t){e.d(a,t,(function(){return i[t]}))}(o);e("ad9b");var r,p=e("f0c5"),s=Object(p["a"])(i["default"],n["b"],n["c"],!1,null,"2137a64a",null,!1,n["a"],r);a["default"]=s.exports},"9fb0":function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.USER_INFO=a.USERKEY=a.USERACCESSTOKEN=void 0;a.USER_INFO="USER_INFO",a.USERACCESSTOKEN="USERACCESSTOKEN",a.USERKEY="USERKEY"},a5cb:function(t,a,e){"use strict";e.r(a);var n=e("7f73"),i=e.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){e.d(a,t,(function(){return n[t]}))}(o);a["default"]=i.a},abc2:function(t,a,e){"use strict";function n(){this.handlers=[]}e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("14d9"),e("d3b7"),e("159b"),n.prototype.use=function(t,a){return this.handlers.push({fulfilled:t,rejected:a}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){this.handlers.forEach((function(a){null!==a&&t(a)}))};a.default=n},ad9b:function(t,a,e){"use strict";var n=e("23f0"),i=e.n(n);i.a},bb58:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("f3f3"));e("d3b7"),e("159b");var o=e("3bf7"),r=function(t,a,e){var n={};return t.forEach((function(t){(0,o.isUndefined)(e[t])?(0,o.isUndefined)(a[t])||(n[t]=a[t]):n[t]=e[t]})),n};a.default=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=a.method||t.method||"GET",n={baseURL:t.baseURL||"",method:e,url:a.url||"",params:a.params||{},custom:(0,i.default)((0,i.default)({},t.custom||{}),a.custom||{}),header:(0,o.deepMerge)(t.header||{},a.header||{})},p=["getTask","validateStatus"];if(n=(0,i.default)((0,i.default)({},n),r(p,t,a)),"DOWNLOAD"===e)(0,o.isUndefined)(a.timeout)?(0,o.isUndefined)(t.timeout)||(n["timeout"]=t["timeout"]):n["timeout"]=a["timeout"];else if("UPLOAD"===e){delete n.header["content-type"],delete n.header["Content-Type"];var s=["files","file","filePath","name","timeout","formData"];s.forEach((function(t){(0,o.isUndefined)(a[t])||(n[t]=a[t])})),(0,o.isUndefined)(n.timeout)&&!(0,o.isUndefined)(t.timeout)&&(n["timeout"]=t["timeout"])}else{var g=["data","timeout","dataType","responseType","withCredentials"];n=(0,i.default)((0,i.default)({},n),r(g,t,a))}return n}},be8f:function(t,a,e){var n=e("62f5").default;e("d3b7"),uni.addInterceptor({returnValue:function(t){return!t||"object"!==n(t)&&"function"!==typeof t||"function"!==typeof t.then?t:new Promise((function(a,e){t.then((function(t){return t[0]?e(t[0]):a(t[1])}))}))}})},cca2:function(t,a,e){"use strict";e("7a82");var n=e("4a46").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=r,e("ac1f"),e("5319"),e("d401"),e("d3b7"),e("25f0"),e("e9c4"),e("14d9"),e("c975"),e("fb6a");var i=n(e("3bf7"));function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r(t,a){if(!a)return t;var e;if(i.isURLSearchParams(a))e=a.toString();else{var n=[];i.forEach(a,(function(t,a){null!==t&&"undefined"!==typeof t&&(i.isArray(t)?a+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),n.push(o(a)+"="+o(t))})))})),e=n.join("&")}if(e){var r=t.indexOf("#");-1!==r&&(t=t.slice(0,r)),t+=(-1===t.indexOf("?")?"?":"&")+e}return t}},d606:function(t,a,e){"use strict";function n(t,a,e){var n=e.config.validateStatus,i=e.statusCode;!i||n&&!n(i)?a(e):t(e)}e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=n},dd03:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("4360")),o=n(e("0cc2"));a.default={onLaunch:function(t){var a=t.query,e=a.appbar,n=a.token;n&&o.default.setAccessToken(n),"hidden"==e?(i.default.commit("showAppbar",!1),this.hideNavBar()):i.default.commit("showAppbar",!0)},methods:{hideNavBar:function(){this.$nextTick((function(){var t=document.getElementsByTagName("uni-page-head");t[0]&&(t[0].style.display="none")}))}}}},e250:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("d3b7"),e("159b"),e("3c65"),e("14d9");var i=n(e("f3f3")),o=n(e("276c")),r=n(e("e954")),p=n(e("19f4")),s=n(e("abc2")),g=n(e("bb58")),d=n(e("9580")),u=e("3bf7");a.default=function(){function t(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(this,t),(0,u.isPlainObject)(a)||(a={},console.warn("设置全局参数必须接收一个Object")),this.config=(0,i.default)((0,i.default)({},d.default),a),this.interceptors={request:new s.default,response:new s.default}}return(0,r.default)(t,[{key:"setConfig",value:function(t){this.config=t(this.config)}},{key:"middleware",value:function(t){t=(0,g.default)(this.config,t);var a=[p.default,void 0],e=Promise.resolve(t);this.interceptors.request.forEach((function(t){a.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){a.push(t.fulfilled,t.rejected)}));while(a.length)e=e.then(a.shift(),a.shift());return e}},{key:"request",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.middleware(t)}},{key:"get",value:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.middleware((0,i.default)({url:t,method:"GET"},a))}},{key:"post",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"POST"},e))}},{key:"put",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"PUT"},e))}},{key:"delete",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"DELETE"},e))}},{key:"connect",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"CONNECT"},e))}},{key:"head",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"HEAD"},e))}},{key:"options",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"OPTIONS"},e))}},{key:"trace",value:function(t,a){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.middleware((0,i.default)({url:t,data:a,method:"TRACE"},e))}},{key:"upload",value:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.url=t,a.method="UPLOAD",this.middleware(a)}},{key:"download",value:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.url=t,a.method="DOWNLOAD",this.middleware(a)}}]),t}()},e799:function(t,a,e){"use strict";e("7a82");var n=e("ee27").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("d3b7"),e("caad"),e("2532"),e("d9e2"),e("d401");var i=n(e("4360"));function o(t,a){var e,n,o=a.value,r=i.default.getters&&(null!==(e=null===(n=i.default.getters.userInfo)||void 0===n?void 0:n.permissions_slug)&&void 0!==e?e:[]);if(!(o&&o instanceof Array))throw new Error("need roles! Like v-permission=\"['admin','editor']\"");if(o.length>0){var p=o,s=r.some((function(t){return p.includes(t)}));s||t.parentNode&&t.parentNode.removeChild(t)}}a.default={inserted:function(t,a){o(t,a)},update:function(t,a){o(t,a)}}},ea0b:function(t,a,e){var n=e("24fb");a=n(!1),a.push([t.i,'/* windicss layer base */*,::before,::after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}*{--tw-ring-inset:var(--tw-empty,);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}::moz-focus-inner{border-style:none;padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}b{font-weight:bolder}uni-button, uni-input{font-family:inherit;font-size:100%;line-height:1.15;margin:0;padding:0;line-height:inherit;color:inherit}uni-button{text-transform:none;background-color:initial;background-image:none}uni-button, [type="button"], [type="reset"], [type="submit"]{-webkit-appearance:button}uni-button, [role="button"]{cursor:pointer}uni-canvas, iframe, img{display:block;vertical-align:middle}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}img{border-style:solid;max-width:100%;height:auto}uni-input::-webkit-input-placeholder{opacity:1;color:#9ca3af}uni-input::placeholder{opacity:1;color:#9ca3af}uni-input::webkit-input-placeholder{opacity:1;color:#9ca3af}uni-input::-moz-placeholder{opacity:1;color:#9ca3af}uni-input:-ms-input-placeholder{opacity:1;color:#9ca3af}uni-input::-ms-input-placeholder{opacity:1;color:#9ca3af}\n/* windicss layer components */.flex-center{display:flex;align-items:center;justify-content:center}\n/* windicss layer utilities */.container{width:100%}.space-y-20rpx > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(%?20?% * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(%?20?% * var(--tw-space-y-reverse))}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-hex-76E9F0{--tw-bg-opacity:1;background-color:rgba(118,233,240,var(--tw-bg-opacity))}.bg-hex-F7B379{--tw-bg-opacity:1;background-color:rgba(247,179,121,var(--tw-bg-opacity))}.bg-hex-EB313E{--tw-bg-opacity:1;background-color:rgba(235,49,62,var(--tw-bg-opacity))}.rounded-md{border-radius:.375rem}.border-solid{border-style:solid}.border{border-width:1px}.border-0\\.5px{border-width:.5px}.flex{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.grid{display:-ms-grid;display:grid}.hidden{display:none}.flex-row{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row}.flex-col{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.items-center{-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.justify-between{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.flex-1{-webkit-box-flex:1;-ms-flex:1 1 0%;-webkit-flex:1 1 0%;flex:1 1 0%}.font-bold{font-weight:700}.h-full{height:100%}.\\!h-full{height:100%!important}.h-90rpx{height:%?90?%}.h-86rpx{height:%?86?%}.h-80rpx{height:%?80?%}.h-120rpx{height:%?120?%}.h-16rpx{height:%?16?%}.h-20rpx{height:%?20?%}.h-80vh{height:80vh}.h-500rpx{height:%?500?%}.text-base{font-size:1rem;line-height:1.5rem}.text-34rpx{font-size:%?34?%;line-height:1}.text-28rpx{font-size:%?28?%;line-height:1}.text-32rpx{font-size:%?32?%;line-height:1}.text-30rpx{font-size:%?30?%;line-height:1}.text-42rpx{font-size:%?42?%;line-height:1}.text-24rpx{font-size:%?24?%;line-height:1}.leading-86rpx{line-height:%?86?%}.my-20rpx{margin-top:%?20?%;margin-bottom:%?20?%}.mx-30rpx{margin-left:%?30?%;margin-right:%?30?%}.my-12rpx{margin-top:%?12?%;margin-bottom:%?12?%}.my-10rpx{margin-top:%?10?%;margin-bottom:%?10?%}.mx-20rpx{margin-left:%?20?%;margin-right:%?20?%}.mr-20px{margin-right:20px}.mt-20rpx{margin-top:%?20?%}.ml-1{margin-left:.25rem}.ml-16rpx{margin-left:%?16?%}.ml-10rpx{margin-left:%?10?%}.mr-20rpx{margin-right:%?20?%}.ml-4rpx{margin-left:%?4?%}.mb-20rpx{margin-bottom:%?20?%}.max-h-1200rpx{max-height:%?1200?%}.opacity-50{opacity:.5}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.p-30rpx{padding:%?30?%}.p-20rpx{padding:%?20?%}.p-16rpx{padding:%?16?%}.px-20rpx{padding-left:%?20?%;padding-right:%?20?%}.px{padding-left:1px;padding-right:1px}.px-10rpx{padding-left:%?10?%;padding-right:%?10?%}.py-10rpx{padding-top:%?10?%;padding-bottom:%?10?%}.py-20rpx{padding-top:%?20?%;padding-bottom:%?20?%}.px-26rpx{padding-left:%?26?%;padding-right:%?26?%}.pb-20rpx{padding-bottom:%?20?%}.\\!pointer-events-none{pointer-events:none!important}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.left-0{left:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px -1px rgba(0,0,0,0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);-webkit-box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.text-center{text-align:center}.text-hex-fa3534{--tw-text-opacity:1;color:rgba(250,53,52,var(--tw-text-opacity))}.text-hex-2979ff{--tw-text-opacity:1;color:rgba(41,121,255,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.indent{text-indent:1.5rem}.content-type{content:"type"}.content-box{content:"box"}.ordinal{--tw-ordinal:ordinal;--tw-slashed-zero:var(--tw-empty,);--tw-numeric-figure:var(--tw-empty,);--tw-numeric-spacing:var(--tw-empty,);--tw-numeric-fraction:var(--tw-empty,);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.invisible{visibility:hidden}.w-full{width:100%}.w-120rpx{width:%?120?%}.w-16rpx{width:%?16?%}.w-140rpx{width:%?140?%}.gap-20rpx{grid-gap:%?20?%;gap:%?20?%}.gap-x-20rpx{-webkit-column-gap:%?20?%;-moz-column-gap:%?20?%;grid-column-gap:%?20?%;column-gap:%?20?%}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate:0;--tw-rotate-x:0;--tw-rotate-y:0;--tw-rotate-z:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;-webkit-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) translateZ(var(--tw-translate-z)) rotate(var(--tw-rotate)) rotateX(var(--tw-rotate-x)) rotateY(var(--tw-rotate-y)) rotate(var(--tw-rotate-z)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) scaleZ(var(--tw-scale-z));-ms-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) translateZ(var(--tw-translate-z)) rotate(var(--tw-rotate)) rotateX(var(--tw-rotate-x)) rotateY(var(--tw-rotate-y)) rotate(var(--tw-rotate-z)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) scaleZ(var(--tw-scale-z));transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) translateZ(var(--tw-translate-z)) rotate(var(--tw-rotate)) rotateX(var(--tw-rotate-x)) rotateY(var(--tw-rotate-y)) rotate(var(--tw-rotate-z)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) scaleZ(var(--tw-scale-z))}.transition{-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,filter,backdrop-filter;-o-transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,-webkit-box-shadow,transform,-webkit-transform,filter,backdrop-filter;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;-o-transition-duration:.15s;transition-duration:.15s}.filter{--tw-blur:var(--tw-empty,);--tw-brightness:var(--tw-empty,);--tw-contrast:var(--tw-empty,);--tw-grayscale:var(--tw-empty,);--tw-hue-rotate:var(--tw-empty,);--tw-invert:var(--tw-empty,);--tw-saturate:var(--tw-empty,);--tw-sepia:var(--tw-empty,);--tw-drop-shadow:var(--tw-empty,);-webkit-filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur{--tw-blur:blur(8px)}',""]),t.exports=a},ef9e:function(t,a,e){var n=e("ea0b");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=e("4f06").default;i("d88fd794",n,!0,{sourceMap:!1,shadowMode:!1})},fcc2:function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n={userInfo:{},user_access_token:"",user_key:"",showAppbar:!0};a.default=n}}); \ No newline at end of file diff --git a/dist/build/h5/static/js/pages-basics-basics-base.8c5fa592.js b/dist/build/h5/static/js/pages-basics-basics-base.d3ff2999.js similarity index 65% rename from dist/build/h5/static/js/pages-basics-basics-base.8c5fa592.js rename to dist/build/h5/static/js/pages-basics-basics-base.d3ff2999.js index faf710c..20ee6c1 100644 --- a/dist/build/h5/static/js/pages-basics-basics-base.8c5fa592.js +++ b/dist/build/h5/static/js/pages-basics-basics-base.d3ff2999.js @@ -16,4 +16,4 @@ * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */},"58e0":function(t,e,n){"use strict";(function(t){var r=n("26ee"),i=n("2f74"),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=a&&a.exports===o,c=u?r["a"].Buffer:void 0,s=c?c.isBuffer:void 0,l=s||i["a"];e["a"]=l}).call(this,n("dd40")(t))},"5e8e":function(t,e,n){"use strict";var r=n("83cc"),i=n.n(r);i.a},"5ea3":function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e["a"]=n}).call(this,n("c8ba"))},"5f04":function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("13d5"),n("d3b7"),n("14d9"),n("4de4");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},label:{type:String,default:""},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"}},computed:{status:{get:function(){return this.value},set:function(t){this.$emit("change",t),this.$emit("input",t)}},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},data:function(){return{options:[],emitData:null,isFirstLoad:!0}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleChange:function(t){var e=this.getOptions.filter((function(e){return e.value==t}));this.emitData=e},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},"5fea":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-checkbox[data-v-7e6e0538]{display:inline-flex;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none;line-height:1.8}.u-checkbox__icon-wrap[data-v-7e6e0538]{color:#606266;flex:none;display:-webkit-flex;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;width:%?42?%;height:%?42?%;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;border:1px solid #c8c9cc;transition-duration:.2s}.u-checkbox__icon-wrap--circle[data-v-7e6e0538]{border-radius:100%}.u-checkbox__icon-wrap--square[data-v-7e6e0538]{border-radius:%?6?%}.u-checkbox__icon-wrap--checked[data-v-7e6e0538]{color:#fff;background-color:#2979ff;border-color:#2979ff}.u-checkbox__icon-wrap--disabled[data-v-7e6e0538]{background-color:#ebedf0;border-color:#c8c9cc}.u-checkbox__icon-wrap--disabled--checked[data-v-7e6e0538]{color:#c8c9cc!important}.u-checkbox__label[data-v-7e6e0538]{word-wrap:break-word;margin-left:%?10?%;margin-right:%?24?%;color:#606266;font-size:%?30?%}.u-checkbox__label--disabled[data-v-7e6e0538]{color:#c8c9cc}',""]),t.exports=e},"62be":function(t,e,n){var r=n("cc76");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("532536c8",r,!0,{sourceMap:!1,shadowMode:!1})},"62f2":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var r=uni.getSystemInfoSync(),i={};e.default={name:"u-navbar",props:{height:{type:[String,Number],default:""},backIconColor:{type:String,default:"#606266"},backIconName:{type:String,default:"nav-back"},backIconSize:{type:[String,Number],default:"44"},backText:{type:String,default:""},backTextStyle:{type:Object,default:function(){return{color:"#606266"}}},title:{type:String,default:""},titleWidth:{type:[String,Number],default:"250"},titleColor:{type:String,default:"#606266"},titleBold:{type:Boolean,default:!1},titleSize:{type:[String,Number],default:32},isBack:{type:[Boolean,String],default:!0},background:{type:Object,default:function(){return{background:"#ffffff"}}},isFixed:{type:Boolean,default:!0},immersive:{type:Boolean,default:!1},borderBottom:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:""},customBack:{type:Function,default:null}},data:function(){return{menuButtonInfo:i,statusBarHeight:r.statusBarHeight}},computed:{navbarInnerStyle:function(){var t={};return t.height=this.navbarHeight+"px",t},navbarStyle:function(){var t={};return t.zIndex=this.zIndex?this.zIndex:this.$u.zIndex.navbar,Object.assign(t,this.background),t},titleStyle:function(){var t={};return t.left=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.right=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.width=uni.upx2px(this.titleWidth)+"px",t},navbarHeight:function(){return this.height?this.height:44}},created:function(){},methods:{goBack:function(){"function"===typeof this.customBack?this.customBack.bind(this.$u.$parent.call(this))():uni.navigateBack()}}}},"64eb":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uSticky:n("680e").default,mescrollBody:n("4d90").default,uSwipeAction:n("844c").default,uLine:n("ee53").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("Appbar",{attrs:{show:t.showAppbar,title:"基地数据"},scopedSlots:t._u([{key:"right",fn:function(){return[n("v-uni-view",{directives:[{name:"auth",rawName:"v-auth",value:["endpoint.agricultural_basic.create"],expression:"['endpoint.agricultural_basic.create']"}],staticClass:"text-white mr-20px",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleCreate.apply(void 0,arguments)}}},[t._v("新增")])]},proxy:!0}])}),n("u-sticky",[n("v-uni-view",{staticClass:"bg-white"},[n("SearchForm",{attrs:{schemas:t.searchFormSchema},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.handleSubmit.apply(void 0,arguments)}}})],1)],1),n("mescroll-body",{attrs:{up:t.upOption,down:t.downOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",t._l(t.dataList,(function(e,r){return n("u-swipe-action",{key:e.id,staticClass:"my-20rpx mx-30rpx rounded-md overflow-hidden",attrs:{show:e.show,index:r,options:t.options},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleClick.apply(void 0,arguments)},"content-click":function(e){arguments[0]=e=t.$handleEvent(e),t.handleContentClick.apply(void 0,arguments)}}},[n("v-uni-view",[n("v-uni-view",{staticClass:"bg-white p-20rpx"},[n("v-uni-view",[t._v("基地名称:"+t._s(e.name))]),n("v-uni-view",[t._v("农业类型:"+t._s(e.industry_label))]),n("v-uni-view",{staticClass:"my-12rpx"},[n("u-line")],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v("基地面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("种养殖面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("就业人数")])],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.areas))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.cultivated))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.workforce))])],1)],1)],1)],1)})),1)],1),n("BaseTablePopup",{attrs:{colums:t.baseTableColums,data:t.currentData,editAuth:["endpoint.agricultural_basic.edit"],delAuth:["endpoint.agricultural_basic.destroy"]},on:{onEdit:function(e){arguments[0]=e=t.$handleEvent(e),t.handleEdit.apply(void 0,arguments)},onDel:function(e){arguments[0]=e=t.$handleEvent(e),t.handleDel.apply(void 0,arguments)}},model:{value:t.baseShow,callback:function(e){t.baseShow=e},expression:"baseShow"}}),n("cuPopup",{attrs:{title:t.currentData?"编辑基地":"新增基地"},model:{value:t.formShow,callback:function(e){t.formShow=e},expression:"formShow"}},[n("BasicsEdit",{attrs:{data:t.currentData},on:{cancel:function(e){arguments[0]=e=t.$handleEvent(e),t.formShow=!1},confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.handleEditConfirm.apply(void 0,arguments)}}})],1)],1)},o=[]},"66f6":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,".mescroll-body[data-v-6b5ff080]{position:relative; /* 下拉刷新区域相对自身定位 */height:auto; /* 不可固定高度,否则overflow:hidden导致无法滑动; 同时使设置的最小高生效,实现列表不满屏仍可下拉*/overflow:hidden; /* 当有元素写在mescroll-body标签前面时,可遮住下拉刷新区域 */box-sizing:border-box /* 避免设置padding出现双滚动条的问题 */}\r\n\r\n/* 使sticky生效: 父元素不能overflow:hidden或者overflow:auto属性 */.mescroll-body.mescorll-sticky[data-v-6b5ff080]{overflow:unset!important}\r\n\r\n/* 适配 iPhoneX */@supports (bottom:constant(safe-area-inset-bottom)) or (bottom:env(safe-area-inset-bottom)){.mescroll-safearea[data-v-6b5ff080]{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}}\r\n\r\n/* 下拉刷新区域 */.mescroll-downwarp[data-v-6b5ff080]{position:absolute;top:-100%;left:0;width:100%;height:100%;text-align:center}\r\n\r\n/* 下拉刷新--内容区,定位于区域底部 */.mescroll-downwarp .downwarp-content[data-v-6b5ff080]{position:absolute;left:0;bottom:0;width:100%;min-height:%?60?%;padding:%?20?% 0;text-align:center}\r\n\r\n/* 下拉刷新--提示文本 */.mescroll-downwarp .downwarp-tip[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle;margin-left:%?16?%\r\n\t/* color: gray; 已在style设置color,此处删去*/}\r\n\r\n/* 下拉刷新--旋转进度条 */.mescroll-downwarp .downwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-downwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}\r\n\r\n/* 上拉加载区域 */.mescroll-upwarp[data-v-6b5ff080]{box-sizing:border-box;min-height:%?110?%;padding:%?30?% 0;text-align:center;clear:both}\r\n\r\n/*提示文本 */.mescroll-upwarp .upwarp-tip[data-v-6b5ff080],\r\n.mescroll-upwarp .upwarp-nodata[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle\r\n\t/* color: gray; 已在style设置color,此处删去*/}.mescroll-upwarp .upwarp-tip[data-v-6b5ff080]{margin-left:%?16?%}\r\n\r\n/*旋转进度条 */.mescroll-upwarp .upwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-upwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}",""]),t.exports=e},"680e":function(t,e,n){"use strict";n.r(e);var r=n("8cc1"),i=n("0f4f");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("5e8e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"adf85ec2",null,!1,r["a"],a);e["default"]=c.exports},"6a1a":function(t,e,n){var r=n("c35c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("221bf9c5",r,!0,{sourceMap:!1,shadowMode:!1})},"6ccf":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-calendar[data-v-7de526b6]{color:#606266}.u-calendar__header[data-v-7de526b6]{width:100%;box-sizing:border-box;font-size:%?30?%;background-color:#fff;color:#303133}.u-calendar__header__text[data-v-7de526b6]{margin-top:%?30?%;padding:0 %?60?%;display:flex;flex-direction:row;justify-content:center;align-items:center}.u-calendar__action[data-v-7de526b6]{padding:%?40?% 0 %?40?% 0}.u-calendar__action__icon[data-v-7de526b6]{margin:0 %?16?%}.u-calendar__action__text[data-v-7de526b6]{padding:0 %?16?%;color:#303133;font-size:%?32?%;line-height:%?32?%;font-weight:700}.u-calendar__week-day[data-v-7de526b6]{display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden}.u-calendar__week-day__text[data-v-7de526b6]{flex:1;text-align:center}.u-calendar__content[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;padding:6px 0;box-sizing:border-box;background-color:#fff;position:relative}.u-calendar__content--end-date[data-v-7de526b6]{border-top-right-radius:%?8?%;border-bottom-right-radius:%?8?%}.u-calendar__content--start-date[data-v-7de526b6]{border-top-left-radius:%?8?%;border-bottom-left-radius:%?8?%}.u-calendar__content__item[data-v-7de526b6]{width:14.2857%;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden;position:relative;z-index:2}.u-calendar__content__item__inner[data-v-7de526b6]{height:%?84?%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;font-size:%?32?%;position:relative;border-radius:50%}.u-calendar__content__item__inner__desc[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:center center;transform-origin:center center;position:absolute;left:0;text-align:center;bottom:%?2?%}.u-calendar__content__item__tips[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;position:absolute;left:0;-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;text-align:center;bottom:%?8?%;z-index:2}.u-calendar__content__bg-month[data-v-7de526b6]{position:absolute;font-size:130px;line-height:130px;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#e4e7ed;z-index:1}.u-calendar__bottom[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;background-color:#fff;padding:0 %?40?% %?30?%;box-sizing:border-box;font-size:%?24?%;color:#909399}.u-calendar__bottom__choose[data-v-7de526b6]{height:%?50?%}.u-calendar__bottom__btn[data-v-7de526b6]{width:100%}',""]),t.exports=e},"6e0a":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={data:function(){return{wxsProp:{optDown:{},scrollTop:0,bodyHeight:0,isDownScrolling:!1,isUpScrolling:!1,isScrollBody:!0,isUpBoth:!0,t:0},callProp:{callType:"",t:0}}},methods:{wxsCall:function(t){"setWxsProp"===t.type?this.wxsProp={optDown:this.mescroll.optDown,scrollTop:this.mescroll.getScrollTop(),bodyHeight:this.mescroll.getBodyHeight(),isDownScrolling:this.mescroll.isDownScrolling,isUpScrolling:this.mescroll.isUpScrolling,isUpBoth:this.mescroll.optUp.isBoth,isScrollBody:this.mescroll.isScrollBody,t:Date.now()}:"setLoadType"===t.type?(this.downLoadType=t.downLoadType,this.$set(this.mescroll,"downLoadType",this.downLoadType),this.$set(this.mescroll,"isDownEndSuccess",null)):"triggerDownScroll"===t.type?this.mescroll.triggerDownScroll():"endDownScroll"===t.type?this.mescroll.endDownScroll():"triggerUpScroll"===t.type&&this.mescroll.triggerUpScroll(!0)}},mounted:function(){var t=this;this.mescroll.optDown.afterLoading=function(){t.callProp={callType:"showLoading",t:Date.now()}},this.mescroll.optDown.afterEndDownScroll=function(){t.callProp={callType:"endDownScroll",t:Date.now()};var e=300+(t.mescroll.optDown.beforeEndDelay||0);setTimeout((function(){4!==t.downLoadType&&0!==t.downLoadType||(t.callProp={callType:"clearTransform",t:Date.now()}),t.$set(t.mescroll,"downLoadType",t.downLoadType)}),e)},this.wxsCall({type:"setWxsProp"})}};e.default=r},"6eaa":function(t,e,n){"use strict";n.r(e);var r=n("1078"),i=n("9ac8");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},"6ef1":function(t,e,n){"use strict";n.r(e);var r=n("0416"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"6f5a":function(t,e,n){var r=n("66f6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("704c32ba",r,!0,{sourceMap:!1,shadowMode:!1})},"71e9":function(t,e,n){var r=n("3f29");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("577b2531",r,!0,{sourceMap:!1,shadowMode:!1})},"73cb":function(t,e,n){"use strict";n.r(e);var r=n("24c0"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"752f":function(t,e,n){"use strict";var r=function(t){(t.options.wxs||(t.options.wxs={}))["wxsBiz"]=function(t){var e={};function n(t){t&&(e.optDown=t.optDown,e.scrollTop=t.scrollTop,e.bodyHeight=t.bodyHeight,e.isDownScrolling=t.isDownScrolling,e.isUpScrolling=t.isUpScrolling,e.isUpBoth=t.isUpBoth,e.isScrollBody=t.isScrollBody,e.startTop=t.scrollTop)}function r(t,n,r){e.disabled()||t.callType&&("showLoading"===t.callType?e.showLoading(r):"endDownScroll"===t.callType?e.endDownScroll(r):"clearTransform"===t.callType&&e.clearTransform(r))}function i(t,n){e.downHight=0,e.startPoint=e.getPoint(t),e.startTop=e.getScrollTop(),e.startAngle=0,e.lastPoint=e.startPoint,e.maxTouchmoveY=e.getBodyHeight()-e.optDown.bottomOffset,e.inTouchend=!1,e.callMethod(n,{type:"setWxsProp"})}function o(t,n){var r=!0;if(e.disabled())return r;var i=e.getScrollTop(),o=e.getPoint(t),u=o.y-e.startPoint.y;if(u>0&&(e.isScrollBody&&i<=0||!e.isScrollBody&&(i<=0||i<=e.optDown.startTop&&i===e.startTop))&&!e.inTouchend&&!e.isDownScrolling&&!e.optDown.isLock&&(!e.isUpScrolling||e.isUpScrolling&&e.isUpBoth)){if(e.startAngle||(e.startAngle=e.getAngle(e.lastPoint,o)),e.startAngle0&&o.y>=e.maxTouchmoveY)return e.inTouchend=!0,a(t,n),r;r=!1;var c=o.y-e.lastPoint.y;e.downHight0?c*e.optDown.outOffsetRate:c),e.downHight=Math.round(e.downHight);var s=e.downHight/e.optDown.offset;e.onMoving(n,s,e.downHight)}return e.lastPoint=o,r}function a(t,n){if(e.isMoveDown)e.downHight>=e.optDown.offset?(e.downHight=e.optDown.offset,e.callMethod(n,{type:"triggerDownScroll"})):(e.downHight=0,e.callMethod(n,{type:"endDownScroll"})),e.movetype=0,e.isMoveDown=!1;else if(!e.isScrollBody&&e.getScrollTop()===e.startTop){var r=e.getPoint(t).y-e.startPoint.y<0;if(r){var i=e.getAngle(e.getPoint(t),e.startPoint);i>80&&e.callMethod(n,{type:"triggerUpScroll"})}}e.callMethod(n,{type:"setWxsProp"})}return e.onMoving=function(t,e,n){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"transform",transform:"translateY("+n+"px)",transition:""});var r=t.selectComponent(".mescroll-wxs-progress");r&&r.setStyle({transform:"rotate("+360*e+"deg)"})}))},e.showLoading=function(t){e.downHight=e.optDown.offset,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY("+e.downHight+"px)",transition:"transform 300ms"})}))},e.endDownScroll=function(t){e.downHight=0,e.isDownScrolling=!1,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY(0)",transition:"transform 300ms"})}))},e.clearTransform=function(t){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"",transform:"",transition:""})}))},e.disabled=function(){return!e.optDown||!e.optDown.use||e.optDown.native},e.getPoint=function(t){return t?t.touches&&t.touches[0]?{x:t.touches[0].pageX,y:t.touches[0].pageY}:t.changedTouches&&t.changedTouches[0]?{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY}:{x:t.clientX,y:t.clientY}:{x:0,y:0}},e.getAngle=function(t,e){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=Math.sqrt(n*n+r*r),o=0;return 0!==i&&(o=Math.asin(r/i)/Math.PI*180),o},e.getScrollTop=function(){return e.scrollTop||0},e.getBodyHeight=function(){return e.bodyHeight||0},e.callMethod=function(t,e){t&&t.callMethod("wxsCall",e)},t.exports={propObserver:n,callObserver:r,touchstartEvent:i,touchmoveEvent:o,touchendEvent:a},t.exports}({exports:{}})};e["a"]=r},"75c4":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-select__action[data-v-70094335]{position:relative;line-height:%?70?%;height:%?70?%}.u-select__action__icon[data-v-70094335]{position:absolute;right:%?20?%;top:50%;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:1}.u-select__action__icon--reverse[data-v-70094335]{-webkit-transform:rotate(-180deg) translateY(50%);transform:rotate(-180deg) translateY(50%)}.u-select__hader__title[data-v-70094335]{color:#606266}.u-select--border[data-v-70094335]{border-radius:%?6?%;border-radius:4px;border:1px solid #dcdfe6}.u-select__header[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:%?80?%;padding:0 %?40?%}.u-select__body[data-v-70094335]{width:100%;height:%?500?%;overflow:hidden;background-color:#fff}.u-select__body__picker-view[data-v-70094335]{height:100%;box-sizing:border-box}.u-select__body__picker-view__item[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:%?32?%;color:#303133;padding:0 %?8?%}',""]),t.exports=e},"76db":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-select"},[n("u-popup",{attrs:{maskCloseAble:t.maskCloseAble,mode:"bottom",popup:!1,length:"auto",safeAreaInsetBottom:t.safeAreaInsetBottom,"z-index":t.uZIndex},on:{close:function(e){arguments[0]=e=t.$handleEvent(e),t.close.apply(void 0,arguments)}},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[n("v-uni-view",{staticClass:"u-select"},[n("v-uni-view",{staticClass:"u-select__header",on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e)}}},[n("v-uni-view",{staticClass:"u-select__header__cancel u-select__header__btn",style:{color:t.cancelColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getResult("cancel")}}},[t._v(t._s(t.cancelText))]),n("v-uni-view",{staticClass:"u-select__header__title"},[t._v(t._s(t.title))]),n("v-uni-view",{staticClass:"u-select__header__confirm u-select__header__btn",style:{color:t.moving?t.cancelColor:t.confirmColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{touchmove:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.getResult("confirm")}}},[t._v(t._s(t.confirmText))])],1),n("v-uni-view",{staticClass:"u-select__body"},[t.value?n("v-uni-picker-view",{staticClass:"u-select__body__picker-view",attrs:{value:t.defaultSelector},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.columnChange.apply(void 0,arguments)},pickstart:function(e){arguments[0]=e=t.$handleEvent(e),t.pickstart.apply(void 0,arguments)},pickend:function(e){arguments[0]=e=t.$handleEvent(e),t.pickend.apply(void 0,arguments)}}},t._l(t.columnData,(function(e,r){return n("v-uni-picker-view-column",{key:r},t._l(e,(function(e,r){return n("v-uni-view",{key:r,staticClass:"u-select__body__picker-view__item"},[n("v-uni-view",{staticClass:"u-line-1"},[t._v(t._s(e[t.labelName]))])],1)})),1)})),1):t._e()],1)],1)],1)],1)},o=[]},7860:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("99af"),n("ac1f"),n("5319"),n("fb6a"),n("a630"),n("3ca3"),n("d3b7"),n("ddb0");e.default={name:"u-calendar",props:{safeAreaInsetBottom:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},value:{type:Boolean,default:!1},zIndex:{type:[String,Number],default:0},changeYear:{type:Boolean,default:!0},changeMonth:{type:Boolean,default:!0},mode:{type:String,default:"date"},maxYear:{type:[Number,String],default:2050},minYear:{type:[Number,String],default:1950},minDate:{type:[Number,String],default:"1950-01-01"},maxDate:{type:[Number,String],default:""},borderRadius:{type:[String,Number],default:20},monthArrowColor:{type:String,default:"#606266"},yearArrowColor:{type:String,default:"#909399"},color:{type:String,default:"#303133"},activeBgColor:{type:String,default:"#2979ff"},activeColor:{type:String,default:"#ffffff"},rangeBgColor:{type:String,default:"rgba(41,121,255,0.13)"},rangeColor:{type:String,default:"#2979ff"},startText:{type:String,default:"开始"},endText:{type:String,default:"结束"},btnType:{type:String,default:"primary"},isActiveCurrent:{type:Boolean,default:!0},isChange:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},toolTip:{type:String,default:"选择日期"}},data:function(){return{weekday:1,weekdayArr:[],days:0,daysArr:[],showTitle:"",year:2020,month:0,day:0,startYear:0,startMonth:0,startDay:0,endYear:0,endMonth:0,endDay:0,today:"",activeDate:"",startDate:"",endDate:"",isStart:!0,min:null,max:null,weekDayZh:["日","一","二","三","四","五","六"]}},computed:{dataChange:function(){return"".concat(this.mode,"-").concat(this.minDate,"-").concat(this.maxDate)},uZIndex:function(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},watch:{dataChange:function(t){this.init()}},created:function(){this.init()},methods:{getColor:function(t,e){var n=1==e?"":this.color,r=t+1,i="".concat(this.year,"-").concat(this.month,"-").concat(r),o=new Date(i.replace(/\-/g,"/")).getTime(),a=this.startDate.replace(/\-/g,"/"),u=this.endDate.replace(/\-/g,"/");return this.isActiveCurrent&&this.activeDate==i||this.startDate==i||this.endDate==i?n=1==e?this.activeBgColor:this.activeColor:this.endDate&&o>new Date(a).getTime()&&on&&(t=n),this.year=t.getFullYear(),this.month=t.getMonth()+1,this.day=t.getDate(),this.today="".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()),this.activeDate=this.today,this.min=this.initDate(this.minDate),this.max=this.initDate(this.maxDate||this.today),this.startDate="",this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.endDate="",this.isStart=!0,this.changeData()},initDate:function(t){var e=t.split("-");return{year:Number(e[0]||1920),month:Number(e[1]||1),day:Number(e[2]||1)}},openDisAbled:function(t,e,n){var r=!0,i="".concat(t,"/").concat(e,"/").concat(n),o="".concat(this.min.year,"/").concat(this.min.month,"/").concat(this.min.day),a="".concat(this.max.year,"/").concat(this.max.month,"/").concat(this.max.day),u=new Date(i).getTime();return u>=new Date(o).getTime()&&u<=new Date(a).getTime()&&(r=!1),r},generateArray:function(t,e){return Array.from(new Array(e+1).keys()).slice(t)},formatNum:function(t){return t<10?"0"+t:t+""},getMonthDay:function(t,e){var n=new Date(t,e,0).getDate();return n},getWeekday:function(t,e){var n=new Date("".concat(t,"/").concat(e,"/01 00:00:00"));return n.getDay()},checkRange:function(t){var e=!1;return(tthis.maxYear)&&(uni.showToast({title:"日期超出范围啦~",icon:"none"}),e=!0),e},changeMonthHandler:function(t){if(t){var e=this.month+1,n=e>12?this.year+1:this.year;this.checkRange(n)||(this.month=e>12?1:e,this.year=n,this.changeData())}else{var r=this.month-1,i=r<1?this.year-1:this.year;this.checkRange(i)||(this.month=r<1?12:r,this.year=i,this.changeData())}},changeYearHandler:function(t){var e=t?this.year+1:this.year-1;this.checkRange(e)||(this.year=e,this.changeData())},changeData:function(){this.days=this.getMonthDay(this.year,this.month),this.daysArr=this.generateArray(1,this.days),this.weekday=this.getWeekday(this.year,this.month),this.weekdayArr=this.generateArray(1,this.weekday),this.showTitle="".concat(this.year,"年").concat(this.month,"月"),this.isChange&&"date"==this.mode&&this.btnFix(!0)},dateClick:function(t){if(t+=1,!this.openDisAbled(this.year,this.month,t)){this.day=t;var e="".concat(this.year,"-").concat(this.month,"-").concat(t);if("date"==this.mode)this.activeDate=e;else{var n=new Date(e.replace(/\-/g,"/")).getTime()0?n("v-uni-view",{staticClass:"mescroll-bottombar",style:{height:t.windowBottom+"px"}}):t._e(),t.safearea?n("v-uni-view",{staticClass:"mescroll-safearea"}):t._e(),n("mescroll-top",{attrs:{option:t.mescroll.optUp.toTop},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}},model:{value:t.isShowToTop,callback:function(e){t.isShowToTop=e},expression:"isShowToTop"}}),n("v-uni-view",{wxsProps:{"change:prop":"wxsProp"},attrs:{"change:prop":t.renderBiz.propObserver,prop:t.wxsProp}})],1)},o=[]},"980a":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-swipe-action[data-v-1adff301]{width:auto;height:auto;position:relative;overflow:hidden}.u-swipe-view[data-v-1adff301]{display:flex;flex-direction:row;height:auto;position:relative\n /* 这一句很关键,覆盖默认的绝对定位 */}.u-swipe-content[data-v-1adff301]{flex:1}.u-swipe-del[data-v-1adff301]{position:relative;font-size:%?30?%;color:#fff}.u-btn-text[data-v-1adff301]{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}',""]),t.exports=e},9971:function(module,exports,__webpack_require__){"use strict";__webpack_require__("7a82");var _interopRequireDefault=__webpack_require__("ee27").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _slicedToArray2=_interopRequireDefault(__webpack_require__("d0af")),_typeof2=_interopRequireDefault(__webpack_require__("0122")),_createForOfIteratorHelper2=_interopRequireDefault(__webpack_require__("54f8"));__webpack_require__("4de4"),__webpack_require__("d3b7"),__webpack_require__("d81d"),__webpack_require__("c975"),__webpack_require__("159b"),__webpack_require__("b64b"),__webpack_require__("7db0"),__webpack_require__("c760"),__webpack_require__("f8c9"),__webpack_require__("caad"),__webpack_require__("2532"),__webpack_require__("14d9"),__webpack_require__("4fadc"),__webpack_require__("ac1f"),__webpack_require__("00b4"),__webpack_require__("466d"),__webpack_require__("498a");var _SearchItem=_interopRequireDefault(__webpack_require__("c881")),_lodashEs=__webpack_require__("4fcf6"),_default2=exports.default={props:{schemas:{type:Array,default:function(){return[]}}},components:{SearchItem:_SearchItem.default},computed:{formActionType:function formActionType(){var _this=this;return{setFieldsValue:function setFieldsValue(values){var fields=_this.getSchema.map((function(t){return t.field})).filter(Boolean),delimiter=".",nestKeyArray=fields.filter((function(t){return t.indexOf(delimiter)>=0})),validKeys=[];Object.keys(values).forEach((function(key){var schema=_this.getSchema.find((function(t){return t.field===key})),value=values[key],hasKey=Reflect.has(values,key);hasKey&&fields.includes(key)?(_this.formModel[key]=value,validKeys.push(key)):nestKeyArray.forEach((function(nestKey){try{var _value=eval("values"+delimiter+nestKey);_this.isDef(_value)&&(_this.formModel[nestKey]=_value,validKeys.push(nestKey))}catch(e){_this.isDef(defaultValueRef.value[nestKey])&&(_this.formModel[nestKey]=(0,_lodashEs.cloneDeep)(defaultValueRef.value[nestKey]))}}))}))}}},getSchema:function(){var t,e=this.schemas,n=(0,_createForOfIteratorHelper2.default)(e);try{for(n.s();!(t=n.n()).done;)t.value}catch(r){n.e(r)}finally{n.f()}return(0,_lodashEs.cloneDeep)(e)}},data:function(){return{isOpen:!1,formModel:{}}},created:function(){this.initFormModel()},methods:{handleOpen:function(){console.log("====")},handleCloseDropdown:function(){var t;null===(t=this.$refs.dropdownRef)||void 0===t||t.close()},initFormModel:function(){var t=this.schemas,e={};t.forEach((function(t){var n=t.field,r=t.defaultValue;n&&(e[n]=r)})),this.formModel=e},handleInputNumberValue:function(t,e){return t&&["Input","InputPassword","InputSearch","InputTextArea"].includes(t)&&e&&this.isNumber(e)?"".concat(e):e},isDef:function(t){return"undefined"!==typeof t},isNumber:function(t){return"number"===typeof t&&!isNaN(t)},isArray:function(t){return Array.isArray(t)},isObject:function(t){return"object"===(0,_typeof2.default)(t)&&null!==t},isFunction:function(t){return"function"===typeof t},setFormModel:function(t,e){this.formModel[t]=e,this.$emit("field-value-change",t,e)},handleFormValues:function(t){if(!this.isObject(t))return{};for(var e={},n=function(){var t=i[r],n=(0,_slicedToArray2.default)(t,2),o=n[1],a=(0,_slicedToArray2.default)(t,1),u=a[0],c=/^\[(.+)\]$/;if(c.test(u)){var s=u.match(c)[1].split(",");s.forEach((function(t,n){var r,i=null!==(r=null===o||void 0===o?void 0:o[n])&&void 0!==r?r:"";i&&(e[t.trim()]=i)}))}else o&&(e[u]=o)},r=0,i=Object.entries(t);r=this.parent.max)return this.$u.toast("最多可选".concat(this.parent.max,"项"));this.emitEvent(),this.$emit("input",!this.value)}}}}},a96b:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{value:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"100%"},height:{type:String,default:"100%"}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}},data:function(){return{}}}},adb4:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{option:{type:Object,default:function(){return{}}},value:!1,modelValue:!1},computed:{left:function(){return this.option.left?this.addUnit(this.option.left):"auto"},right:function(){return this.option.left?"auto":this.addUnit(this.option.right)},isShow:function(){return this.value}},methods:{addUnit:function(t){return t?"number"===typeof t?t+"rpx":t:0},toTopClick:function(){this.$emit("input",!1),this.$emit("click")}}}},add5:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请选择日期"},params:{type:Object,default:function(){return{}}},mode:{type:String,default:"date"}},computed:{isRange:function(){return"range"===this.mode},placeholderStr:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.placeholder)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.placeholder)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.placeholder},status:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.date)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.date)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.date}},data:function(){return{show:!1,date:null}},methods:{openCalendar:function(){this.show=!0},handleChange:function(t){var e;if(this.isRange){var n=t.startDate,r=t.endDate;e=[n,r]}else e=t.result;this.$emit("change",e),this.$emit("input",e),this.date=e,this.$emit("close-dropdown",e)}},watch:{value:{handler:function(t){this.date=t},immediate:!0,deep:!0}}}},aec2:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("7db0"),n("d3b7"),n("c740"),n("13d5"),n("14d9");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},placeholder:{type:String,default:"请选择"}},data:function(){return{show:!1,isFirstLoad:!0,options:[]}},computed:{currentOption:function(){var t=this,e=this.getOptions.find((function(e){return e.value==t.value}));return null!==e&&void 0!==e?e:{}},showText:function(){var t,e;return null!==(t=null===(e=this.currentOption)||void 0===e?void 0:e.label)&&void 0!==t?t:this.value},defaultValue:function(){var t=this,e=this.getOptions.findIndex((function(e){return e.value==t.value}));return[e>-1?e:0]},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleConfirm:function(t){if(t.length){var e=t[0].value;null!=e&&(this.$emit("change",e),this.$emit("input",e))}},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},aecc:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("component",t._g(t._b({},"component",t.getBindValue.bind,!1),t.getBindValue.on))},o=[]},b14d:function(t,e,n){var r=n("86cb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("6d1ac5d2",r,!0,{sourceMap:!1,shadowMode:!1})},b2d8:function(t,e,n){"use strict";n.r(e);var r=n("fcd2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},b471:function(t,e,n){"use strict";n.r(e);var r=n("fe9d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},b53f:function(t,e,n){"use strict";n.r(e);var r=n("f940"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},baac:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-line",style:[t.lineStyle]})},o=[]},bade:function(t,e,n){"use strict";n.r(e);var r=n("7860"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},bd0a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3"));n("d3b7"),n("159b"),n("14d9");var o=r(n("e350"));e.default={props:{value:{type:Boolean,default:!1},data:{type:Object,default:function(){}},colums:{type:Array,default:function(){return[]}},editAuth:{type:Array,default:function(){return[]}},delAuth:{type:Array,default:function(){return[]}}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}},isEdit:function(){return!!this.$listeners.onEdit&&(0,o.default)(this.editAuth)},isDel:function(){return!!this.$listeners.onDel&&(0,o.default)(this.delAuth)},columsList:function(){var t=this,e=[];return this.colums.forEach((function(n){var r=n.dataIndex,o=n.format,a=t.data[r];t.isFunction(o)&&(a=o(a)),e.push((0,i.default)((0,i.default)({},n),{},{value:a}))})),e}},methods:{isFunction:function(t){return"function"===typeof t},handleEdit:function(){this.$emit("onEdit",this.data)},handleDel:function(){this.$emit("onDel",this.data)}}}},bd58:function(t,e,n){"use strict";var r=n("b14d"),i=n.n(r);i.a},be8c:function(t,e,n){"use strict";n.r(e);var r=n("849d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},becc:function(t,e,n){"use strict";var r=n("6a1a"),i=n.n(r);i.a},c17b:function(t,e,n){"use strict";n.r(e);var r=n("2a6c"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},c35c:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-loading-circle[data-v-19cf7fca]{display:inline-flex;vertical-align:middle;width:%?28?%;height:%?28?%;background:0 0;border-radius:50%;border:2px solid;border-color:#e5e5e5 #e5e5e5 #e5e5e5 #8f8d8e;-webkit-animation:u-circle-data-v-19cf7fca 1s linear infinite;animation:u-circle-data-v-19cf7fca 1s linear infinite}.u-loading-flower[data-v-19cf7fca]{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}@-webkit-keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes u-circle-data-v-19cf7fca{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}',""]),t.exports=e},c699:function(t,e,n){"use strict";n.r(e);var r=n("64eb"),i=n("b2d8");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},c6c9:function(t,e,n){"use strict";n.r(e);var r=n("1794"),i=n("bade");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("cb36");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"7de526b6",null,!1,r["a"],a);e["default"]=c.exports},c6eb:function(t,e,n){"use strict";(function(t){var r=n("5ea3"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a&&r["a"].process,c=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(e){}}();e["a"]=c}).call(this,n("dd40")(t))},c760:function(t,e,n){"use strict";var r=n("23e7");r({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},c86e:function(t,e,n){"use strict";var r=n("353f"),i=n.n(r);i.a},c881:function(t,e,n){"use strict";n.r(e);var r=n("aecc"),i=n("338d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},c892:function(t,e,n){"use strict";n.r(e);var r=n("82d3"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},cb29:function(t,e,n){"use strict";var r=n("23e7"),i=n("81d5"),o=n("44d2");r({target:"Array",proto:!0},{fill:i}),o("fill")},cb36:function(t,e,n){"use strict";var r=n("7b18"),i=n.n(r);i.a},cc76:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-navbar[data-v-2920cc37]{width:100%}.u-navbar-fixed[data-v-2920cc37]{position:fixed;left:0;right:0;top:0;z-index:991}.u-status-bar[data-v-2920cc37]{width:100%}.u-navbar-inner[data-v-2920cc37]{display:flex;flex-direction:row;justify-content:space-between;position:relative;align-items:center}.u-back-wrap[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;flex:1;flex-grow:0;padding:%?14?% %?14?% %?14?% %?24?%}.u-back-text[data-v-2920cc37]{padding-left:%?4?%;font-size:%?30?%}.u-navbar-content-title[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;justify-content:center;flex:1;position:absolute;left:0;right:0;height:%?60?%;text-align:center;flex-shrink:0}.u-navbar-centent-slot[data-v-2920cc37]{flex:1}.u-title[data-v-2920cc37]{line-height:%?60?%;font-size:%?32?%;flex:1}.u-navbar-right[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.u-slot-content[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center}',""]),t.exports=e},d2f3:function(t,e,n){"use strict";n.r(e);var r=n("1744"),i=n("f14d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},d3c3:function(t,e,n){"use strict";n.r(e);var r=n("0084"),i=n("24fe");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("05d7");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"30d8d7e6",null,!1,r["a"],a);e["default"]=c.exports},d50a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("2ca0"),n("ac1f"),n("5319");var i=r(n("fc11")),o=r(n("f3f3")),a=r(n("9c49")),u=r(n("6eaa")),c=r(n("d3c3")),s=r(n("2fed")),l=n("4fcf6");e.default={props:{schema:{type:Object,default:function(){}},setFormModel:{type:Function,default:function(){}},formModel:{type:Object,default:function(){}},formActionType:{type:Object,default:function(){}},isOpen:{type:Boolean}},components:{ApiSelect:a.default,Select:u.default,Calendar:c.default,Input:s.default},created:function(){},computed:{getValues:function(){this.allDefaultValues;var t=this.formModel,e=this.schema;return{field:e.field,model:t,values:(0,o.default)({},t),schema:e}},getComponentsProps:function(){var t,e=this.schema,n=this.formModel,r=this.formActionType,i=e.componentProps,o=void 0===i?{}:i;this.isFunction(o)&&(o=null!==(t=o({schema:e,formModel:n,formActionType:r}))&&void 0!==t?t:{});return o},getBindValue:function(){var t,e=this,n=this.schema,r=n.component,a=n.field,u=n.changeEvent,c=void 0===u?"change":u,s=n.valueField,f=n.label,d="on".concat((0,l.upperFirst)(c)),p=(t={},(0,i.default)(t,d,(function(t){e.setFormModel(a,t)})),(0,i.default)(t,"onCloseDropdown",(function(){e.$emit("close-dropdown")})),t),h=(0,o.default)((0,o.default)({},this.getComponentsProps),{},{label:f});h.codeField=a,h.formValues=this.getValues;var v=(0,i.default)({},s||"value",this.formModel[a]),m=(0,o.default)((0,o.default)((0,o.default)((0,o.default)({is:r},h),v),p),{},{isOpen:this.isOpen}),g={},b={};for(var y in m)if(y.startsWith("on")&&"function"===typeof m[y]){var w=(0,l.kebabCase)(y.replace("on",""));g[w]=m[y]}else b[y]=m[y];return{bind:b,on:g}}},methods:{isFunction:function(t){return"function"===typeof t&&null!==t},fetch:function(){var t=this.formModel,e=this.schema,n=e.componentProps,r=void 0===n?{}:n,i=e.components;if(this.isFunction(r)&&(r=r({schema:e,formModel:t})),"ApiSelect"===i){var o=r,a=o.api;if(!a||!this.isFunction(a))return}else conponents;console.log(this.schema)}}}},d518:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uIcon:n("f86b").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{},[n("v-uni-view",{staticClass:"u-navbar",class:{"u-navbar-fixed":t.isFixed,"u-border-bottom":t.borderBottom},style:[t.navbarStyle]},[n("v-uni-view",{staticClass:"u-status-bar",style:{height:t.statusBarHeight+"px"}}),n("v-uni-view",{staticClass:"u-navbar-inner",style:[t.navbarInnerStyle]},[t.isBack?n("v-uni-view",{staticClass:"u-back-wrap",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goBack.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"u-icon-wrap"},[n("u-icon",{attrs:{name:t.backIconName,color:t.backIconColor,size:t.backIconSize}})],1),t.backText?n("v-uni-view",{staticClass:"u-icon-wrap u-back-text u-line-1",style:[t.backTextStyle]},[t._v(t._s(t.backText))]):t._e()],1):t._e(),t.title?n("v-uni-view",{staticClass:"u-navbar-content-title",style:[t.titleStyle]},[n("v-uni-view",{staticClass:"u-title u-line-1",style:{color:t.titleColor,fontSize:t.titleSize+"rpx",fontWeight:t.titleBold?"bold":"normal"}},[t._v(t._s(t.title))])],1):t._e(),n("v-uni-view",{staticClass:"u-slot-content"},[t._t("default")],2),n("v-uni-view",{staticClass:"u-slot-right"},[t._t("right")],2)],1)],1),t.isFixed&&!t.immersive?n("v-uni-view",{staticClass:"u-navbar-placeholder",style:{width:"100%",height:Number(t.navbarHeight)+t.statusBarHeight+"px"}}):t._e()],1)},o=[]},d54d:function(t,e,n){"use strict";n.r(e);var r=n("62f2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},da66:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={def:"zh",getType:function(){return uni.getStorageSync("mescroll-i18n")||this.def},setType:function(t){uni.setStorageSync("mescroll-i18n",t)}};e.default=r},db00:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.inp[data-v-30d8d7e6]{border-radius:%?4?%;border-width:1px;-webkit-box-flex:1;-ms-flex:1 1 0%;-webkit-flex:1 1 0%;flex:1 1 0%;height:%?60?%;line-height:%?60?%;padding-left:10px;padding-right:10px}',""]),t.exports=e},dd40:function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},df51:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.option.src?n("v-uni-image",{staticClass:"mescroll-totop",class:[t.isShow?"mescroll-totop-in":"mescroll-totop-out",{"mescroll-totop-safearea":t.option.safearea}],style:{"z-index":t.option.zIndex,left:t.left,right:t.right,bottom:t.addUnit(t.option.bottom),width:t.addUnit(t.option.width),"border-radius":t.addUnit(t.option.radius)},attrs:{src:t.option.src,mode:"widthFix"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}}}):t._e()},o=[]},dff1:function(t,e,n){"use strict";(function(t){var r=n("26ee"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a?r["a"].Buffer:void 0,c=u?u.allocUnsafe:void 0;function s(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}e["a"]=s}).call(this,n("dd40")(t))},e10c:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uCheckboxGroup:n("e620").default,uCheckbox:n("1e79").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-checkbox-group",{on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxGroupChange.apply(void 0,arguments)}}},t._l(t.getOptions,(function(e,r){return n("u-checkbox",{key:e.value,attrs:{name:e.value},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxChange.apply(void 0,arguments)}},model:{value:e.checked,callback:function(n){t.$set(e,"checked",n)},expression:"item.checked"}},[t._v(t._s(e.label))])})),1)],1)},o=[]},e249:function(t,e,n){var r=n("980a");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("34ca650a",r,!0,{sourceMap:!1,shadowMode:!1})},e350:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,n("d3b7"),n("caad"),n("2532");var i=r(n("4360"));function o(t){if(t&&t instanceof Array&&t.length>0){var e,n,r=i.default.getters&&(null!==(e=null===(n=i.default.getters.userInfo)||void 0===n?void 0:n.permissions_slug)&&void 0!==e?e:[]),o=t,a=r.some((function(t){return o.includes(t)}));return a}return!1}},e407:function(t,e,n){"use strict";var r=n("f6315"),i=n.n(r);i.a},e620:function(t,e,n){"use strict";n.r(e);var r=n("9cbc"),i=n("e8d7");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("c86e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"2c57e935",null,!1,r["a"],a);e["default"]=c.exports},e63d:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("d81d"),n("14d9");var i=r(n("4fff"));e.default={name:"u-checkbox-group",mixins:[i.default],props:{max:{type:[Number,String],default:999},disabled:{type:Boolean,default:!1},name:{type:[Boolean,String],default:""},labelDisabled:{type:Boolean,default:!1},shape:{type:String,default:"square"},activeColor:{type:String,default:"#2979ff"},size:{type:[String,Number],default:34},width:{type:String,default:"auto"},wrap:{type:Boolean,default:!1},iconSize:{type:[String,Number],default:20}},data:function(){return{}},created:function(){this.children=[]},methods:{emitEvent:function(){var t=this,e=[];this.children.map((function(t){t.value&&e.push(t.name)})),this.$emit("change",e),setTimeout((function(){t.dispatch("u-form-item","on-form-change",e)}),60)}}}},e859:function(t,e,n){"use strict";n.r(e);var r=n("aec2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e8d7:function(t,e,n){"use strict";n.r(e);var r=n("e63d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e941:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("0aec"));e.default={mixins:[i.default]}},e96b:function(t,e,n){var r=n("0c42");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("7db8cb9e",r,!0,{sourceMap:!1,shadowMode:!1})},edb7:function(t,e,n){"use strict";var r=n("467c"),i=n.n(r);i.a},ee53:function(t,e,n){"use strict";n.r(e);var r=n("baac"),i=n("24ae");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("bd58");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"3ed11d5a",null,!1,r["a"],a);e["default"]=c.exports},f039:function(t,e,n){"use strict";n.r(e);var r=n("4e37"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f14d:function(t,e,n){"use strict";n.r(e);var r=n("a87e"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f2d8:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdown:n("20b3").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-dropdown",{ref:"dropdownRef",class:{dropdownClose:!t.isOpen},on:{open:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!0},close:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!1}}},t._l(t.getSchema,(function(e){return n("SearchItem",{key:e.field,attrs:{schema:e,formModel:t.formModel,setFormModel:t.setFormModel,formActionType:t.formActionType,isOpen:t.isOpen},on:{"close-dropdown":function(e){arguments[0]=e=t.$handleEvent(e),t.handleCloseDropdown.apply(void 0,arguments)}}})})),1),n("portal-target",{attrs:{name:"calendar-portal"}})],1)},o=[]},f3be:function(t,e,n){"use strict";var r=n("ffff"),i=n.n(r);i.a},f6315:function(t,e,n){var r=n("5fea");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("46f1aafd",r,!0,{sourceMap:!1,shadowMode:!1})},f68e:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-popup",{attrs:{closeable:!0,width:t.width,height:t.width,mode:"center"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("v-uni-view",{staticClass:"relative h-full flex flex-col overflow-hidden"},[n("v-uni-view",{staticClass:"h-86rpx leading-86rpx flex-center w-full"},[t._t("title",[n("v-uni-view",{staticClass:"text-34rpx"},[t._v(t._s(t.title))])])],2),n("v-uni-view",{staticClass:"flex-1 overflow-y-auto w-full"},[t._t("default")],2),n("v-uni-view",[t._t("bottom")],2)],1)],1)},o=[]},f839:function(t,e,n){"use strict";var r=n("71e9"),i=n.n(r);i.a},f918:function(t,e,n){"use strict";var r=n("62be"),i=n.n(r);i.a},f926:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdownItem:n("0dcd").default,uInput:n("d5da").default,uLine:n("ee53").default,uButton:n("d9ad").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-dropdown-item",{attrs:{title:t.label}},[n("v-uni-view",{staticClass:"bg-white p-30rpx"},[n("u-input",{staticClass:"flex-1",attrs:{placeholder:t.placeholder},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}}),n("v-uni-view",{staticClass:"my-20rpx"},[n("u-line")],1),n("u-button",{attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleChange.apply(void 0,arguments)}}},[t._v("确定")])],1)],1)},o=[]},f940:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={name:"u-swipe-action",props:{index:{type:[Number,String],default:""},btnWidth:{type:[String,Number],default:180},disabled:{type:Boolean,default:!1},show:{type:Boolean,default:!1},bgColor:{type:String,default:"#ffffff"},vibrateShort:{type:Boolean,default:!1},options:{type:Array,default:function(){return[]}}},watch:{show:{immediate:!0,handler:function(t,e){t?this.open():this.close()}}},data:function(){return{moveX:0,scrollX:0,status:!1,movableAreaWidth:0,elId:this.$u.guid(),showBtn:!1}},computed:{movableViewWidth:function(){return this.movableAreaWidth+this.allBtnWidth+"px"},innerBtnWidth:function(){return uni.upx2px(this.btnWidth)},allBtnWidth:function(){return uni.upx2px(this.btnWidth)*this.options.length},btnStyle:function(){var t=this;return function(e){return e.width=t.btnWidth+"rpx",e}}},mounted:function(){this.getActionRect()},methods:{btnClick:function(t){this.status=!1,this.$emit("click",this.index,t)},change:function(t){this.scrollX=t.detail.x},close:function(){this.moveX=0,this.status=!1},open:function(){this.disabled||(this.moveX=-this.allBtnWidth,this.status=!0)},touchend:function(){this.moveX=this.scrollX,this.$nextTick((function(){var t=this;0==this.status?this.scrollX<=-this.allBtnWidth/4?(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent(),this.vibrateShort&&uni.vibrateShort()):(this.moveX=0,this.status=!1,this.emitCloseEvent()):this.scrollX>3*-this.allBtnWidth/4?(this.moveX=0,this.$nextTick((function(){t.moveX=101})),this.status=!1,this.emitCloseEvent()):(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent())}))},emitOpenEvent:function(){this.$emit("open",this.index)},emitCloseEvent:function(){this.$emit("close",this.index)},touchstart:function(){},getActionRect:function(){var t=this;this.$uGetRect(".u-swipe-action").then((function(e){t.movableAreaWidth=e.width,t.$nextTick((function(){t.showBtn=!0}))}))},contentClick:function(){1==this.status&&(this.status="close",this.moveX=0),this.$emit("content-click",this.index)}}}},fcd2:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3")),o=r(n("f07e")),a=r(n("c964"));n("d81d"),n("4de4"),n("d3b7"),n("99af");var u=r(n("d2f3")),c=r(n("02cd")),s=n("365c"),l=r(n("0b61")),f=r(n("0453")),d=r(n("12df")),p=r(n("4c48")),h=r(n("e350")),v=[{title:"基地名称",dataIndex:"name"},{title:"农业类型",dataIndex:"industry_label"},{title:"是否外部链接",dataIndex:"is_blank",format:function(t){return t?"是":"否"}},{title:"排序",dataIndex:"sort"},{title:"基地负责人",dataIndex:"person"},{title:"基地农作物",dataIndex:"crops",format:function(t){var e;return null!==(e=null===t||void 0===t?void 0:t.map((function(t){return t.name})).join(","))&&void 0!==e?e:""}},{title:"基地经度",dataIndex:"address_lng"},{title:"基地纬度",dataIndex:"address_lat"},{title:"基地地址",dataIndex:"address"},{title:"基地面积",dataIndex:"areas"},{title:"种养殖面积",dataIndex:"cultivated"},{title:"基地就业人数",dataIndex:"workforce"},{title:"基地描述",dataIndex:"description"}];e.default={mixins:[l.default],components:{SearchForm:c.default,Appbar:u.default,cuPopup:f.default,BaseTablePopup:d.default,BasicsEdit:p.default},data:function(){return{baseTableColums:v,currentData:null,filterParmas:{},downOption:{use:!1},upOption:{auto:!1,page:{size:20}},dataList:[],formShow:!1,baseShow:!1,searchFormSchema:[{field:"name",label:"名称",component:"Input",componentProps:{placeholder:"请输入名称"}},{field:"type",label:"农业类型",component:"ApiSelect",componentProps:function(t){t.formActionType;return{api:function(){var t=(0,a.default)((0,o.default)().mark((function t(e){var n,r;return(0,o.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s.http.get("/api/keywords-industry",{params:e});case 2:return n=t.sent,r=n.data,t.abrupt("return",r.data);case 5:case"end":return t.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}(),labelField:"name",valueField:"id"}}}]}},computed:{options:function(){return[{text:"编辑",opt:"edit",permission:["endpoint.agricultural_basic.edit"],style:{backgroundColor:"#007aff"}},{text:"删除",opt:"delete",permission:["endpoint.agricultural_basic.destroy"],style:{backgroundColor:"#dd524d"}}].filter((function(t){return(0,h.default)(t.permission)}))}},methods:{handleSubmit:function(t){this.filterParmas=t,this.mescroll.resetUpScroll()},upCallback:function(t){var e=t.num,n=t.size;this.getData((0,i.default)((0,i.default)({},this.filterParmas),{},{page:e,per_page:n,type:1}))},getData:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){var r,i,a,u;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,s.http.get("/api/agricultural-basic",{params:t});case 3:r=n.sent,i=r.data,1==t.page&&(e.dataList=[]),a=i.data,u=i.meta,e.dataList=e.dataList.concat(a.map((function(t){return Object.assign({show:!1},t)}))),e.mescroll.endByPage(a.length,u.total),n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](0),e.mescroll.endErr();case 14:case"end":return n.stop()}}),n,null,[[0,11]])})))()},handleClick:function(t,e){var n=this.options[e].opt,r=this.dataList[t];this.currentData=r,"edit"==n?this.handleEdit(r):"delete"==n&&this.handleDel(r)},handleContentClick:function(t){this.currentData=this.dataList[t],this.baseShow=!0},handleEdit:function(t){this.currentData=t,this.formShow=!0,this.baseShow=!1},handleDel:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:uni.showModal({title:"提示",content:"是否确定删除?",success:function(){var n=(0,a.default)((0,o.default)().mark((function n(r){var i;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!r.confirm){n.next=12;break}return n.prev=1,n.next=4,e.$http.delete("/api/agricultural-basic/".concat(t.id));case 4:e.mescroll.resetUpScroll(),e.baseShow=!1,n.next=12;break;case 8:n.prev=8,n.t0=n["catch"](1),i=n.t0.data,e.$u.toast(i.message);case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));function r(t){return n.apply(this,arguments)}return r}()});case 1:case"end":return n.stop()}}),n)})))()},handleCreate:function(){var t=this;return(0,a.default)((0,o.default)().mark((function e(){return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.currentData=null,t.formShow=!0,t.baseShow=!1;case 3:case"end":return e.stop()}}),e)})))()},handleEditConfirm:function(){this.mescroll.resetUpScroll(),this.formShow=!1}}}},fe9d:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请输入"},isOpen:{type:Boolean}},computed:{},data:function(){return{status:""}},methods:{handleChange:function(){this.$emit("change",this.status),this.$emit("close-dropdown",this.status)}},watch:{isOpen:{handler:function(t){this.status=this.value},immediate:!0}}}},ffff:function(t,e,n){var r=n("75c4");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("2143248c",r,!0,{sourceMap:!1,shadowMode:!1})}}]); \ No newline at end of file + */},"58e0":function(t,e,n){"use strict";(function(t){var r=n("26ee"),i=n("2f74"),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=a&&a.exports===o,c=u?r["a"].Buffer:void 0,s=c?c.isBuffer:void 0,l=s||i["a"];e["a"]=l}).call(this,n("dd40")(t))},"5e8e":function(t,e,n){"use strict";var r=n("83cc"),i=n.n(r);i.a},"5ea3":function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e["a"]=n}).call(this,n("c8ba"))},"5f04":function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("13d5"),n("d3b7"),n("14d9"),n("4de4");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},label:{type:String,default:""},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"}},computed:{status:{get:function(){return this.value},set:function(t){this.$emit("change",t),this.$emit("input",t)}},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},data:function(){return{options:[],emitData:null,isFirstLoad:!0}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleChange:function(t){var e=this.getOptions.filter((function(e){return e.value==t}));this.emitData=e},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},"5fea":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-checkbox[data-v-7e6e0538]{display:inline-flex;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none;line-height:1.8}.u-checkbox__icon-wrap[data-v-7e6e0538]{color:#606266;flex:none;display:-webkit-flex;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;width:%?42?%;height:%?42?%;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;border:1px solid #c8c9cc;transition-duration:.2s}.u-checkbox__icon-wrap--circle[data-v-7e6e0538]{border-radius:100%}.u-checkbox__icon-wrap--square[data-v-7e6e0538]{border-radius:%?6?%}.u-checkbox__icon-wrap--checked[data-v-7e6e0538]{color:#fff;background-color:#2979ff;border-color:#2979ff}.u-checkbox__icon-wrap--disabled[data-v-7e6e0538]{background-color:#ebedf0;border-color:#c8c9cc}.u-checkbox__icon-wrap--disabled--checked[data-v-7e6e0538]{color:#c8c9cc!important}.u-checkbox__label[data-v-7e6e0538]{word-wrap:break-word;margin-left:%?10?%;margin-right:%?24?%;color:#606266;font-size:%?30?%}.u-checkbox__label--disabled[data-v-7e6e0538]{color:#c8c9cc}',""]),t.exports=e},"62be":function(t,e,n){var r=n("cc76");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("532536c8",r,!0,{sourceMap:!1,shadowMode:!1})},"62f2":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var r=uni.getSystemInfoSync(),i={};e.default={name:"u-navbar",props:{height:{type:[String,Number],default:""},backIconColor:{type:String,default:"#606266"},backIconName:{type:String,default:"nav-back"},backIconSize:{type:[String,Number],default:"44"},backText:{type:String,default:""},backTextStyle:{type:Object,default:function(){return{color:"#606266"}}},title:{type:String,default:""},titleWidth:{type:[String,Number],default:"250"},titleColor:{type:String,default:"#606266"},titleBold:{type:Boolean,default:!1},titleSize:{type:[String,Number],default:32},isBack:{type:[Boolean,String],default:!0},background:{type:Object,default:function(){return{background:"#ffffff"}}},isFixed:{type:Boolean,default:!0},immersive:{type:Boolean,default:!1},borderBottom:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:""},customBack:{type:Function,default:null}},data:function(){return{menuButtonInfo:i,statusBarHeight:r.statusBarHeight}},computed:{navbarInnerStyle:function(){var t={};return t.height=this.navbarHeight+"px",t},navbarStyle:function(){var t={};return t.zIndex=this.zIndex?this.zIndex:this.$u.zIndex.navbar,Object.assign(t,this.background),t},titleStyle:function(){var t={};return t.left=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.right=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.width=uni.upx2px(this.titleWidth)+"px",t},navbarHeight:function(){return this.height?this.height:44}},created:function(){},methods:{goBack:function(){"function"===typeof this.customBack?this.customBack.bind(this.$u.$parent.call(this))():uni.navigateBack()}}}},"66f6":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,".mescroll-body[data-v-6b5ff080]{position:relative; /* 下拉刷新区域相对自身定位 */height:auto; /* 不可固定高度,否则overflow:hidden导致无法滑动; 同时使设置的最小高生效,实现列表不满屏仍可下拉*/overflow:hidden; /* 当有元素写在mescroll-body标签前面时,可遮住下拉刷新区域 */box-sizing:border-box /* 避免设置padding出现双滚动条的问题 */}\r\n\r\n/* 使sticky生效: 父元素不能overflow:hidden或者overflow:auto属性 */.mescroll-body.mescorll-sticky[data-v-6b5ff080]{overflow:unset!important}\r\n\r\n/* 适配 iPhoneX */@supports (bottom:constant(safe-area-inset-bottom)) or (bottom:env(safe-area-inset-bottom)){.mescroll-safearea[data-v-6b5ff080]{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}}\r\n\r\n/* 下拉刷新区域 */.mescroll-downwarp[data-v-6b5ff080]{position:absolute;top:-100%;left:0;width:100%;height:100%;text-align:center}\r\n\r\n/* 下拉刷新--内容区,定位于区域底部 */.mescroll-downwarp .downwarp-content[data-v-6b5ff080]{position:absolute;left:0;bottom:0;width:100%;min-height:%?60?%;padding:%?20?% 0;text-align:center}\r\n\r\n/* 下拉刷新--提示文本 */.mescroll-downwarp .downwarp-tip[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle;margin-left:%?16?%\r\n\t/* color: gray; 已在style设置color,此处删去*/}\r\n\r\n/* 下拉刷新--旋转进度条 */.mescroll-downwarp .downwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-downwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}\r\n\r\n/* 上拉加载区域 */.mescroll-upwarp[data-v-6b5ff080]{box-sizing:border-box;min-height:%?110?%;padding:%?30?% 0;text-align:center;clear:both}\r\n\r\n/*提示文本 */.mescroll-upwarp .upwarp-tip[data-v-6b5ff080],\r\n.mescroll-upwarp .upwarp-nodata[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle\r\n\t/* color: gray; 已在style设置color,此处删去*/}.mescroll-upwarp .upwarp-tip[data-v-6b5ff080]{margin-left:%?16?%}\r\n\r\n/*旋转进度条 */.mescroll-upwarp .upwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-upwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}",""]),t.exports=e},"680e":function(t,e,n){"use strict";n.r(e);var r=n("8cc1"),i=n("0f4f");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("5e8e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"adf85ec2",null,!1,r["a"],a);e["default"]=c.exports},"6a1a":function(t,e,n){var r=n("c35c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("221bf9c5",r,!0,{sourceMap:!1,shadowMode:!1})},"6ccf":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-calendar[data-v-7de526b6]{color:#606266}.u-calendar__header[data-v-7de526b6]{width:100%;box-sizing:border-box;font-size:%?30?%;background-color:#fff;color:#303133}.u-calendar__header__text[data-v-7de526b6]{margin-top:%?30?%;padding:0 %?60?%;display:flex;flex-direction:row;justify-content:center;align-items:center}.u-calendar__action[data-v-7de526b6]{padding:%?40?% 0 %?40?% 0}.u-calendar__action__icon[data-v-7de526b6]{margin:0 %?16?%}.u-calendar__action__text[data-v-7de526b6]{padding:0 %?16?%;color:#303133;font-size:%?32?%;line-height:%?32?%;font-weight:700}.u-calendar__week-day[data-v-7de526b6]{display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden}.u-calendar__week-day__text[data-v-7de526b6]{flex:1;text-align:center}.u-calendar__content[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;padding:6px 0;box-sizing:border-box;background-color:#fff;position:relative}.u-calendar__content--end-date[data-v-7de526b6]{border-top-right-radius:%?8?%;border-bottom-right-radius:%?8?%}.u-calendar__content--start-date[data-v-7de526b6]{border-top-left-radius:%?8?%;border-bottom-left-radius:%?8?%}.u-calendar__content__item[data-v-7de526b6]{width:14.2857%;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden;position:relative;z-index:2}.u-calendar__content__item__inner[data-v-7de526b6]{height:%?84?%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;font-size:%?32?%;position:relative;border-radius:50%}.u-calendar__content__item__inner__desc[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:center center;transform-origin:center center;position:absolute;left:0;text-align:center;bottom:%?2?%}.u-calendar__content__item__tips[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;position:absolute;left:0;-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;text-align:center;bottom:%?8?%;z-index:2}.u-calendar__content__bg-month[data-v-7de526b6]{position:absolute;font-size:130px;line-height:130px;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#e4e7ed;z-index:1}.u-calendar__bottom[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;background-color:#fff;padding:0 %?40?% %?30?%;box-sizing:border-box;font-size:%?24?%;color:#909399}.u-calendar__bottom__choose[data-v-7de526b6]{height:%?50?%}.u-calendar__bottom__btn[data-v-7de526b6]{width:100%}',""]),t.exports=e},"6e0a":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={data:function(){return{wxsProp:{optDown:{},scrollTop:0,bodyHeight:0,isDownScrolling:!1,isUpScrolling:!1,isScrollBody:!0,isUpBoth:!0,t:0},callProp:{callType:"",t:0}}},methods:{wxsCall:function(t){"setWxsProp"===t.type?this.wxsProp={optDown:this.mescroll.optDown,scrollTop:this.mescroll.getScrollTop(),bodyHeight:this.mescroll.getBodyHeight(),isDownScrolling:this.mescroll.isDownScrolling,isUpScrolling:this.mescroll.isUpScrolling,isUpBoth:this.mescroll.optUp.isBoth,isScrollBody:this.mescroll.isScrollBody,t:Date.now()}:"setLoadType"===t.type?(this.downLoadType=t.downLoadType,this.$set(this.mescroll,"downLoadType",this.downLoadType),this.$set(this.mescroll,"isDownEndSuccess",null)):"triggerDownScroll"===t.type?this.mescroll.triggerDownScroll():"endDownScroll"===t.type?this.mescroll.endDownScroll():"triggerUpScroll"===t.type&&this.mescroll.triggerUpScroll(!0)}},mounted:function(){var t=this;this.mescroll.optDown.afterLoading=function(){t.callProp={callType:"showLoading",t:Date.now()}},this.mescroll.optDown.afterEndDownScroll=function(){t.callProp={callType:"endDownScroll",t:Date.now()};var e=300+(t.mescroll.optDown.beforeEndDelay||0);setTimeout((function(){4!==t.downLoadType&&0!==t.downLoadType||(t.callProp={callType:"clearTransform",t:Date.now()}),t.$set(t.mescroll,"downLoadType",t.downLoadType)}),e)},this.wxsCall({type:"setWxsProp"})}};e.default=r},"6eaa":function(t,e,n){"use strict";n.r(e);var r=n("1078"),i=n("9ac8");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},"6ef1":function(t,e,n){"use strict";n.r(e);var r=n("0416"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"6f5a":function(t,e,n){var r=n("66f6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("704c32ba",r,!0,{sourceMap:!1,shadowMode:!1})},"71e9":function(t,e,n){var r=n("3f29");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("577b2531",r,!0,{sourceMap:!1,shadowMode:!1})},"73cb":function(t,e,n){"use strict";n.r(e);var r=n("24c0"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"752f":function(t,e,n){"use strict";var r=function(t){(t.options.wxs||(t.options.wxs={}))["wxsBiz"]=function(t){var e={};function n(t){t&&(e.optDown=t.optDown,e.scrollTop=t.scrollTop,e.bodyHeight=t.bodyHeight,e.isDownScrolling=t.isDownScrolling,e.isUpScrolling=t.isUpScrolling,e.isUpBoth=t.isUpBoth,e.isScrollBody=t.isScrollBody,e.startTop=t.scrollTop)}function r(t,n,r){e.disabled()||t.callType&&("showLoading"===t.callType?e.showLoading(r):"endDownScroll"===t.callType?e.endDownScroll(r):"clearTransform"===t.callType&&e.clearTransform(r))}function i(t,n){e.downHight=0,e.startPoint=e.getPoint(t),e.startTop=e.getScrollTop(),e.startAngle=0,e.lastPoint=e.startPoint,e.maxTouchmoveY=e.getBodyHeight()-e.optDown.bottomOffset,e.inTouchend=!1,e.callMethod(n,{type:"setWxsProp"})}function o(t,n){var r=!0;if(e.disabled())return r;var i=e.getScrollTop(),o=e.getPoint(t),u=o.y-e.startPoint.y;if(u>0&&(e.isScrollBody&&i<=0||!e.isScrollBody&&(i<=0||i<=e.optDown.startTop&&i===e.startTop))&&!e.inTouchend&&!e.isDownScrolling&&!e.optDown.isLock&&(!e.isUpScrolling||e.isUpScrolling&&e.isUpBoth)){if(e.startAngle||(e.startAngle=e.getAngle(e.lastPoint,o)),e.startAngle0&&o.y>=e.maxTouchmoveY)return e.inTouchend=!0,a(t,n),r;r=!1;var c=o.y-e.lastPoint.y;e.downHight0?c*e.optDown.outOffsetRate:c),e.downHight=Math.round(e.downHight);var s=e.downHight/e.optDown.offset;e.onMoving(n,s,e.downHight)}return e.lastPoint=o,r}function a(t,n){if(e.isMoveDown)e.downHight>=e.optDown.offset?(e.downHight=e.optDown.offset,e.callMethod(n,{type:"triggerDownScroll"})):(e.downHight=0,e.callMethod(n,{type:"endDownScroll"})),e.movetype=0,e.isMoveDown=!1;else if(!e.isScrollBody&&e.getScrollTop()===e.startTop){var r=e.getPoint(t).y-e.startPoint.y<0;if(r){var i=e.getAngle(e.getPoint(t),e.startPoint);i>80&&e.callMethod(n,{type:"triggerUpScroll"})}}e.callMethod(n,{type:"setWxsProp"})}return e.onMoving=function(t,e,n){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"transform",transform:"translateY("+n+"px)",transition:""});var r=t.selectComponent(".mescroll-wxs-progress");r&&r.setStyle({transform:"rotate("+360*e+"deg)"})}))},e.showLoading=function(t){e.downHight=e.optDown.offset,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY("+e.downHight+"px)",transition:"transform 300ms"})}))},e.endDownScroll=function(t){e.downHight=0,e.isDownScrolling=!1,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY(0)",transition:"transform 300ms"})}))},e.clearTransform=function(t){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"",transform:"",transition:""})}))},e.disabled=function(){return!e.optDown||!e.optDown.use||e.optDown.native},e.getPoint=function(t){return t?t.touches&&t.touches[0]?{x:t.touches[0].pageX,y:t.touches[0].pageY}:t.changedTouches&&t.changedTouches[0]?{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY}:{x:t.clientX,y:t.clientY}:{x:0,y:0}},e.getAngle=function(t,e){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=Math.sqrt(n*n+r*r),o=0;return 0!==i&&(o=Math.asin(r/i)/Math.PI*180),o},e.getScrollTop=function(){return e.scrollTop||0},e.getBodyHeight=function(){return e.bodyHeight||0},e.callMethod=function(t,e){t&&t.callMethod("wxsCall",e)},t.exports={propObserver:n,callObserver:r,touchstartEvent:i,touchmoveEvent:o,touchendEvent:a},t.exports}({exports:{}})};e["a"]=r},"75c4":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-select__action[data-v-70094335]{position:relative;line-height:%?70?%;height:%?70?%}.u-select__action__icon[data-v-70094335]{position:absolute;right:%?20?%;top:50%;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:1}.u-select__action__icon--reverse[data-v-70094335]{-webkit-transform:rotate(-180deg) translateY(50%);transform:rotate(-180deg) translateY(50%)}.u-select__hader__title[data-v-70094335]{color:#606266}.u-select--border[data-v-70094335]{border-radius:%?6?%;border-radius:4px;border:1px solid #dcdfe6}.u-select__header[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:%?80?%;padding:0 %?40?%}.u-select__body[data-v-70094335]{width:100%;height:%?500?%;overflow:hidden;background-color:#fff}.u-select__body__picker-view[data-v-70094335]{height:100%;box-sizing:border-box}.u-select__body__picker-view__item[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:%?32?%;color:#303133;padding:0 %?8?%}',""]),t.exports=e},"76db":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-select"},[n("u-popup",{attrs:{maskCloseAble:t.maskCloseAble,mode:"bottom",popup:!1,length:"auto",safeAreaInsetBottom:t.safeAreaInsetBottom,"z-index":t.uZIndex},on:{close:function(e){arguments[0]=e=t.$handleEvent(e),t.close.apply(void 0,arguments)}},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[n("v-uni-view",{staticClass:"u-select"},[n("v-uni-view",{staticClass:"u-select__header",on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e)}}},[n("v-uni-view",{staticClass:"u-select__header__cancel u-select__header__btn",style:{color:t.cancelColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getResult("cancel")}}},[t._v(t._s(t.cancelText))]),n("v-uni-view",{staticClass:"u-select__header__title"},[t._v(t._s(t.title))]),n("v-uni-view",{staticClass:"u-select__header__confirm u-select__header__btn",style:{color:t.moving?t.cancelColor:t.confirmColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{touchmove:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.getResult("confirm")}}},[t._v(t._s(t.confirmText))])],1),n("v-uni-view",{staticClass:"u-select__body"},[t.value?n("v-uni-picker-view",{staticClass:"u-select__body__picker-view",attrs:{value:t.defaultSelector},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.columnChange.apply(void 0,arguments)},pickstart:function(e){arguments[0]=e=t.$handleEvent(e),t.pickstart.apply(void 0,arguments)},pickend:function(e){arguments[0]=e=t.$handleEvent(e),t.pickend.apply(void 0,arguments)}}},t._l(t.columnData,(function(e,r){return n("v-uni-picker-view-column",{key:r},t._l(e,(function(e,r){return n("v-uni-view",{key:r,staticClass:"u-select__body__picker-view__item"},[n("v-uni-view",{staticClass:"u-line-1"},[t._v(t._s(e[t.labelName]))])],1)})),1)})),1):t._e()],1)],1)],1)],1)},o=[]},7860:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("99af"),n("ac1f"),n("5319"),n("fb6a"),n("a630"),n("3ca3"),n("d3b7"),n("ddb0");e.default={name:"u-calendar",props:{safeAreaInsetBottom:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},value:{type:Boolean,default:!1},zIndex:{type:[String,Number],default:0},changeYear:{type:Boolean,default:!0},changeMonth:{type:Boolean,default:!0},mode:{type:String,default:"date"},maxYear:{type:[Number,String],default:2050},minYear:{type:[Number,String],default:1950},minDate:{type:[Number,String],default:"1950-01-01"},maxDate:{type:[Number,String],default:""},borderRadius:{type:[String,Number],default:20},monthArrowColor:{type:String,default:"#606266"},yearArrowColor:{type:String,default:"#909399"},color:{type:String,default:"#303133"},activeBgColor:{type:String,default:"#2979ff"},activeColor:{type:String,default:"#ffffff"},rangeBgColor:{type:String,default:"rgba(41,121,255,0.13)"},rangeColor:{type:String,default:"#2979ff"},startText:{type:String,default:"开始"},endText:{type:String,default:"结束"},btnType:{type:String,default:"primary"},isActiveCurrent:{type:Boolean,default:!0},isChange:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},toolTip:{type:String,default:"选择日期"}},data:function(){return{weekday:1,weekdayArr:[],days:0,daysArr:[],showTitle:"",year:2020,month:0,day:0,startYear:0,startMonth:0,startDay:0,endYear:0,endMonth:0,endDay:0,today:"",activeDate:"",startDate:"",endDate:"",isStart:!0,min:null,max:null,weekDayZh:["日","一","二","三","四","五","六"]}},computed:{dataChange:function(){return"".concat(this.mode,"-").concat(this.minDate,"-").concat(this.maxDate)},uZIndex:function(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},watch:{dataChange:function(t){this.init()}},created:function(){this.init()},methods:{getColor:function(t,e){var n=1==e?"":this.color,r=t+1,i="".concat(this.year,"-").concat(this.month,"-").concat(r),o=new Date(i.replace(/\-/g,"/")).getTime(),a=this.startDate.replace(/\-/g,"/"),u=this.endDate.replace(/\-/g,"/");return this.isActiveCurrent&&this.activeDate==i||this.startDate==i||this.endDate==i?n=1==e?this.activeBgColor:this.activeColor:this.endDate&&o>new Date(a).getTime()&&on&&(t=n),this.year=t.getFullYear(),this.month=t.getMonth()+1,this.day=t.getDate(),this.today="".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()),this.activeDate=this.today,this.min=this.initDate(this.minDate),this.max=this.initDate(this.maxDate||this.today),this.startDate="",this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.endDate="",this.isStart=!0,this.changeData()},initDate:function(t){var e=t.split("-");return{year:Number(e[0]||1920),month:Number(e[1]||1),day:Number(e[2]||1)}},openDisAbled:function(t,e,n){var r=!0,i="".concat(t,"/").concat(e,"/").concat(n),o="".concat(this.min.year,"/").concat(this.min.month,"/").concat(this.min.day),a="".concat(this.max.year,"/").concat(this.max.month,"/").concat(this.max.day),u=new Date(i).getTime();return u>=new Date(o).getTime()&&u<=new Date(a).getTime()&&(r=!1),r},generateArray:function(t,e){return Array.from(new Array(e+1).keys()).slice(t)},formatNum:function(t){return t<10?"0"+t:t+""},getMonthDay:function(t,e){var n=new Date(t,e,0).getDate();return n},getWeekday:function(t,e){var n=new Date("".concat(t,"/").concat(e,"/01 00:00:00"));return n.getDay()},checkRange:function(t){var e=!1;return(tthis.maxYear)&&(uni.showToast({title:"日期超出范围啦~",icon:"none"}),e=!0),e},changeMonthHandler:function(t){if(t){var e=this.month+1,n=e>12?this.year+1:this.year;this.checkRange(n)||(this.month=e>12?1:e,this.year=n,this.changeData())}else{var r=this.month-1,i=r<1?this.year-1:this.year;this.checkRange(i)||(this.month=r<1?12:r,this.year=i,this.changeData())}},changeYearHandler:function(t){var e=t?this.year+1:this.year-1;this.checkRange(e)||(this.year=e,this.changeData())},changeData:function(){this.days=this.getMonthDay(this.year,this.month),this.daysArr=this.generateArray(1,this.days),this.weekday=this.getWeekday(this.year,this.month),this.weekdayArr=this.generateArray(1,this.weekday),this.showTitle="".concat(this.year,"年").concat(this.month,"月"),this.isChange&&"date"==this.mode&&this.btnFix(!0)},dateClick:function(t){if(t+=1,!this.openDisAbled(this.year,this.month,t)){this.day=t;var e="".concat(this.year,"-").concat(this.month,"-").concat(t);if("date"==this.mode)this.activeDate=e;else{var n=new Date(e.replace(/\-/g,"/")).getTime()0?n("v-uni-view",{staticClass:"mescroll-bottombar",style:{height:t.windowBottom+"px"}}):t._e(),t.safearea?n("v-uni-view",{staticClass:"mescroll-safearea"}):t._e(),n("mescroll-top",{attrs:{option:t.mescroll.optUp.toTop},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}},model:{value:t.isShowToTop,callback:function(e){t.isShowToTop=e},expression:"isShowToTop"}}),n("v-uni-view",{wxsProps:{"change:prop":"wxsProp"},attrs:{"change:prop":t.renderBiz.propObserver,prop:t.wxsProp}})],1)},o=[]},"980a":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-swipe-action[data-v-1adff301]{width:auto;height:auto;position:relative;overflow:hidden}.u-swipe-view[data-v-1adff301]{display:flex;flex-direction:row;height:auto;position:relative\n /* 这一句很关键,覆盖默认的绝对定位 */}.u-swipe-content[data-v-1adff301]{flex:1}.u-swipe-del[data-v-1adff301]{position:relative;font-size:%?30?%;color:#fff}.u-btn-text[data-v-1adff301]{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}',""]),t.exports=e},9971:function(module,exports,__webpack_require__){"use strict";__webpack_require__("7a82");var _interopRequireDefault=__webpack_require__("ee27").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _slicedToArray2=_interopRequireDefault(__webpack_require__("d0af")),_typeof2=_interopRequireDefault(__webpack_require__("0122")),_createForOfIteratorHelper2=_interopRequireDefault(__webpack_require__("54f8"));__webpack_require__("4de4"),__webpack_require__("d3b7"),__webpack_require__("d81d"),__webpack_require__("c975"),__webpack_require__("159b"),__webpack_require__("b64b"),__webpack_require__("7db0"),__webpack_require__("c760"),__webpack_require__("f8c9"),__webpack_require__("caad"),__webpack_require__("2532"),__webpack_require__("14d9"),__webpack_require__("4fadc"),__webpack_require__("ac1f"),__webpack_require__("00b4"),__webpack_require__("466d"),__webpack_require__("498a");var _SearchItem=_interopRequireDefault(__webpack_require__("c881")),_lodashEs=__webpack_require__("4fcf6"),_default2=exports.default={props:{schemas:{type:Array,default:function(){return[]}}},components:{SearchItem:_SearchItem.default},computed:{formActionType:function formActionType(){var _this=this;return{setFieldsValue:function setFieldsValue(values){var fields=_this.getSchema.map((function(t){return t.field})).filter(Boolean),delimiter=".",nestKeyArray=fields.filter((function(t){return t.indexOf(delimiter)>=0})),validKeys=[];Object.keys(values).forEach((function(key){var schema=_this.getSchema.find((function(t){return t.field===key})),value=values[key],hasKey=Reflect.has(values,key);hasKey&&fields.includes(key)?(_this.formModel[key]=value,validKeys.push(key)):nestKeyArray.forEach((function(nestKey){try{var _value=eval("values"+delimiter+nestKey);_this.isDef(_value)&&(_this.formModel[nestKey]=_value,validKeys.push(nestKey))}catch(e){_this.isDef(defaultValueRef.value[nestKey])&&(_this.formModel[nestKey]=(0,_lodashEs.cloneDeep)(defaultValueRef.value[nestKey]))}}))}))}}},getSchema:function(){var t,e=this.schemas,n=(0,_createForOfIteratorHelper2.default)(e);try{for(n.s();!(t=n.n()).done;)t.value}catch(r){n.e(r)}finally{n.f()}return(0,_lodashEs.cloneDeep)(e)}},data:function(){return{isOpen:!1,formModel:{}}},created:function(){this.initFormModel()},methods:{handleOpen:function(){console.log("====")},handleCloseDropdown:function(){var t;null===(t=this.$refs.dropdownRef)||void 0===t||t.close()},initFormModel:function(){var t=this.schemas,e={};t.forEach((function(t){var n=t.field,r=t.defaultValue;n&&(e[n]=r)})),this.formModel=e},handleInputNumberValue:function(t,e){return t&&["Input","InputPassword","InputSearch","InputTextArea"].includes(t)&&e&&this.isNumber(e)?"".concat(e):e},isDef:function(t){return"undefined"!==typeof t},isNumber:function(t){return"number"===typeof t&&!isNaN(t)},isArray:function(t){return Array.isArray(t)},isObject:function(t){return"object"===(0,_typeof2.default)(t)&&null!==t},isFunction:function(t){return"function"===typeof t},setFormModel:function(t,e){this.formModel[t]=e,this.$emit("field-value-change",t,e)},handleFormValues:function(t){if(!this.isObject(t))return{};for(var e={},n=function(){var t=i[r],n=(0,_slicedToArray2.default)(t,2),o=n[1],a=(0,_slicedToArray2.default)(t,1),u=a[0],c=/^\[(.+)\]$/;if(c.test(u)){var s=u.match(c)[1].split(",");s.forEach((function(t,n){var r,i=null!==(r=null===o||void 0===o?void 0:o[n])&&void 0!==r?r:"";i&&(e[t.trim()]=i)}))}else o&&(e[u]=o)},r=0,i=Object.entries(t);r=this.parent.max)return this.$u.toast("最多可选".concat(this.parent.max,"项"));this.emitEvent(),this.$emit("input",!this.value)}}}}},a96b:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{value:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"100%"},height:{type:String,default:"100%"}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}},data:function(){return{}}}},adb4:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{option:{type:Object,default:function(){return{}}},value:!1,modelValue:!1},computed:{left:function(){return this.option.left?this.addUnit(this.option.left):"auto"},right:function(){return this.option.left?"auto":this.addUnit(this.option.right)},isShow:function(){return this.value}},methods:{addUnit:function(t){return t?"number"===typeof t?t+"rpx":t:0},toTopClick:function(){this.$emit("input",!1),this.$emit("click")}}}},add5:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请选择日期"},params:{type:Object,default:function(){return{}}},mode:{type:String,default:"date"}},computed:{isRange:function(){return"range"===this.mode},placeholderStr:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.placeholder)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.placeholder)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.placeholder},status:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.date)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.date)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.date}},data:function(){return{show:!1,date:null}},methods:{openCalendar:function(){this.show=!0},handleChange:function(t){var e;if(this.isRange){var n=t.startDate,r=t.endDate;e=[n,r]}else e=t.result;this.$emit("change",e),this.$emit("input",e),this.date=e,this.$emit("close-dropdown",e)}},watch:{value:{handler:function(t){this.date=t},immediate:!0,deep:!0}}}},aec2:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("7db0"),n("d3b7"),n("c740"),n("13d5"),n("14d9");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},placeholder:{type:String,default:"请选择"}},data:function(){return{show:!1,isFirstLoad:!0,options:[]}},computed:{currentOption:function(){var t=this,e=this.getOptions.find((function(e){return e.value==t.value}));return null!==e&&void 0!==e?e:{}},showText:function(){var t,e;return null!==(t=null===(e=this.currentOption)||void 0===e?void 0:e.label)&&void 0!==t?t:this.value},defaultValue:function(){var t=this,e=this.getOptions.findIndex((function(e){return e.value==t.value}));return[e>-1?e:0]},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleConfirm:function(t){if(t.length){var e=t[0].value;null!=e&&(this.$emit("change",e),this.$emit("input",e))}},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},aecc:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("component",t._g(t._b({},"component",t.getBindValue.bind,!1),t.getBindValue.on))},o=[]},b14d:function(t,e,n){var r=n("86cb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("6d1ac5d2",r,!0,{sourceMap:!1,shadowMode:!1})},b2d8:function(t,e,n){"use strict";n.r(e);var r=n("fcd2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},b471:function(t,e,n){"use strict";n.r(e);var r=n("fe9d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},b53f:function(t,e,n){"use strict";n.r(e);var r=n("f940"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},baac:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-line",style:[t.lineStyle]})},o=[]},bade:function(t,e,n){"use strict";n.r(e);var r=n("7860"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},bd0a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3"));n("d3b7"),n("159b"),n("14d9");var o=r(n("e350"));e.default={props:{value:{type:Boolean,default:!1},data:{type:Object,default:function(){}},colums:{type:Array,default:function(){return[]}},editAuth:{type:Array,default:function(){return[]}},delAuth:{type:Array,default:function(){return[]}}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}},isEdit:function(){return!!this.$listeners.onEdit&&(0,o.default)(this.editAuth)},isDel:function(){return!!this.$listeners.onDel&&(0,o.default)(this.delAuth)},columsList:function(){var t=this,e=[];return this.colums.forEach((function(n){var r=n.dataIndex,o=n.format,a=t.data[r];t.isFunction(o)&&(a=o(a)),e.push((0,i.default)((0,i.default)({},n),{},{value:a}))})),e}},methods:{isFunction:function(t){return"function"===typeof t},handleEdit:function(){this.$emit("onEdit",this.data)},handleDel:function(){this.$emit("onDel",this.data)}}}},bd58:function(t,e,n){"use strict";var r=n("b14d"),i=n.n(r);i.a},be8c:function(t,e,n){"use strict";n.r(e);var r=n("849d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},becc:function(t,e,n){"use strict";var r=n("6a1a"),i=n.n(r);i.a},c17b:function(t,e,n){"use strict";n.r(e);var r=n("2a6c"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},c35c:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-loading-circle[data-v-19cf7fca]{display:inline-flex;vertical-align:middle;width:%?28?%;height:%?28?%;background:0 0;border-radius:50%;border:2px solid;border-color:#e5e5e5 #e5e5e5 #e5e5e5 #8f8d8e;-webkit-animation:u-circle-data-v-19cf7fca 1s linear infinite;animation:u-circle-data-v-19cf7fca 1s linear infinite}.u-loading-flower[data-v-19cf7fca]{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}@-webkit-keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes u-circle-data-v-19cf7fca{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}',""]),t.exports=e},c699:function(t,e,n){"use strict";n.r(e);var r=n("cf71"),i=n("b2d8");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},c6c9:function(t,e,n){"use strict";n.r(e);var r=n("1794"),i=n("bade");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("cb36");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"7de526b6",null,!1,r["a"],a);e["default"]=c.exports},c6eb:function(t,e,n){"use strict";(function(t){var r=n("5ea3"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a&&r["a"].process,c=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(e){}}();e["a"]=c}).call(this,n("dd40")(t))},c760:function(t,e,n){"use strict";var r=n("23e7");r({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},c86e:function(t,e,n){"use strict";var r=n("353f"),i=n.n(r);i.a},c881:function(t,e,n){"use strict";n.r(e);var r=n("aecc"),i=n("338d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},c892:function(t,e,n){"use strict";n.r(e);var r=n("82d3"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},cb29:function(t,e,n){"use strict";var r=n("23e7"),i=n("81d5"),o=n("44d2");r({target:"Array",proto:!0},{fill:i}),o("fill")},cb36:function(t,e,n){"use strict";var r=n("7b18"),i=n.n(r);i.a},cc76:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-navbar[data-v-2920cc37]{width:100%}.u-navbar-fixed[data-v-2920cc37]{position:fixed;left:0;right:0;top:0;z-index:991}.u-status-bar[data-v-2920cc37]{width:100%}.u-navbar-inner[data-v-2920cc37]{display:flex;flex-direction:row;justify-content:space-between;position:relative;align-items:center}.u-back-wrap[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;flex:1;flex-grow:0;padding:%?14?% %?14?% %?14?% %?24?%}.u-back-text[data-v-2920cc37]{padding-left:%?4?%;font-size:%?30?%}.u-navbar-content-title[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;justify-content:center;flex:1;position:absolute;left:0;right:0;height:%?60?%;text-align:center;flex-shrink:0}.u-navbar-centent-slot[data-v-2920cc37]{flex:1}.u-title[data-v-2920cc37]{line-height:%?60?%;font-size:%?32?%;flex:1}.u-navbar-right[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.u-slot-content[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center}',""]),t.exports=e},cf71:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uSticky:n("680e").default,mescrollBody:n("4d90").default,uSwipeAction:n("844c").default,uLine:n("ee53").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("Appbar",{attrs:{show:t.showAppbar,title:"基地数据"},scopedSlots:t._u([{key:"right",fn:function(){return[n("v-uni-view",{directives:[{name:"auth",rawName:"v-auth",value:["endpoint.agricultural_basic.create"],expression:"['endpoint.agricultural_basic.create']"}],staticClass:"text-white mr-20px",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleCreate.apply(void 0,arguments)}}},[t._v("新增")])]},proxy:!0}])}),n("u-sticky",[n("v-uni-view",{staticClass:"bg-white"},[n("SearchForm",{attrs:{schemas:t.searchFormSchema},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.handleSubmit.apply(void 0,arguments)}}})],1)],1),n("mescroll-body",{attrs:{up:t.upOption,down:t.downOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",t._l(t.dataList,(function(e,r){return n("u-swipe-action",{key:e.id,staticClass:"my-20rpx mx-30rpx rounded-md overflow-hidden",attrs:{show:e.show,index:r,options:t.options},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleClick.apply(void 0,arguments)},"content-click":function(e){arguments[0]=e=t.$handleEvent(e),t.handleContentClick.apply(void 0,arguments)}}},[n("v-uni-view",[n("v-uni-view",{staticClass:"bg-white p-20rpx"},[n("v-uni-view",[t._v("基地名称:"+t._s(e.name))]),n("v-uni-view",[t._v("农业类型:"+t._s(e.industry_label))]),n("v-uni-view",{staticClass:"my-12rpx"},[n("u-line")],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v("基地面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("种养殖面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("就业人数")])],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.areas))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.cultivated))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.workforce))])],1)],1)],1)],1)})),1)],1),n("BaseTablePopup",{attrs:{colums:t.baseTableColums,data:t.currentData,editAuth:["endpoint.agricultural_basic.edit"],delAuth:["endpoint.agricultural_basic.destroy"]},on:{onEdit:function(e){arguments[0]=e=t.$handleEvent(e),t.handleEdit.apply(void 0,arguments)},onDel:function(e){arguments[0]=e=t.$handleEvent(e),t.handleDel.apply(void 0,arguments)}},model:{value:t.baseShow,callback:function(e){t.baseShow=e},expression:"baseShow"}}),n("cuPopup",{attrs:{title:t.currentData?"编辑基地":"新增基地"},model:{value:t.formShow,callback:function(e){t.formShow=e},expression:"formShow"}},[n("BasicsEdit",{attrs:{data:t.currentData},on:{cancel:function(e){arguments[0]=e=t.$handleEvent(e),t.formShow=!1},confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.handleEditConfirm.apply(void 0,arguments)}}})],1)],1)},o=[]},d2f3:function(t,e,n){"use strict";n.r(e);var r=n("1744"),i=n("f14d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},d3c3:function(t,e,n){"use strict";n.r(e);var r=n("0084"),i=n("24fe");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("05d7");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"30d8d7e6",null,!1,r["a"],a);e["default"]=c.exports},d50a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("2ca0"),n("ac1f"),n("5319");var i=r(n("fc11")),o=r(n("f3f3")),a=r(n("9c49")),u=r(n("6eaa")),c=r(n("d3c3")),s=r(n("2fed")),l=n("4fcf6");e.default={props:{schema:{type:Object,default:function(){}},setFormModel:{type:Function,default:function(){}},formModel:{type:Object,default:function(){}},formActionType:{type:Object,default:function(){}},isOpen:{type:Boolean}},components:{ApiSelect:a.default,Select:u.default,Calendar:c.default,Input:s.default},created:function(){},computed:{getValues:function(){this.allDefaultValues;var t=this.formModel,e=this.schema;return{field:e.field,model:t,values:(0,o.default)({},t),schema:e}},getComponentsProps:function(){var t,e=this.schema,n=this.formModel,r=this.formActionType,i=e.componentProps,o=void 0===i?{}:i;this.isFunction(o)&&(o=null!==(t=o({schema:e,formModel:n,formActionType:r}))&&void 0!==t?t:{});return o},getBindValue:function(){var t,e=this,n=this.schema,r=n.component,a=n.field,u=n.changeEvent,c=void 0===u?"change":u,s=n.valueField,f=n.label,d="on".concat((0,l.upperFirst)(c)),p=(t={},(0,i.default)(t,d,(function(t){e.setFormModel(a,t)})),(0,i.default)(t,"onCloseDropdown",(function(){e.$emit("close-dropdown")})),t),h=(0,o.default)((0,o.default)({},this.getComponentsProps),{},{label:f});h.codeField=a,h.formValues=this.getValues;var v=(0,i.default)({},s||"value",this.formModel[a]),m=(0,o.default)((0,o.default)((0,o.default)((0,o.default)({is:r},h),v),p),{},{isOpen:this.isOpen}),g={},b={};for(var y in m)if(y.startsWith("on")&&"function"===typeof m[y]){var w=(0,l.kebabCase)(y.replace("on",""));g[w]=m[y]}else b[y]=m[y];return{bind:b,on:g}}},methods:{isFunction:function(t){return"function"===typeof t&&null!==t},fetch:function(){var t=this.formModel,e=this.schema,n=e.componentProps,r=void 0===n?{}:n,i=e.components;if(this.isFunction(r)&&(r=r({schema:e,formModel:t})),"ApiSelect"===i){var o=r,a=o.api;if(!a||!this.isFunction(a))return}else conponents;console.log(this.schema)}}}},d518:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uIcon:n("f86b").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{},[n("v-uni-view",{staticClass:"u-navbar",class:{"u-navbar-fixed":t.isFixed,"u-border-bottom":t.borderBottom},style:[t.navbarStyle]},[n("v-uni-view",{staticClass:"u-status-bar",style:{height:t.statusBarHeight+"px"}}),n("v-uni-view",{staticClass:"u-navbar-inner",style:[t.navbarInnerStyle]},[t.isBack?n("v-uni-view",{staticClass:"u-back-wrap",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goBack.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"u-icon-wrap"},[n("u-icon",{attrs:{name:t.backIconName,color:t.backIconColor,size:t.backIconSize}})],1),t.backText?n("v-uni-view",{staticClass:"u-icon-wrap u-back-text u-line-1",style:[t.backTextStyle]},[t._v(t._s(t.backText))]):t._e()],1):t._e(),t.title?n("v-uni-view",{staticClass:"u-navbar-content-title",style:[t.titleStyle]},[n("v-uni-view",{staticClass:"u-title u-line-1",style:{color:t.titleColor,fontSize:t.titleSize+"rpx",fontWeight:t.titleBold?"bold":"normal"}},[t._v(t._s(t.title))])],1):t._e(),n("v-uni-view",{staticClass:"u-slot-content"},[t._t("default")],2),n("v-uni-view",{staticClass:"u-slot-right"},[t._t("right")],2)],1)],1),t.isFixed&&!t.immersive?n("v-uni-view",{staticClass:"u-navbar-placeholder",style:{width:"100%",height:Number(t.navbarHeight)+t.statusBarHeight+"px"}}):t._e()],1)},o=[]},d54d:function(t,e,n){"use strict";n.r(e);var r=n("62f2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},da66:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={def:"zh",getType:function(){return uni.getStorageSync("mescroll-i18n")||this.def},setType:function(t){uni.setStorageSync("mescroll-i18n",t)}};e.default=r},db00:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.inp[data-v-30d8d7e6]{border-radius:%?4?%;border-width:1px;-webkit-box-flex:1;-ms-flex:1 1 0%;-webkit-flex:1 1 0%;flex:1 1 0%;height:%?60?%;line-height:%?60?%;padding-left:10px;padding-right:10px}',""]),t.exports=e},dd40:function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},df51:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.option.src?n("v-uni-image",{staticClass:"mescroll-totop",class:[t.isShow?"mescroll-totop-in":"mescroll-totop-out",{"mescroll-totop-safearea":t.option.safearea}],style:{"z-index":t.option.zIndex,left:t.left,right:t.right,bottom:t.addUnit(t.option.bottom),width:t.addUnit(t.option.width),"border-radius":t.addUnit(t.option.radius)},attrs:{src:t.option.src,mode:"widthFix"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}}}):t._e()},o=[]},dff1:function(t,e,n){"use strict";(function(t){var r=n("26ee"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a?r["a"].Buffer:void 0,c=u?u.allocUnsafe:void 0;function s(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}e["a"]=s}).call(this,n("dd40")(t))},e10c:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uCheckboxGroup:n("e620").default,uCheckbox:n("1e79").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-checkbox-group",{on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxGroupChange.apply(void 0,arguments)}}},t._l(t.getOptions,(function(e,r){return n("u-checkbox",{key:e.value,attrs:{name:e.value},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxChange.apply(void 0,arguments)}},model:{value:e.checked,callback:function(n){t.$set(e,"checked",n)},expression:"item.checked"}},[t._v(t._s(e.label))])})),1)],1)},o=[]},e249:function(t,e,n){var r=n("980a");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("34ca650a",r,!0,{sourceMap:!1,shadowMode:!1})},e350:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,n("d3b7"),n("caad"),n("2532");var i=r(n("4360"));function o(t){if(t&&t instanceof Array&&t.length>0){var e,n,r=i.default.getters&&(null!==(e=null===(n=i.default.getters.userInfo)||void 0===n?void 0:n.permissions_slug)&&void 0!==e?e:[]),o=t,a=r.some((function(t){return o.includes(t)}));return a}return!1}},e407:function(t,e,n){"use strict";var r=n("f6315"),i=n.n(r);i.a},e620:function(t,e,n){"use strict";n.r(e);var r=n("9cbc"),i=n("e8d7");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("c86e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"2c57e935",null,!1,r["a"],a);e["default"]=c.exports},e63d:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("d81d"),n("14d9");var i=r(n("4fff"));e.default={name:"u-checkbox-group",mixins:[i.default],props:{max:{type:[Number,String],default:999},disabled:{type:Boolean,default:!1},name:{type:[Boolean,String],default:""},labelDisabled:{type:Boolean,default:!1},shape:{type:String,default:"square"},activeColor:{type:String,default:"#2979ff"},size:{type:[String,Number],default:34},width:{type:String,default:"auto"},wrap:{type:Boolean,default:!1},iconSize:{type:[String,Number],default:20}},data:function(){return{}},created:function(){this.children=[]},methods:{emitEvent:function(){var t=this,e=[];this.children.map((function(t){t.value&&e.push(t.name)})),this.$emit("change",e),setTimeout((function(){t.dispatch("u-form-item","on-form-change",e)}),60)}}}},e859:function(t,e,n){"use strict";n.r(e);var r=n("aec2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e8d7:function(t,e,n){"use strict";n.r(e);var r=n("e63d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e941:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("0aec"));e.default={mixins:[i.default]}},e96b:function(t,e,n){var r=n("0c42");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("7db8cb9e",r,!0,{sourceMap:!1,shadowMode:!1})},edb7:function(t,e,n){"use strict";var r=n("467c"),i=n.n(r);i.a},ee53:function(t,e,n){"use strict";n.r(e);var r=n("baac"),i=n("24ae");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("bd58");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"3ed11d5a",null,!1,r["a"],a);e["default"]=c.exports},f039:function(t,e,n){"use strict";n.r(e);var r=n("4e37"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f14d:function(t,e,n){"use strict";n.r(e);var r=n("a87e"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f2d8:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdown:n("20b3").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-dropdown",{ref:"dropdownRef",class:{dropdownClose:!t.isOpen},on:{open:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!0},close:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!1}}},t._l(t.getSchema,(function(e){return n("SearchItem",{key:e.field,attrs:{schema:e,formModel:t.formModel,setFormModel:t.setFormModel,formActionType:t.formActionType,isOpen:t.isOpen},on:{"close-dropdown":function(e){arguments[0]=e=t.$handleEvent(e),t.handleCloseDropdown.apply(void 0,arguments)}}})})),1),n("portal-target",{attrs:{name:"calendar-portal"}})],1)},o=[]},f3be:function(t,e,n){"use strict";var r=n("ffff"),i=n.n(r);i.a},f6315:function(t,e,n){var r=n("5fea");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("46f1aafd",r,!0,{sourceMap:!1,shadowMode:!1})},f68e:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-popup",{attrs:{closeable:!0,width:t.width,height:t.width,mode:"center"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("v-uni-view",{staticClass:"relative h-full flex flex-col overflow-hidden"},[n("v-uni-view",{staticClass:"h-86rpx leading-86rpx flex-center w-full"},[t._t("title",[n("v-uni-view",{staticClass:"text-34rpx"},[t._v(t._s(t.title))])])],2),n("v-uni-view",{staticClass:"flex-1 overflow-y-auto w-full"},[t._t("default")],2),n("v-uni-view",[t._t("bottom")],2)],1)],1)},o=[]},f839:function(t,e,n){"use strict";var r=n("71e9"),i=n.n(r);i.a},f918:function(t,e,n){"use strict";var r=n("62be"),i=n.n(r);i.a},f926:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdownItem:n("0dcd").default,uInput:n("d5da").default,uLine:n("ee53").default,uButton:n("d9ad").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-dropdown-item",{attrs:{title:t.label}},[n("v-uni-view",{staticClass:"bg-white p-30rpx"},[n("u-input",{staticClass:"flex-1",attrs:{placeholder:t.placeholder},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}}),n("v-uni-view",{staticClass:"my-20rpx"},[n("u-line")],1),n("u-button",{attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleChange.apply(void 0,arguments)}}},[t._v("确定")])],1)],1)},o=[]},f940:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={name:"u-swipe-action",props:{index:{type:[Number,String],default:""},btnWidth:{type:[String,Number],default:180},disabled:{type:Boolean,default:!1},show:{type:Boolean,default:!1},bgColor:{type:String,default:"#ffffff"},vibrateShort:{type:Boolean,default:!1},options:{type:Array,default:function(){return[]}}},watch:{show:{immediate:!0,handler:function(t,e){t?this.open():this.close()}}},data:function(){return{moveX:0,scrollX:0,status:!1,movableAreaWidth:0,elId:this.$u.guid(),showBtn:!1}},computed:{movableViewWidth:function(){return this.movableAreaWidth+this.allBtnWidth+"px"},innerBtnWidth:function(){return uni.upx2px(this.btnWidth)},allBtnWidth:function(){return uni.upx2px(this.btnWidth)*this.options.length},btnStyle:function(){var t=this;return function(e){return e.width=t.btnWidth+"rpx",e}}},mounted:function(){this.getActionRect()},methods:{btnClick:function(t){this.status=!1,this.$emit("click",this.index,t)},change:function(t){this.scrollX=t.detail.x},close:function(){this.moveX=0,this.status=!1},open:function(){this.disabled||(this.moveX=-this.allBtnWidth,this.status=!0)},touchend:function(){this.moveX=this.scrollX,this.$nextTick((function(){var t=this;0==this.status?this.scrollX<=-this.allBtnWidth/4?(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent(),this.vibrateShort&&uni.vibrateShort()):(this.moveX=0,this.status=!1,this.emitCloseEvent()):this.scrollX>3*-this.allBtnWidth/4?(this.moveX=0,this.$nextTick((function(){t.moveX=101})),this.status=!1,this.emitCloseEvent()):(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent())}))},emitOpenEvent:function(){this.$emit("open",this.index)},emitCloseEvent:function(){this.$emit("close",this.index)},touchstart:function(){},getActionRect:function(){var t=this;this.$uGetRect(".u-swipe-action").then((function(e){t.movableAreaWidth=e.width,t.$nextTick((function(){t.showBtn=!0}))}))},contentClick:function(){1==this.status&&(this.status="close",this.moveX=0),this.$emit("content-click",this.index)}}}},fcd2:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3")),o=r(n("f07e")),a=r(n("c964"));n("d81d"),n("4de4"),n("d3b7"),n("99af");var u=r(n("d2f3")),c=r(n("02cd")),s=n("365c"),l=r(n("0b61")),f=r(n("0453")),d=r(n("12df")),p=r(n("4c48")),h=r(n("e350")),v=[{title:"基地名称",dataIndex:"name"},{title:"农业类型",dataIndex:"industry_label"},{title:"是否外部链接",dataIndex:"is_blank",format:function(t){return t?"是":"否"}},{title:"排序",dataIndex:"sort"},{title:"基地负责人",dataIndex:"person"},{title:"基地农作物",dataIndex:"crops",format:function(t){var e;return null!==(e=null===t||void 0===t?void 0:t.map((function(t){return t.name})).join(","))&&void 0!==e?e:""}},{title:"基地经度",dataIndex:"address_lng"},{title:"基地纬度",dataIndex:"address_lat"},{title:"基地地址",dataIndex:"address"},{title:"基地面积",dataIndex:"areas"},{title:"种养殖面积",dataIndex:"cultivated"},{title:"基地就业人数",dataIndex:"workforce"},{title:"基地描述",dataIndex:"description"}];e.default={mixins:[l.default],components:{SearchForm:c.default,Appbar:u.default,cuPopup:f.default,BaseTablePopup:d.default,BasicsEdit:p.default},data:function(){return{baseTableColums:v,currentData:null,filterParmas:{},downOption:{use:!1},upOption:{auto:!1,page:{size:20}},dataList:[],formShow:!1,baseShow:!1,searchFormSchema:[{field:"name",label:"名称",component:"Input",componentProps:{placeholder:"请输入名称"}},{field:"industry",label:"农业类型",component:"ApiSelect",componentProps:function(t){t.formActionType;return{api:function(){var t=(0,a.default)((0,o.default)().mark((function t(e){var n,r;return(0,o.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s.http.get("/api/keywords-industry",{params:e});case 2:return n=t.sent,r=n.data,t.abrupt("return",r.data);case 5:case"end":return t.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}(),labelField:"name",valueField:"key"}}}]}},computed:{options:function(){return[{text:"编辑",opt:"edit",permission:["endpoint.agricultural_basic.edit"],style:{backgroundColor:"#007aff"}},{text:"删除",opt:"delete",permission:["endpoint.agricultural_basic.destroy"],style:{backgroundColor:"#dd524d"}}].filter((function(t){return(0,h.default)(t.permission)}))}},methods:{handleSubmit:function(t){this.filterParmas=t,this.mescroll.resetUpScroll()},upCallback:function(t){var e=t.num,n=t.size;this.getData((0,i.default)((0,i.default)({},this.filterParmas),{},{page:e,per_page:n,type:1}))},getData:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){var r,i,a,u;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,s.http.get("/api/agricultural-basic",{params:t});case 3:r=n.sent,i=r.data,1==t.page&&(e.dataList=[]),a=i.data,u=i.meta,e.dataList=e.dataList.concat(a.map((function(t){return Object.assign({show:!1},t)}))),e.mescroll.endByPage(a.length,u.total),n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](0),e.mescroll.endErr();case 14:case"end":return n.stop()}}),n,null,[[0,11]])})))()},handleClick:function(t,e){var n=this.options[e].opt,r=this.dataList[t];this.currentData=r,"edit"==n?this.handleEdit(r):"delete"==n&&this.handleDel(r)},handleContentClick:function(t){this.currentData=this.dataList[t],this.baseShow=!0},handleEdit:function(t){this.currentData=t,this.formShow=!0,this.baseShow=!1},handleDel:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:uni.showModal({title:"提示",content:"是否确定删除?",success:function(){var n=(0,a.default)((0,o.default)().mark((function n(r){var i;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!r.confirm){n.next=12;break}return n.prev=1,n.next=4,e.$http.delete("/api/agricultural-basic/".concat(t.id));case 4:e.mescroll.resetUpScroll(),e.baseShow=!1,n.next=12;break;case 8:n.prev=8,n.t0=n["catch"](1),i=n.t0.data,e.$u.toast(i.message);case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));function r(t){return n.apply(this,arguments)}return r}()});case 1:case"end":return n.stop()}}),n)})))()},handleCreate:function(){var t=this;return(0,a.default)((0,o.default)().mark((function e(){return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.currentData=null,t.formShow=!0,t.baseShow=!1;case 3:case"end":return e.stop()}}),e)})))()},handleEditConfirm:function(){this.mescroll.resetUpScroll(),this.formShow=!1}}}},fe9d:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请输入"},isOpen:{type:Boolean}},computed:{},data:function(){return{status:""}},methods:{handleChange:function(){this.$emit("change",this.status),this.$emit("close-dropdown",this.status)}},watch:{isOpen:{handler:function(t){this.status=this.value},immediate:!0}}}},ffff:function(t,e,n){var r=n("75c4");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("2143248c",r,!0,{sourceMap:!1,shadowMode:!1})}}]); \ No newline at end of file diff --git a/dist/build/h5/static/js/pages-basics-profile-detail~pages-index-monitor.ae3bfe2f.js b/dist/build/h5/static/js/pages-basics-profile-detail~pages-index-monitor.ae3bfe2f.js new file mode 100644 index 0000000..bb4dd0f --- /dev/null +++ b/dist/build/h5/static/js/pages-basics-profile-detail~pages-index-monitor.ae3bfe2f.js @@ -0,0 +1,141 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-basics-profile-detail~pages-index-monitor"],{2222:function(e,t,r){"use strict";r.r(t);var i=r("e2e5"),s=r.n(i);for(var n in i)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(n);t["default"]=s.a},2317:function(e,t,r){"use strict";var i;r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i}));var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-uni-view",{staticClass:"h-full w-full"},["iframe"==e.type?r("iframe",{staticClass:"w-full h-full",attrs:{src:e.url}}):r("div",{ref:"muiPlayer"})])},n=[]},2931:function(e,t,r){"use strict";r.r(t);var i=r("9522"),s=r("e52e");for(var n in s)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return s[e]}))}(n);var a,o=r("f0c5"),l=Object(o["a"])(s["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],a);t["default"]=l.exports},"2cb3":function(e,t,r){"use strict";r.r(t);var i=r("2317"),s=r("2222");for(var n in s)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return s[e]}))}(n);var a,o=r("f0c5"),l=Object(o["a"])(s["default"],i["b"],i["c"],!1,null,"6afb684a",null,!1,i["a"],a);t["default"]=l.exports},3315:function(e,t,r){var i=r("ae74");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var s=r("4f06").default;s("89233f1a",i,!0,{sourceMap:!1,shadowMode:!1})},"3c35":function(e,t){(function(t){e.exports=t}).call(this,{})},4362:function(e,t,r){t.nextTick=function(e){var t=Array.prototype.slice.call(arguments);t.shift(),setTimeout((function(){e.apply(null,t)}),0)},t.platform=t.arch=t.execPath=t.title="browser",t.pid=1,t.browser=!0,t.env={},t.argv=[],t.binding=function(e){throw new Error("No such module. (Possibly not yet loaded)")},function(){var e,i="/";t.cwd=function(){return i},t.chdir=function(t){e||(e=r("df7c")),i=e.resolve(t,i)}}(),t.exit=t.kill=t.umask=t.dlopen=t.uptime=t.memoryUsage=t.uvCounters=function(){},t.features={}},9522:function(e,t,r){"use strict";var i;r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i}));var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-uni-view",{staticClass:"h-full w-full"},[e.address?r("LiveVideo",{key:e.address,attrs:{url:e.address,type:e.type}}):e._e()],1)},n=[]},a567:function(e,t,r){"use strict";function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}r.r(t),r.d(t,"default",(function(){return Fa}));var s={exports:{}};(function(e,t){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),t=t.trim(),!t){if(!r.alwaysNormalize)return e;var s=a.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");return s.path=a.normalizePath(s.path),a.buildURLFromParts(s)}var n=a.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return r.alwaysNormalize?(n.path=a.normalizePath(n.path),a.buildURLFromParts(n)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=i.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var d={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(d.netLoc=o.netLoc,"/"!==n.path[0]))if(n.path){var h=o.path,c=h.substring(0,h.lastIndexOf("/")+1)+n.path;d.path=a.normalizePath(c)}else d.path=o.path,n.params||(d.params=o.params,n.query||(d.query=o.query));return null===d.path&&(d.path=r.alwaysNormalize?a.normalizePath(n.path):n.path),a.buildURLFromParts(d)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){e=e.split("").reverse().join("").replace(s,"");while(e.length!==(e=e.replace(n,"")).length);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=a})()})(s);var n=s.exports;function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function o(e){for(var t=1;t`):g}function E(e,...t){t.forEach((function(t){v[t]=e[t]?e[t].bind(e):_(t)}))}function b(e,t){if(self.console&&!0===e||"object"===typeof e){E(e,"debug","log","info","warn","error");try{v.log(`Debug logs enabled for "${t}" in hls.js version 1.4.12`)}catch(r){v=y}}else v=y}const T=v,S=/^(\d+)x(\d+)$/,L=/(.+?)=(".*?"|.*?)(?:,|$)/g;class A{constructor(e){"string"===typeof e&&(e=A.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&("X-"===t.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const r=new Uint8Array(t.length/2);for(let e=0;eNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=S.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const r={},i='"';L.lastIndex=0;while(null!==(t=L.exec(e))){let e=t[2];0===e.indexOf(i)&&e.lastIndexOf(i)===e.length-1&&(e=e.slice(1,-1));const s=t[1].trim();r[s]=e}return r}}function w(e){return"ID"!==e&&"CLASS"!==e&&"START-DATE"!==e&&"DURATION"!==e&&"END-DATE"!==e&&"END-ON-NEXT"!==e}function R(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class k{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const r=t.attr;for(const t in r)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==r[t]){T.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=d(new A({}),r,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);u(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(u(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&u(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class I{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var D={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class x{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[D.AUDIO]:null,[D.VIDEO]:null,[D.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const r=e.split("@",2),i=[];1===r.length?i[0]=t?t.byteRangeEndOffset:0:i[0]=parseInt(r[1]),i[1]=parseInt(r[0])+i[0],this._byteRange=i}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=n.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class C extends x{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new I,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!u(this.programDateTime))return null;const e=u(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,r,i,s,n=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,i),o.endDTS=Math.max(o.endDTS,s)):a[e]={startPTS:t,endPTS:r,startDTS:i,endDTS:s,partial:n}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[D.AUDIO]=null,e[D.VIDEO]=null,e[D.AUDIOVIDEO]=null}}class P extends x{constructor(e,t,r,i,s){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new I,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,s),s&&(this.fragOffset=s.fragOffset+s.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const O=10;class M{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&u(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||O}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){const t=this.driftEnd-this.driftStart;return 1e3*t/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function F(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function N(e){const t=$(e).subarray(0,16),r=new Uint8Array(16);return r.set(t,16-t.length),r}function U(e){const t=function(e,t,r){const i=e[t];e[t]=e[r],e[r]=i};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function B(e){const t=e.split(":");let r=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),i=e[e.length-1].split(",");if(2===i.length){const t="base64"===i[0],s=i[1];t?(e.splice(-1,1),r=F(s)):r=N(s)}}return r}function $(e){return Uint8Array.from(unescape(encodeURIComponent(e)),e=>e.charCodeAt(0))}var G={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},j={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function K(e){switch(e){case j.FAIRPLAY:return G.FAIRPLAY;case j.PLAYREADY:return G.PLAYREADY;case j.WIDEVINE:return G.WIDEVINE;case j.CLEARKEY:return G.CLEARKEY}}var V={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function H(e){if(e===V.WIDEVINE)return G.WIDEVINE}function Y(e){switch(e){case G.FAIRPLAY:return j.FAIRPLAY;case G.PLAYREADY:return j.PLAYREADY;case G.WIDEVINE:return j.WIDEVINE;case G.CLEARKEY:return j.CLEARKEY}}function z(e){const{drmSystems:t,widevineLicenseUrl:r}=e,i=t?[G.FAIRPLAY,G.WIDEVINE,G.PLAYREADY,G.CLEARKEY].filter(e=>!!t[e]):[];return!i[G.WIDEVINE]&&r&&i.push(G.WIDEVINE),i}const W=function(){return"undefined"!==typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function q(e,t,r,i){let s;switch(e){case G.FAIRPLAY:s=["cenc","sinf"];break;case G.WIDEVINE:case G.PLAYREADY:s=["cenc"];break;case G.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+e)}return X(s,t,r,i)}function X(e,t,r,i){const s={initDataTypes:e,persistentState:i.persistentState||"not-allowed",distinctiveIdentifier:i.distinctiveIdentifier||"not-allowed",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:t.map(e=>({contentType:`audio/mp4; codecs="${e}"`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:r.map(e=>({contentType:`video/mp4; codecs="${e}"`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))};return[s]}function Q(e,t,r){return Uint8Array.prototype.slice?e.slice(t,r):new Uint8Array(Array.prototype.slice.call(e,t,r))}const Z=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,J=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,ee=(e,t)=>{const r=t;let i=0;while(Z(e,t)){i+=10;const r=te(e,t+6);i+=r,J(e,t+10)&&(i+=10),t+=i}if(i>0)return e.subarray(r,r+i)},te=(e,t)=>{let r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3],r},re=(e,t)=>Z(e,t)&&te(e,t+6)+10<=e.length-t,ie=e=>{const t=ae(e);for(let r=0;re&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,ne=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=te(e,4),i=10;return{type:t,size:r,data:e.subarray(i,i+r)}},ae=e=>{let t=0;const r=[];while(Z(e,t)){const i=te(e,t+6);t+=10;const s=t+i;while(t+8"PRIV"===e.type?le(e):"W"===e.type[0]?he(e):de(e),le=e=>{if(e.size<2)return;const t=ue(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}},de=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const r=ue(e.data.subarray(t),!0);t+=r.length+1;const i=ue(e.data.subarray(t));return{key:e.type,info:r,data:i}}const t=ue(e.data.subarray(1));return{key:e.type,data:t}},he=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const r=ue(e.data.subarray(t),!0);t+=r.length+1;const i=ue(e.data.subarray(t));return{key:e.type,info:r,data:i}}const t=ue(e.data);return{key:e.type,data:t}},ce=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),r=1&t[3];let i=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},ue=(e,t=!1)=>{const r=pe();if(r){const i=r.decode(e);if(t){const e=i.indexOf("\0");return-1!==e?i.substring(0,e):i}return i.replace(/\0/g,"")}const i=e.length;let s,n,a,o="",l=0;while(l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(s);break;case 12:case 13:n=e[l++],o+=String.fromCharCode((31&s)<<6|63&n);break;case 14:n=e[l++],a=e[l++],o+=String.fromCharCode((15&s)<<12|(63&n)<<6|(63&a)<<0);break}}return o};let fe;function pe(){return fe||"undefined"===typeof self.TextDecoder||(fe=new self.TextDecoder("utf-8")),fe}const me={hexDump:function(e){let t="";for(let r=0;r>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function Le(e,t){const r=[];if(!t.length)return r;const i=e.byteLength;for(let s=0;s1?s+n:i;if(a===t[0])if(1===t.length)r.push(e.subarray(s+8,o));else{const i=Le(e.subarray(s+8,o),t.slice(1));i.length&&ye.apply(r,i)}s=o}return r}function Ae(e){const t=[],r=e[0];let i=8;const s=be(e,i);i+=4;const n=0,a=0;i+=0===r?8:16,i+=2;let o=e.length+a;const l=Ee(e,i);i+=2;for(let d=0;d>>31;if(1===l)return T.warn("SIDX has hierarchical references (not supported)"),null;const d=be(e,r);r+=4,t.push({referenceSize:a,subsegmentDuration:d,info:{duration:d/s,start:o,end:o+a-1}}),o+=a,r+=4,i=r}return{earliestPresentationTime:n,timescale:s,version:r,referencesCount:l,references:t}}function we(e){const t=[],r=Le(e,["moov","trak"]);for(let s=0;s{const r=be(e,4),i=t[r];i&&(i.default={duration:be(e,12),flags:be(e,20)})}),t}function Re(e,t){if(!e||!t)return e;const r=t.keyId;if(r&&t.isCommonEncryption){const t=Le(e,["moov","trak"]);t.forEach(e=>{const t=Le(e,["mdia","minf","stbl","stsd"])[0],i=t.subarray(8);let s=Le(i,["enca"]);const n=s.length>0;n||(s=Le(i,["encv"])),s.forEach(e=>{const t=n?e.subarray(28):e.subarray(78),i=Le(t,["sinf"]);i.forEach(e=>{const t=ke(e);if(t){const e=t.subarray(8,24);e.some(e=>0!==e)||(T.log(`[eme] Patching keyId in 'enc${n?"a":"v"}>sinf>>tenc' box: ${me.hexDump(e)} -> ${me.hexDump(r)}`),t.set(r,8))}})})})}return e}function ke(e){const t=Le(e,["schm"])[0];if(t){const r=_e(t.subarray(4,8));if("cbcs"===r||"cenc"===r)return Le(e,["schi","tenc"])[0]}return T.error("[eme] missing 'schm' box"),null}function Ie(e,t){return Le(t,["moof","traf"]).reduce((t,r)=>{const i=Le(r,["tfdt"])[0],s=i[0],n=Le(r,["tfhd"]).reduce((t,r)=>{const n=be(r,4),a=e[n];if(a){let e=be(i,4);if(1===s){if(e===ge)return T.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;e*=ge+1,e+=be(i,8)}const r=a.timescale||9e4,n=e/r;if(isFinite(n)&&(null===t||ne+t.info.duration||0,0))}return t}return i||s}function xe(e){const t=be(e,0);let r=8;1&t&&(r+=4),4&t&&(r+=4);let i=0;const s=be(e,4);for(let n=0;n{Le(t,["tfhd"]).forEach(i=>{const s=be(i,4),n=e[s];if(!n)return;const a=n.timescale||9e4;Le(t,["tfdt"]).forEach(e=>{const t=e[0];let i=be(e,4);if(0===t)i-=r*a,i=Math.max(i,0),Se(e,4,i);else{i*=Math.pow(2,32),i+=be(e,8),i-=r*a,i=Math.max(i,0);const t=Math.floor(i/(ge+1)),s=Math.floor(i%(ge+1));Se(e,4,t),Se(e,8,s)}})})})}function Pe(e){const t={valid:null,remainder:null},r=Le(e,["moof"]);if(!r)return t;if(r.length<2)return t.remainder=e,t;const i=r[r.length-1];return t.valid=Q(e,0,i.byteOffset-8),t.remainder=Q(e,i.byteOffset-8),t}function Oe(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Me(e,t){const r=[],i=t.samples,s=t.timescale,n=t.id;let a=!1;const o=Le(i,["moof"]);return o.map(o=>{const l=o.byteOffset-8,d=Le(o,["traf"]);d.map(o=>{const d=Le(o,["tfdt"]).map(e=>{const t=e[0];let r=be(e,4);return 1===t&&(r*=Math.pow(2,32),r+=be(e,8)),r/s})[0];return void 0!==d&&(e=d),Le(o,["tfhd"]).map(d=>{const h=be(d,4),c=16777215&be(d,0),u=0!==(1&c),f=0!==(2&c),p=0!==(8&c);let m=0;const g=0!==(16&c);let y=0;const v=0!==(32&c);let _=8;h===n&&(u&&(_+=8),f&&(_+=4),p&&(m=be(d,_),_+=4),g&&(y=be(d,_),_+=4),v&&(_+=4),"video"===t.type&&(a=Fe(t.codec)),Le(o,["trun"]).map(n=>{const o=n[0],d=16777215&be(n,0),h=0!==(1&d);let c=0;const u=0!==(4&d),f=0!==(256&d);let p=0;const g=0!==(512&d);let v=0;const _=0!==(1024&d),E=0!==(2048&d);let b=0;const T=be(n,4);let S=8;h&&(c=be(n,S),S+=4),u&&(S+=4);let L=c+l;for(let l=0;l>1&63;return 39===e||40===e}{const e=31&t;return 6===e}}function Ue(e,t,r,i){const s=Be(e);let n=0;n+=t;let a=0,o=0,l=!1,d=0;while(n=s.length)break;d=s[n++],a+=d}while(255===d);o=0;do{if(n>=s.length)break;d=s[n++],o+=d}while(255===d);const e=s.length-n;if(!l&&4===a&&n16){const e=[];for(let r=0;r<16;r++){const t=s[n++].toString(16);e.push(1==t.length?"0"+t:t),3!==r&&5!==r&&7!==r&&9!==r||e.push("-")}const t=o-16,l=new Uint8Array(t);for(let r=0;re)break}}function Be(e){const t=e.byteLength,r=[];let i=1;while(i>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=255&i,n.set(e,4),s=0,i=8;s0?(n=new Uint8Array(4),t.length>0&&new DataView(n.buffer).setUint32(0,t.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(a.buffer).setUint32(0,r.byteLength,!1),Ge([112,115,115,104],new Uint8Array([i,0,0,0]),e,n,s,a,r||new Uint8Array)}function Ke(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},r=new DataView(e),i=r.getUint32(0);if(e.byteLength!==i&&i>44)return null;const s=r.getUint32(4);if(1886614376!==s)return null;if(t.version=r.getUint32(8)>>>24,t.version>1)return null;t.systemId=me.hexDump(new Uint8Array(e,12,16));const n=r.getUint32(28);if(0===t.version){if(i-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case j.PLAYREADY:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=je(e,null,t);const r=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=String.fromCharCode.apply(null,Array.from(r)),s=i.substring(i.indexOf("<"),i.length),n=new DOMParser,a=n.parseFromString(s,"text/xml"),o=a.getElementsByTagName("KID")[0];if(o){const e=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(e){const t=F(e).subarray(0,16);U(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Ve[this.uri];if(!e){const t=Object.keys(Ve).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);const r=new DataView(e.buffer,12,4);r.setUint32(0,t),Ve[this.uri]=e}this.keyId=e}return this}}function Ye(e){const t=new Uint8Array(16);for(let r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t}const ze=/\{\$([a-zA-Z0-9-_]+)\}/g;function We(e){return ze.test(e)}function qe(e,t,r){if(null!==e.variableList||e.hasVariableRefs)for(let i=r.length;i--;){const s=r[i],n=t[s];n&&(t[s]=Xe(e,n))}}function Xe(e,t){if(null!==e.variableList||e.hasVariableRefs){const r=e.variableList;return t.replace(ze,t=>{const i=t.substring(2,t.length-1),s=null==r?void 0:r[i];return void 0===s?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),t):s})}return t}function Qe(e,t,r){let i,s,n=e.variableList;if(n||(e.variableList=n={}),"QUERYPARAM"in t){i=t.QUERYPARAM;try{const e=new self.URL(r).searchParams;if(!e.has(i))throw new Error(`"${i}" does not match any query parameter in URI: "${r}"`);s=e.get(i)}catch(a){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: "+a.message))}}else i=t.NAME,s=t.VALUE;i in n?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=s||""}function Ze(e,t,r){const i=t.IMPORT;if(r&&i in r){let t=e.variableList;t||(e.variableList=t={}),t[i]=r[i]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}function Je(){if("undefined"!==typeof self)return self.MediaSource||self.WebKitMediaSource}const et={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},tt=Je();function rt(e,t){const r=et[t];return!!r&&!0===r[e.slice(0,4)]}function it(e,t){var r;return null!=(r=null==tt?void 0:tt.isTypeSupported(`${t||"video"}/mp4;codecs="${e}"`))&&r}const st=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,nt=/#EXT-X-MEDIA:(.*)/g,at=/^#EXT(?:INF|-X-TARGETDURATION):/m,ot=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),lt=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class dt{static findGroup(e,t){for(let r=0;r2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}static resolve(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return at.test(e)}static parseMasterPlaylist(e,t){const r=We(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},s=[];let n;st.lastIndex=0;while(null!=(n=st.exec(e)))if(n[1]){var a;const e=new A(n[1]);qe(i,e,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const r=Xe(i,n[2]),o={attrs:e,bitrate:e.decimalInteger("AVERAGE-BANDWIDTH")||e.decimalInteger("BANDWIDTH"),name:e.NAME,url:dt.resolve(r,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),ut((e.CODECS||"").split(/[ ,]+/).filter(e=>e),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=dt.convertAVC1ToAVCOTI(o.videoCodec)),null!=(a=o.unknownCodecs)&&a.length||s.push(o),i.levels.push(o)}else if(n[3]){const e=n[3],r=n[4];switch(e){case"SESSION-DATA":{const e=new A(r);qe(i,e,["DATA-ID","LANGUAGE","VALUE","URI"]);const t=e["DATA-ID"];t&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[t]=e);break}case"SESSION-KEY":{const e=ht(r,t,i);e.encrypted&&e.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(e)):T.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":{const e=new A(r);qe(i,e,["NAME","VALUE","QUERYPARAM"]),Qe(i,e,t)}break;case"CONTENT-STEERING":{const e=new A(r);qe(i,e,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:dt.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=ct(r);break}}const o=s.length>0&&s.length({id:e.attrs.AUDIO,audioCodec:e.audioCodec})),SUBTITLES:n.map(e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec})),"CLOSED-CAPTIONS":[]};let o=0;nt.lastIndex=0;while(null!==(i=nt.exec(e))){const e=new A(i[1]),n=e.TYPE;if(n){const i=a[n],l=s[n]||[];s[n]=l,qe(r,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const d={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",instreamId:e["INSTREAM-ID"],name:e.NAME||e.LANGUAGE||"",type:n,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:e.LANGUAGE,url:e.URI?dt.resolve(e.URI,t):""};if(null!=i&&i.length){const e=dt.findGroup(i,d.groupId)||i[0];ft(d,e,"audioCodec"),ft(d,e,"textCodec")}l.push(d)}}return s}static parseLevelPlaylist(e,t,r,i,s,n){const a=new M(t),o=a.fragments;let l,h,c,f=null,p=0,m=0,g=0,y=0,v=null,_=new C(i,t),E=-1,b=!1;ot.lastIndex=0,a.m3u8=e,a.hasVariableRefs=We(e);while(null!==(l=ot.exec(e))){b&&(b=!1,_=new C(i,t),_.start=g,_.sn=p,_.cc=y,_.level=r,f&&(_.initSegment=f,_.rawProgramDateTime=f.rawProgramDateTime,f.rawProgramDateTime=null));const e=l[1];if(e){_.duration=parseFloat(e);const t=(" "+l[2]).slice(1);_.title=t||null,_.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(u(_.duration)){_.start=g,c&&yt(_,c,a),_.sn=p,_.level=r,_.cc=y,_.urlId=s,o.push(_);const e=(" "+l[3]).slice(1);_.relurl=Xe(a,e),mt(_,v),v=_,g+=_.duration,p++,m=0,b=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);v?_.setByteRange(e,v):_.setByteRange(e)}else if(l[5])_.rawProgramDateTime=(" "+l[5]).slice(1),_.tagList.push(["PROGRAM-DATE-TIME",_.rawProgramDateTime]),-1===E&&(E=o.length);else{if(l=l[0].match(lt),!l){T.warn("No matches on slow regex match for level playlist!");continue}for(h=1;h0&&e.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),a.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new A(s);a.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=a.partList;e||(e=a.partList=[]);const r=m>0?e[e.length-1]:void 0,i=m++,n=new A(s);qe(a,n,["BYTERANGE","URI"]);const o=new P(n,_,t,i,r);e.push(o),_.duration+=o.duration;break}case"PRELOAD-HINT":{const e=new A(s);qe(a,e,["URI"]),a.preloadHint=e;break}case"RENDITION-REPORT":{const e=new A(s);qe(a,e,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(e);break}default:T.warn("line parsed but not handled: "+l);break}}}v&&!v.relurl?(o.pop(),g-=v.duration,a.partList&&(a.fragmentHint=v)):a.partList&&(mt(_,v),_.cc=y,a.fragmentHint=_,c&&yt(_,c,a));const S=o.length,L=o[0],w=o[S-1];if(g+=a.skippedSegments*a.targetduration,g>0&&S&&w){a.averagetargetduration=g/S;const e=w.sn;a.endSN="initSegment"!==e?e:0,a.live||(w.endList=!0),L&&(a.startCC=L.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(g+=a.fragmentHint.duration),a.totalduration=g,a.endCC=y,E>0&&pt(o,E),a}}function ht(e,t,r){var i,s;const n=new A(e);qe(r,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const a=null!=(i=n.METHOD)?i:"",o=n.URI,l=n.hexadecimalInteger("IV"),d=n.KEYFORMATVERSIONS,h=null!=(s=n.KEYFORMAT)?s:"identity";o&&n.IV&&!l&&T.error("Invalid IV: "+n.IV);const c=o?dt.resolve(o,t):"",u=(d||"1").split("/").map(Number).filter(Number.isFinite);return new He(a,c,h,u,l)}function ct(e){const t=new A(e),r=t.decimalFloatingPoint("TIME-OFFSET");return u(r)?r:null}function ut(e,t){["video","audio","text"].forEach(r=>{const i=e.filter(e=>rt(e,r));if(i.length){const s=i.filter(e=>0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0));t[r+"Codec"]=s.length>0?s[0]:i[0],e=e.filter(e=>-1===i.indexOf(e))}}),t.unknownCodecs=e}function ft(e,t,r){const i=t[r];i&&(e[r]=i)}function pt(e,t){let r=e[t];for(let i=t;i--;){const t=e[i];if(!t)return;t.programDateTime=r.programDateTime-1e3*t.duration,r=t}}function mt(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),u(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function gt(e,t,r,i){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",i&&(e.levelkeys=i),e.initSegment=null}function yt(e,t,r){e.levelkeys=t;const{encryptedFragments:i}=r;i.length&&i[i.length-1].levelkeys===t||!Object.keys(t).some(e=>t[e].isCommonEncryption)||i.push(e)}var vt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},_t={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Et(e){const{type:t}=e;switch(t){case vt.AUDIO_TRACK:return _t.AUDIO;case vt.SUBTITLE_TRACK:return _t.SUBTITLE;default:return _t.MAIN}}function bt(e,t){let r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}class Tt{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(f.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(f.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,i=t.loader,s=r||i,n=new s(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:vt.MANIFEST,url:r,deliveryDirectives:null})}onLevelLoading(e,t){const{id:r,level:i,url:s,deliveryDirectives:n}=t;this.load({id:r,level:i,responseType:"text",type:vt.LEVEL,url:s,deliveryDirectives:n})}onAudioTrackLoading(e,t){const{id:r,groupId:i,url:s,deliveryDirectives:n}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:vt.AUDIO_TRACK,url:s,deliveryDirectives:n})}onSubtitleTrackLoading(e,t){const{id:r,groupId:i,url:s,deliveryDirectives:n}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:vt.SUBTITLE_TRACK,url:s,deliveryDirectives:n})}load(e){var t;const r=this.hls.config;let i,s=this.getInternalLoader(e);if(s){const t=s.context;if(t&&t.url===e.url)return void T.trace("[playlist-loader]: playlist request ongoing");T.log("[playlist-loader]: aborting previous loader for type: "+e.type),s.abort()}if(i=e.type===vt.MANIFEST?r.manifestLoadPolicy.default:d({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part){let t;if(e.type===vt.LEVEL&&null!==e.level?t=this.hls.levels[e.level].details:e.type===vt.AUDIO_TRACK&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===vt.SUBTITLE_TRACK&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,r=t.targetduration;if(e&&r){const t=1e3*Math.max(3*e,.8*r);i=d({},i,{maxTimeToFirstByteMs:Math.min(t,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,i.maxTimeToFirstByteMs)})}}}const n=i.errorRetry||i.timeoutRetry||{},a={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},o={onSuccess:(e,t,r,i)=>{const s=this.getInternalLoader(r);this.resetInternalLoader(r.type);const n=e.data;0===n.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),dt.isMediaPlaylist(n)?this.handleTrackOrLevelPlaylist(e,t,r,i||null,s):this.handleMasterPlaylist(e,t,r,i)):this.handleManifestParsingError(e,r,new Error("no EXTM3U delimiter"),i||null,t)},onError:(e,t,r,i)=>{this.handleNetworkError(t,r,!1,e,i)},onTimeout:(e,t,r)=>{this.handleNetworkError(t,r,!0,void 0,e)}};s.load(e,a,o)}handleMasterPlaylist(e,t,r,i){const s=this.hls,n=e.data,a=bt(e,r),o=dt.parseMasterPlaylist(n,a);if(o.playlistParsingError)return void this.handleManifestParsingError(e,r,o.playlistParsingError,i,t);const{contentSteering:l,levels:d,sessionData:h,sessionKeys:c,startTimeOffset:u,variableList:p}=o;this.variableList=p;const{AUDIO:m=[],SUBTITLES:g,"CLOSED-CAPTIONS":y}=dt.parseMasterPlaylistMedia(n,a,o);if(m.length){const e=m.some(e=>!e.url);e||!d[0].audioCodec||d[0].attrs.AUDIO||(T.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new A({}),bitrate:0,url:""}))}s.trigger(f.MANIFEST_LOADED,{levels:d,audioTracks:m,subtitles:g,captions:y,contentSteering:l,url:a,stats:t,networkDetails:i,sessionData:h,sessionKeys:c,startTimeOffset:u,variableList:p})}handleTrackOrLevelPlaylist(e,t,r,i,s){const n=this.hls,{id:a,level:o,type:l}=r,d=bt(e,r),h=u(a)?a:0,c=u(o)?o:h,p=Et(r),m=dt.parseLevelPlaylist(e.data,d,c,p,h,this.variableList);if(l===vt.MANIFEST){const e={attrs:new A({}),bitrate:0,details:m,name:"",url:d};n.trigger(f.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:d,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=m,this.handlePlaylistLoaded(m,e,t,r,i,s)}handleManifestParsingError(e,t,r,i,s){this.hls.trigger(f.ERROR,{type:p.NETWORK_ERROR,details:m.MANIFEST_PARSING_ERROR,fatal:t.type===vt.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:i,stats:s})}handleNetworkError(e,t,r=!1,i,s){let n=`A network ${r?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===vt.LEVEL?n+=`: ${e.level} id: ${e.id}`:e.type!==vt.AUDIO_TRACK&&e.type!==vt.SUBTITLE_TRACK||(n+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(n);T.warn("[playlist-loader]: "+n);let l=m.UNKNOWN,d=!1;const h=this.getInternalLoader(e);switch(e.type){case vt.MANIFEST:l=r?m.MANIFEST_LOAD_TIMEOUT:m.MANIFEST_LOAD_ERROR,d=!0;break;case vt.LEVEL:l=r?m.LEVEL_LOAD_TIMEOUT:m.LEVEL_LOAD_ERROR,d=!1;break;case vt.AUDIO_TRACK:l=r?m.AUDIO_TRACK_LOAD_TIMEOUT:m.AUDIO_TRACK_LOAD_ERROR,d=!1;break;case vt.SUBTITLE_TRACK:l=r?m.SUBTITLE_TRACK_LOAD_TIMEOUT:m.SUBTITLE_LOAD_ERROR,d=!1;break}h&&this.resetInternalLoader(e.type);const c={type:p.NETWORK_ERROR,details:l,fatal:d,url:e.url,loader:h,context:e,error:a,networkDetails:t,stats:s};if(i){const r=(null==t?void 0:t.url)||e.url;c.response=o({url:r,data:void 0},i)}this.hls.trigger(f.ERROR,c)}handlePlaylistLoaded(e,t,r,i,s,n){const a=this.hls,{type:o,level:l,id:d,groupId:h,deliveryDirectives:c}=i,u=bt(t,i),g=Et(i),y="number"===typeof i.level&&g===_t.MAIN?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void a.trigger(f.ERROR,{type:p.NETWORK_ERROR,details:m.LEVEL_EMPTY_ERROR,fatal:!1,url:u,error:e,reason:e.message,response:t,context:i,level:y,parent:g,networkDetails:s,stats:r})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const v=e.playlistParsingError;if(v)a.trigger(f.ERROR,{type:p.NETWORK_ERROR,details:m.LEVEL_PARSING_ERROR,fatal:!1,url:u,error:v,reason:v.message,response:t,context:i,level:y,parent:g,networkDetails:s,stats:r});else switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),n.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case vt.MANIFEST:case vt.LEVEL:a.trigger(f.LEVEL_LOADED,{details:e,level:y||0,id:d||0,stats:r,networkDetails:s,deliveryDirectives:c});break;case vt.AUDIO_TRACK:a.trigger(f.AUDIO_TRACK_LOADED,{details:e,id:d||0,groupId:h||"",stats:r,networkDetails:s,deliveryDirectives:c});break;case vt.SUBTITLE_TRACK:a.trigger(f.SUBTITLE_TRACK_LOADED,{details:e,id:d||0,groupId:h||"",stats:r,networkDetails:s,deliveryDirectives:c});break}}}function St(e,t){let r;try{r=new Event("addtrack")}catch(i){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function Lt(e,t){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(i){T.debug("[texttrack-utils]: "+i);try{const r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}catch(s){T.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+s)}}"disabled"===r&&(e.mode=r)}function At(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function wt(e,t,r,i){const s=e.mode;if("disabled"===s&&(e.mode="hidden"),e.cues&&e.cues.length>0){const s=kt(e.cues,t,r);for(let t=0;te[r].endTime)return-1;let i=0,s=r;while(i<=s){const n=Math.floor((s+i)/2);if(te[n].startTime&&i-1)for(let n=s,a=e.length;n=t&&s.endTime<=r)i.push(s);else if(s.startTime>r)return i}return i}var It={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Dt=.25;function xt(){if("undefined"!==typeof self)return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const Ct=(()=>{const e=xt();try{new e(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Pt(e,t){return e.getTime()/1e3-t}function Ot(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Mt{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(At(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tCt&&(i=Ct);const o=i-r;o<=0&&(i=r+Dt);for(let s=0;se.type===It.audioId3&&o:"video"===i?e=>e.type===It.emsg&&a:e=>e.type===It.audioId3&&o||e.type===It.emsg&&a,wt(s,t,r,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:r,id3Track:i}=this,{dateRanges:s}=t,n=Object.keys(s);if(i){const e=Object.keys(r).filter(e=>!n.includes(e));for(let t=e.length;t--;){const s=e[t];Object.keys(r[s].cues).forEach(e=>{i.removeCue(r[s].cues[e])}),delete r[s]}}const a=t.fragments[t.fragments.length-1];if(0===n.length||!u(null==a?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=a.programDateTime/1e3-a.start,l=xt();for(let d=0;d{const i=s[r];return i.class===t.class&&i.id!==r&&i.startDate>t.startDate&&e.push(i),e},[]).sort((e,t)=>e.startDate.getTime()-t.startDate.getTime())[0];e&&(u=Pt(e.startDate,o),h=!0)}const p=Object.keys(t.attr);for(let r=0;rthis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:r,targetduration:i}=e,{liveSyncDuration:s,liveSyncDurationCount:n,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&r||t;(o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==s?s:n*i);const d=i,h=1;return l+Math.min(this.stallCount*h,d)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;const i=r.edge,s=e-t-this.edgeStalled,n=i-r.totalduration,a=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(n,s),a)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(f.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(f.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var r;t.details===m.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(r=this.levelDetails)&&r.live&&T.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const r=this.computeLatency();if(null===r)return;this._latency=r;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||1===s)return;const n=this.targetLatency;if(null===n)return;const a=r-n,o=Math.min(this.maxLatency,n+t.targetduration),l=a.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,s)),r=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,r))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const Nt=["NONE","TYPE-0","TYPE-1",null];var Ut={No:"",Yes:"YES",v2:"v2"};function Bt(e,t){const{canSkipUntil:r,canSkipDateRanges:i,endSN:s}=e,n=void 0!==t?t-s:0;return r&&ne).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}get textGroupId(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function jt(e,t){const r=t.startPTS;if(u(r)){let i,s=0;t.sn>e.sn?(s=r-e.start,i=e):(s=e.start-r,i=t),i.duration!==s&&(i.duration=s)}else if(t.sn>e.sn){const r=e.cc===t.cc;r&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration}else t.start=Math.max(e.start-t.duration,0)}function Kt(e,t,r,i,s,n){const a=i-r;a<=0&&(T.warn("Fragment should have a positive duration",t),i=r+t.duration,n=s+t.duration);let o=r,l=i;const d=t.startPTS,h=t.endPTS;if(u(d)){const e=Math.abs(d-r);u(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,o=Math.max(r,d),r=Math.min(r,d),s=Math.min(s,t.startDTS),l=Math.min(i,h),i=Math.max(i,h),n=Math.max(n,t.endDTS)}const c=r-t.start;0!==t.start&&(t.start=r),t.duration=i-t.start,t.startPTS=r,t.maxStartPTS=o,t.startDTS=s,t.endPTS=i,t.minEndPTS=l,t.endDTS=n;const f=t.sn;if(!e||fe.endSN)return 0;let p;const m=f-e.startSN,g=e.fragments;for(g[m]=t,p=m;p>0;p--)jt(g[p],g[p-1]);for(p=m;p=0;l--){const e=i[l].initSegment;if(e){r=e;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let s,n=0;if(zt(e,t,(e,i)=>{e.relurl&&(n=e.cc-i.cc),u(e.startPTS)&&u(e.endPTS)&&(i.start=i.startPTS=e.startPTS,i.startDTS=e.startDTS,i.maxStartPTS=e.maxStartPTS,i.endPTS=e.endPTS,i.endDTS=e.endDTS,i.minEndPTS=e.minEndPTS,i.duration=e.endPTS-e.startPTS,i.duration&&(s=i),t.PTSKnown=t.alignedSliding=!0),i.elementaryStreams=e.elementaryStreams,i.loader=e.loader,i.stats=e.stats,i.urlId=e.urlId,e.initSegment&&(i.initSegment=e.initSegment,r=e.initSegment)}),r){const e=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;e.forEach(e=>{var t;e.initSegment&&e.initSegment.relurl!==(null==(t=r)?void 0:t.relurl)||(e.initSegment=r)})}if(t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some(e=>!e),t.deltaUpdateFailed){T.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=Ht(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const a=t.fragments;if(n){T.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats}),s?Kt(t,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):Wt(e,t),a.length&&(t.totalduration=t.edge-a[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const e=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=e),t.driftEndTime=o,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function Ht(e,t,r){const i=d({},e);return r&&r.forEach(e=>{delete i[e]}),Object.keys(t).forEach(e=>{const r=new k(t[e].attr,i[e]);r.isValid?i[e]=r:T.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)}),i}function Yt(e,t,r){if(e&&t){let i=0;for(let s=0,n=e.length;s<=n;s++){const n=e[s],a=t[s+i];n&&a&&n.index===a.index&&n.fragment.sn===a.fragment.sn?r(n,a):i--}}}function zt(e,t,r){const i=t.skippedSegments,s=Math.max(e.startSN,t.startSN)-t.startSN,n=(e.fragmentHint?1:0)+(i?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let d=s;d<=n;d++){const e=l[a+d];let s=o[d];i&&!s&&d=i.length||qt(t,i[r].start)}function qt(e,t){if(t){const r=e.fragments;for(let i=e.skippedSegments;it){const e=1e3*i[i.length-1].duration;e499)}const ar={search:function(e,t){let r=0,i=e.length-1,s=null,n=null;while(r<=i){s=(r+i)/2|0,n=e[s];const a=t(n);if(a>0)r=s+1;else{if(!(a<0))return n;i=s-1}}return null}};function or(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!u(t))return null;const i=e[0].programDateTime;if(t<(i||0))return null;const s=e[e.length-1].endProgramDateTime;if(t>=(s||0))return null;r=r||0;for(let n=0;ne)return 0;const i=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=e?1:r.start-i>e&&r.start?-1:0}function hr(e,t,r){const i=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0)),s=r.endProgramDateTime||0;return s-i>e}function cr(e,t){return ar.search(e,e=>e.cct?-1:0)}const ur=3e5;var fr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},pr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class mr{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=T.log.bind(T,"[info]:"),this.warn=T.warn.bind(T,"[warning]:"),this.error=T.error.bind(T,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(f.ERROR,this.onError,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(f.ERROR,this.onError,this),e.off(f.ERROR,this.onErrorOut,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(null==e?void 0:e.type)===_t.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var r,i;if(t.fatal)return;const s=this.hls,n=t.context;switch(t.details){case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case m.FRAG_PARSING_ERROR:if(null!=(r=t.frag)&&r.gap)return void(t.errorAction={action:fr.DoNothing,flags:pr.None});case m.FRAG_GAP:case m.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=fr.SendAlternateToPenaltyBox);case m.LEVEL_EMPTY_ERROR:case m.LEVEL_PARSING_ERROR:{var a,o;const e=t.parent===_t.MAIN?t.level:s.loadLevel;t.details===m.LEVEL_EMPTY_ERROR&&null!=(a=t.context)&&null!=(o=a.levelDetails)&&o.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:return void("number"===typeof(null==n?void 0:n.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level)));case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.SUBTITLE_LOAD_ERROR:case m.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const e=s.levels[s.loadLevel];if(e&&(n.type===vt.AUDIO_TRACK&&n.groupId===e.audioGroupId||n.type===vt.SUBTITLE_TRACK&&n.groupId===e.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=fr.SendAlternateToPenaltyBox,void(t.errorAction.flags=pr.MoveAllAlternatesMatchingHost)}return;case m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=s.levels[s.loadLevel],r=null==e?void 0:e.attrs["HDCP-LEVEL"];r&&(t.errorAction={action:fr.SendAlternateToPenaltyBox,flags:pr.MoveAllAlternatesMatchingHDCP,hdcpLevel:r})}return;case m.BUFFER_ADD_CODEC_ERROR:case m.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(i=t.level)?i:s.loadLevel));case m.INTERNAL_EXCEPTION:case m.BUFFER_APPENDING_ERROR:case m.BUFFER_APPEND_ERROR:case m.BUFFER_FULL_ERROR:case m.LEVEL_SWITCH_ERROR:case m.BUFFER_STALLED_ERROR:case m.BUFFER_SEEK_OVER_HOLE:case m.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:fr.DoNothing,flags:pr.None})}if(t.type===p.KEY_SYSTEM_ERROR){const e=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,e))}}getPlaylistRetryOrSwitchAction(e,t){var r;const i=this.hls,s=tr(i.config.playlistLoadPolicy,e),n=this.playlistError++,a=null==(r=e.response)?void 0:r.code,o=sr(s,n,er(e),a);if(o)return{action:fr.RetryRequest,flags:pr.None,retryConfig:s,retryCount:n};const l=this.getLevelSwitchAction(e,t);return s&&(l.retryConfig=s,l.retryCount=n),l}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),i=t.levels[r],{fragLoadPolicy:s,keyLoadPolicy:n}=t.config,a=tr(e.details.startsWith("key")?n:s,e),o=t.levels.reduce((e,t)=>e+t.fragmentError,0);if(i){var l;e.details!==m.FRAG_GAP&&i.fragmentError++;const t=null==(l=e.response)?void 0:l.code,r=sr(a,o,er(e),t);if(r)return{action:fr.RetryRequest,flags:pr.None,retryConfig:a,retryCount:o}}const d=this.getLevelSwitchAction(e,r);return a&&(d.retryConfig=a,d.retryCount=o),d}getLevelSwitchAction(e,t){const r=this.hls;null!==t&&void 0!==t||(t=r.loadLevel);const i=this.hls.levels[t];if(i&&(i.loadError++,r.autoLevelEnabled)){var s,n;let t=-1;const{levels:a,loadLevel:o,minAutoLevel:l,maxAutoLevel:d}=r,h=null==(s=e.frag)?void 0:s.type,{type:c,groupId:u}=null!=(n=e.context)?n:{};for(let r=a.length;r--;){const s=(r+o)%a.length;if(s!==o&&s>=l&&s<=d&&0===a[s].loadError){const r=a[s];if(e.details===m.FRAG_GAP&&e.frag){const t=a[s].details;if(t){const r=lr(e.frag,t.fragments,e.frag.start);if(null!=r&&r.gap)continue}}else{if(c===vt.AUDIO_TRACK&&u===r.audioGroupId||c===vt.SUBTITLE_TRACK&&u===r.textGroupId)continue;if(h===_t.AUDIO&&i.audioGroupId===r.audioGroupId||h===_t.SUBTITLE&&i.textGroupId===r.textGroupId)continue}t=s;break}}if(t>-1&&r.loadLevel!==t)return e.levelRetry=!0,this.playlistError=0,{action:fr.SendAlternateToPenaltyBox,flags:pr.None,nextAutoLevel:t}}return{action:fr.SendAlternateToPenaltyBox,flags:pr.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch(null==(r=t.errorAction)?void 0:r.action){case fr.DoNothing:break;case fr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===m.FRAG_GAP||(t.fatal=!0);break}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:i,hdcpLevel:s,nextAutoLevel:n}=r;switch(i){case pr.None:this.switchLevel(e,n);break;case pr.MoveAllAlternatesMatchingHost:r.resolved||(r.resolved=this.redundantFailover(e));break;case pr.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=Nt[Nt.indexOf(s)-1],r.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}r.resolved||this.switchLevel(e,n)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:r}=this,i=e.parent===_t.MAIN?e.level:t.loadLevel,s=t.levels[i],n=s.url.length,a=e.frag?e.frag.urlId:s.urlId;s.urlId!==a||e.frag&&!s.details||this.penalizeRendition(s,e);for(let o=1;o{e.urlId=l}),t.nextLoadLevel=i,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:r}=this,i=r[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};i.lastErrorPerfMs=performance.now(),i.errors.push(t),i.details=e.details,r[e.urlId]=i}}function gr(e,t,r){if(performance.now()-e.lastErrorPerfMs>ur)return!0;const i=e.details;if(t.details===m.FRAG_GAP&&i&&t.frag){const e=t.frag.start,r=lr(null,i.fragments,e);if(r&&!r.gap)return!0}if(r&&e.errors.length3*i.targetduration)return!0}return!1}class yr{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=T.log.bind(T,t+":"),this.warn=T.warn.bind(T,t+":"),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const r=null==t?void 0:t.renditionReports;if(r){let s=-1;for(let n=0;n=0&&e>t.partTarget&&(n+=1)}return new $t(i,n>=0?n:void 0,Ut.No)}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,r){const{details:i,stats:s}=t,n=self.performance.now(),a=s.loading.first?Math.max(0,n-s.loading.first):0;if(i.advancedDateTime=Date.now()-a,i.live||null!=r&&r.live){if(i.reloaded(r),r&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),r&&i.fragments.length>0&&Vt(r,i),!this.canLoad||!i.live)return;let a,o=void 0,l=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){const e=this.hls.config.lowLatencyMode,s=i.lastPartSn,n=i.endSN,d=i.lastPartIndex,h=-1!==d,c=s===n,u=e?0:d;h?(o=c?n+1:s,l=c?u:d+1):o=n+1;const f=i.age,p=f+i.ageHeader;let m=Math.min(p-i.partTarget,1.5*i.targetduration);if(m>0){if(r&&m>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${m} with playlist age: ${i.age}`),m=0;else{const e=Math.floor(m/i.targetduration);if(o+=e,void 0!==l){const e=Math.round(m%i.targetduration/i.partTarget);l+=e}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${f.toFixed(2)}s goal: ${m} skip sn ${e} to part ${l}`)}i.tuneInGoal=m}if(a=this.getDeliveryDirectives(i,t.deliveryDirectives,o,l),e||!c)return void this.loadPlaylist(a)}else(i.canBlockReload||i.canSkipUntil)&&(a=this.getDeliveryDirectives(i,t.deliveryDirectives,o,l));const d=this.hls.mainForwardBufferInfo,h=d?d.end-d.len:0,c=1e3*(i.edge-h),u=Xt(i,c);i.updated&&n>this.requestScheduled+u&&(this.requestScheduled=s.loading.start),void 0!==o&&i.canBlockReload?this.requestScheduled=s.loading.first+u-(1e3*i.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+uthis.loadPlaylist(a),f)}else this.clearTimer()}getDeliveryDirectives(e,t,r,i){let s=Bt(e,r);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,i=t.part,s=Ut.No),new $t(r,i,s)}checkRetry(e){const t=e.details,r=er(e),i=e.errorAction,{action:s,retryCount:n=0,retryConfig:a}=i||{},o=!!i&&!!a&&(s===fr.RetryRequest||!i.resolved&&s===fr.SendAlternateToPenaltyBox);if(o){var l;if(this.requestScheduled=-1,n>=a.maxNumRetry)return!1;if(r&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=rr(a,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),e),this.warn(`Retrying playlist loading ${n+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,i.resolved=!0}return o}}let vr;class _r extends yr{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(f.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(f.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){const e=this._levels;e.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const r=[],i={};let s;t.levels.forEach(e=>{var t;const n=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(vr||(vr=/chrome|firefox/i.test(navigator.userAgent)),vr&&(e.audioCodec=void 0));const{AUDIO:a,CODECS:o,"FRAME-RATE":l,"PATHWAY-ID":d,RESOLUTION:h,SUBTITLES:c}=n,u=(d||".")+"-",f=`${u}${e.bitrate}-${h}-${l}-${o}`;s=i[f],s?s.addFallback(e):(s=new Gt(e),i[f]=s,r.push(s)),Er(s,"audio",a),Er(s,"text",c)}),this.filterAndSortMediaOptions(r,t)}filterAndSortMediaOptions(e,t){let r=[],i=[],s=!1,n=!1,a=!1,o=e.filter(({audioCodec:e,videoCodec:t,width:r,height:i,unknownCodecs:o})=>(s||(s=!(!r||!i)),n||(n=!!t),a||(a=!!e),!(null!=o&&o.length)&&(!e||it(e,"audio"))&&(!t||it(t,"video"))));if((s||n)&&a&&(o=o.filter(({videoCodec:e,width:t,height:r})=>!!e||!(!t||!r))),0===o.length)return void Promise.resolve().then(()=>{if(this.hls){const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}});t.audioTracks&&(r=t.audioTracks.filter(e=>!e.audioCodec||it(e.audioCodec,"audio")),br(r)),t.subtitles&&(i=t.subtitles,br(i));const l=o.slice(0);o.sort((e,t)=>e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):s&&e.height!==t.height?e.height-t.height:0);let d=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let u=0;u!!e.url)};this.hls.trigger(f.MANIFEST_PARSED,c),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const r=new Error("invalid level idx"),i=e<0;if(this.hls.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.LEVEL_SWITCH_ERROR,level:e,fatal:i,error:r,reason:r.message}),i)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,i=this.currentLevel,s=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],a=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,r===e&&n.details&&i&&s===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${r}${s?" with Pathway "+s:""}`);const o=d({},n,{level:e,maxBitrate:n.maxBitrate,attrs:n.attrs,uri:n.uri,urlId:n.urlId});delete o._attrs,delete o._urlId,this.hls.trigger(f.LEVEL_SWITCHING,o);const l=n.details;if(!l||l.live){const e=this.switchParams(n.uri,null==i?void 0:i.details);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===vt.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(void 0!==t&&t.type===_t.MAIN){const e=this._levels[t.level];void 0!==e&&(e.loadError=0)}}onLevelLoaded(e,t){var r;const{level:i,details:s}=t,n=this._levels[i];var a;if(!n)return this.warn("Invalid level index "+i),void(null!=(a=t.deliveryDirectives)&&a.skip&&(s.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===n.fragmentError&&(n.loadError=0),this.playlistLoaded(i,t,n.details)):null!=(r=t.deliveryDirectives)&&r.skip&&(s.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const r=this.currentLevel;if(!r)return;const i=this.hls.audioTracks[t.id].groupId;if(r.audioGroupIds&&r.audioGroupId!==i){let e=-1;for(let t=0;tr!==t,i=this._levels.filter((i,s)=>s!==e||(i.url.length>1&&void 0!==t?(i.url=i.url.filter(r),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(r)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(r)),i.urlId=0,!0):(this.steering&&this.steering.removeLevel(i),!1)));this.hls.trigger(f.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){t.forEach((e,t)=>{const{details:r}=e;null!=r&&r.fragments&&r.fragments.forEach(e=>{e.level=t})}),this._levels=t}}function Er(e,t,r){r&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=r):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=r))}function br(e){const t={};e.forEach(e=>{const r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++})}var Tr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Sr{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(f.BUFFER_APPENDED,this.onBufferAppended,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.BUFFER_APPENDED,this.onBufferAppended,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let i=r.length;i--;){const t=r[i];if(!t)break;const s=t.end;if(t.start<=e&&null!==s&&e<=s)return t}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:r}=this,i=Object.keys(r);for(let s=i.length;s--;){const n=r[i[s]];if((null==n?void 0:n.body.type)===t&&n.buffered){const t=n.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,r,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(null==i?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(i=>{const n=this.fragments[i];if(!n)return;if(s>=n.body.sn)return;if(!n.buffered&&!n.loaded)return void(n.body.type===r&&this.removeFragment(n.body));const a=n.range[e];a&&a.time.some(e=>{const r=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&this.removeFragment(n.body),r})})}detectPartialFragments(e){const t=this.timeRanges,{frag:r,part:i}=e;if(!t||"initSegment"===r.sn)return;const s=Ar(r),n=this.fragments[s];if(!n||n.buffered&&r.gap)return;const a=!r.relurl;if(Object.keys(t).forEach(e=>{const s=r.elementaryStreams[e];if(!s)return;const o=t[e],l=a||!0===s.partial;n.range[e]=this.getBufferedTimes(r,i,l,o)}),n.loaded=null,Object.keys(n.range).length){n.buffered=!0;const e=n.body.endList=r.endList||n.body.endList;e&&(this.endListFragments[n.body.type]=n),Lr(n)||this.removeParts(r.sn-1,r.type)}else this.removeFragment(n.body)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=r.filter(t=>t.fragment.sn>=e))}fragBuffered(e,t){const r=Ar(e);let i=this.fragments[r];!i&&t&&(i=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,r,i){const s={time:[],partial:r},n=e.start,a=e.end,o=e.minEndPTS||a,l=e.maxStartPTS||n;for(let d=0;d=e&&o<=t){s.time.push({startPTS:Math.max(n,i.start(d)),endPTS:Math.min(a,i.end(d))});break}if(ne)s.partial=!0,s.time.push({startPTS:Math.max(n,i.start(d)),endPTS:Math.min(a,i.end(d))});else if(a<=e)break}return s}getPartialFragment(e){let t,r,i,s=null,n=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach(l=>{const d=o[l];d&&Lr(d)&&(r=d.body.start-a,i=d.body.end+a,e>=r&&e<=i&&(t=Math.min(e-r,i-e),n<=t&&(s=d.body,n=t)))}),s}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||Lr(t))}getState(e){const t=Ar(e),r=this.fragments[t];return r?r.buffered?Lr(r)?Tr.PARTIAL:Tr.OK:Tr.APPENDING:Tr.NOT_LOADED}isTimeBuffered(e,t,r){let i,s;for(let n=0;n=i&&t<=s)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:r,part:i}=t;if("initSegment"===r.sn||r.bitrateTest)return;const s=i?null:t,n=Ar(r);this.fragments[n]={body:r,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:i,timeRanges:s}=t;if("initSegment"===r.sn)return;const n=r.type;if(i){let e=this.activePartLists[n];e||(this.activePartLists[n]=e=[]),e.push(i)}this.timeRanges=s,Object.keys(s).forEach(e=>{const t=s[e];this.detectEvictedFragments(e,t,n,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ar(e);return!!this.fragments[t]}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,r,i,s){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const a=this.fragments[n];if(!a)return;const o=a.body;o.type!==r||i&&!o.gap||o.starte&&(a.buffered||s)&&this.removeFragment(o)})}removeFragment(e){const t=Ar(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const t=e.sn;this.activePartLists[e.type]=r.filter(e=>e.fragment.sn!==t)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function Lr(e){var t,r,i;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(r=e.range.audio)?void 0:r.partial)||(null==(i=e.range.audiovideo)?void 0:i.partial))}function Ar(e){return`${e.type}_${e.level}_${e.urlId}_${e.sn}`}const wr=Math.pow(2,17);class Rr{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const r=e.url;if(!r)return Promise.reject(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(r?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,s=i.fLoader,n=i.loader;return new Promise((a,l)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some(e=>"GAP"===e[0]))return void l(Ir(e));e.gap=!1}const d=this.loader=e.loader=s?new s(i):new n(i),h=kr(e),c=ir(i.fragLoadPolicy.default),u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:wr};e.stats=d.stats,d.load(h,u,{onSuccess:(t,r,i,s)=>{this.resetLoader(e,d);let n=t.data;i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(n.slice(0,16)),n=n.slice(16)),a({frag:e,part:null,payload:n,networkDetails:s})},onError:(t,i,s,n)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:o({url:r,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:s,stats:n}))},onAbort:(t,r,i)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:(t,r,i)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:i,stats:t}))},onProgress:(r,i,s,n)=>{t&&t({frag:e,part:null,payload:s,networkDetails:n})}})})}loadPart(e,t,r){this.abort();const i=this.config,s=i.fLoader,n=i.loader;return new Promise((a,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void l(Ir(e,t));const d=this.loader=e.loader=s?new s(i):new n(i),h=kr(e,t),c=ir(i.fragLoadPolicy.default),u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:wr};t.stats=d.stats,d.load(h,u,{onSuccess:(i,s,n,o)=>{this.resetLoader(e,d),this.updateStatsFromPart(e,t);const l={frag:e,part:t,payload:i.data,networkDetails:o};r(l),a(l)},onError:(r,i,s,n)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:o({url:h.url,data:void 0},r),error:new Error(`HTTP Error ${r.code} ${r.text}`),networkDetails:s,stats:n}))},onAbort:(r,i,s)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:s,stats:r}))},onTimeout:(r,i,s)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:s,stats:r}))}})})}updateStatsFromPart(e,t){const r=e.stats,i=t.stats,s=i.total;if(r.loaded+=i.loaded,s){const i=Math.round(e.duration/t.duration),n=Math.min(Math.round(r.loaded/s),i),a=i-n,o=a*Math.round(r.loaded/n);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);const n=r.loading,a=i.loading;n.start?n.first+=a.first-a.start:(n.start=a.start,n.first=a.first),n.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function kr(e,t=null){const r=t||e,i={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},s=r.byteRangeStartOffset,n=r.byteRangeEndOffset;if(u(s)&&u(n)){var a;let t=s,r=n;if("initSegment"===e.sn&&"AES-128"===(null==(a=e.decryptdata)?void 0:a.method)){const e=n-s;e%16&&(r=n+(16-e%16)),0!==s&&(i.resetIV=!0,t=s-16)}i.rangeStart=t,i.rangeEnd=r}return i}function Ir(e,t){const r=new Error(`GAP ${e.gap?"tag":"attribute"} found`),i={type:p.MEDIA_ERROR,details:m.FRAG_GAP,fatal:!1,frag:e,error:r,networkDetails:null};return t&&(i.part=t),(t||e).stats.aborted=!0,new Dr(i)}class Dr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class xr{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const t in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[t].loader;if(r){if(e&&e!==r.context.frag.type)return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=m.KEY_LOAD_ERROR,r,i,s){return new Dr({type:p.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:r,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:r,cc:i}=e;for(let e=0;e{s.setKeyFormat(e)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,i;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const r=new Error(t?"Expected frag.decryptdata to be defined after setting format "+t:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,r))}const n=s.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));let a=this.keyUriToKeyInfo[n];if(null!=(r=a)&&r.decryptdata.key)return s.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});var o;if(null!=(i=a)&&i.keyLoadPromise)switch(null==(o=a.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(t=>(s.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}switch(a=this.keyUriToKeyInfo[n]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===s.keyFormat?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(r);if(t)return(e.keyLoadPromise=t.then(t=>(e.mediaKeySessionContext=t,r))).catch(t=>{throw e.keyLoadPromise=null,t})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,i=r.loader,s=new i(r);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((i,n)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=r.keyLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(e,t,r,s)=>{const{frag:a,keyInfo:o,url:l}=r;if(!a.decryptdata||o!==this.keyUriToKeyInfo[l])return n(this.createKeyLoadError(a,m.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),s));o.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,o.loader=null,i({frag:a,keyInfo:o})},onError:(e,r,i,s)=>{this.resetLoader(r),n(this.createKeyLoadError(t,m.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),i,o({url:a.url,data:void 0},e)))},onTimeout:(e,r,i)=>{this.resetLoader(r),n(this.createKeyLoadError(t,m.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),i))},onAbort:(e,r,i)=>{this.resetLoader(r),n(this.createKeyLoadError(t,m.INTERNAL_ABORTED,new Error("key loading aborted"),i))}};s.load(a,d,h)})}resetLoader(e){const{frag:t,keyInfo:r,url:i}=e,s=r.loader;t.keyLoader===s&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[i],s&&s.destroy()}}class Cr{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const Pr={length:0,start:()=>0,end:()=>0};class Or{static isBuffered(e,t){try{if(e){const r=Or.getBuffered(e);for(let e=0;e=r.start(e)&&t<=r.end(e))return!0}}catch(r){}return!1}static bufferInfo(e,t,r){try{if(e){const i=Or.getBuffered(e),s=[];let n;for(n=0;ns&&(i[t-1].end=e[l].end):i.push(e[l])}else i.push(e[l])}else i=e;let s,n=0,a=t,o=t;for(let l=0;l=e&&tr.startCC||e&&e.cc>>8^255&r^99,e[f]=r,t[r]=f;const o=u[f],m=u[o],g=u[m];let y=257*u[r]^16843008*r;i[f]=y<<24|y>>>8,s[f]=y<<16|y>>>16,n[f]=y<<8|y>>>24,a[f]=y,y=16843009*g^65537*m^257*o^16843008*f,l[r]=y<<24|y>>>8,d[r]=y<<16|y>>>16,h[r]=y<<8|y>>>24,c[r]=y,f?(f=o^u[u[u[g^o]]],p^=u[u[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,i=0;while(i{if(!i)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");const s=new Yr(i,new Uint8Array(r));return s.decrypt(e.buffer,t)}).catch(i=>(T.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,r)))}onWebCryptoError(e,t,r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%Xr;return r!==e.length&&(t=Q(e,0,r),this.remainderData=Q(e,r)),t}logOnce(e){this.logEnabled&&(T.log("[decrypter]: "+e),this.logEnabled=!1)}}const Zr={toString:function(e){let t="";const r=e.length;for(let i=0;ia.end){const e=n>s;(n{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)};this._doFragLoad(e,t,r,i).then(t=>{if(!t)return;const r=this.state;this.fragContextChanged(e)?(r===Jr.FRAG_LOADING||!this.fragCurrent&&r===Jr.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=Jr.IDLE):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(f.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))}).catch(t=>{this.state!==Jr.STOPPED&&this.state!==Jr.ERROR&&(this.warn(t),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this,i=r.getState(e);if(i===Tr.APPENDING){const t=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,t),s=Math.max(e.duration,i?i.len:this.config.maxBufferLength);this.reduceMaxBufferLength(s)&&r.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===Tr.PARTIAL&&r.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,r=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:r};this.hls.trigger(f.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t}).then(t=>{const{hls:r}=this,{payload:i}=t,s=e.decryptdata;if(i&&i.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){const n=self.performance.now();return this.decrypter.decrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer).catch(t=>{throw r.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t}).then(i=>{const s=self.performance.now();return r.trigger(f.FRAG_DECRYPTED,{frag:e,payload:i,stats:{tstart:n,tdecrypt:s}}),t.payload=i,t})}return t}).then(r=>{const{fragCurrent:i,hls:s,levels:n}=this;if(!n)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=Jr.IDLE,t.fragmentError=0,e.data=new Uint8Array(r.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),r.frag===i&&s.trigger(f.FRAG_BUFFERED,{stats:a,frag:i,part:null,id:e.type}),this.tick()}).catch(t=>{this.state!==Jr.STOPPED&&this.state!==Jr.ERROR&&(this.warn(t),this.resetFragmentLoading(e))})}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var r,i,s,n;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===_t.MAIN?"level":"track"} ${e.level} (frag:[${(null!=(r=e.startPTS)?r:NaN).toFixed(3)}-${(null!=(i=e.endPTS)?i:NaN).toFixed(3)}] > buffer:${a?Zr.toString(Or.getBuffered(a)):"(detached)"})`),this.state=Jr.IDLE,a&&(!this.loadedmetadata&&e.type==_t.MAIN&&a.buffered.length&&(null==(s=this.fragCurrent)?void 0:s.sn)===(null==(n=this.fragPrevious)?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:i,partsLoaded:s}=e,n=!s||0===s.length||s.some(e=>!e),a=new Mr(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,i){var s;const n=null==t?void 0:t.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let a=null;if(!e.encrypted||null!=(s=e.decryptdata)&&s.key?!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=Jr.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(f.KEY_LOADED,e),this.state===Jr.KEY_LOADING&&(this.state=Jr.IDLE),e}),this.hls.trigger(f.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),r=Math.max(e.start,r||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){const s=n.partList;if(s&&i){r>e.end&&n.fragmentHint&&(e=n.fragmentHint);const o=this.getNextPart(s,e,r);if(o>-1){const l=s[o];let d;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${n.startSN}-${n.endSN}] parts [0-${o}-${s.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Jr.FRAG_LOADING,d=a?a.then(r=>!r||this.fragContextChanged(r.frag)?null:this.doFragPartsLoad(e,l,t,i)).catch(e=>this.handleFragLoadError(e)):this.doFragPartsLoad(e,l,t,i).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(f.FRAG_LOADING,{frag:e,part:l,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}if(!e.url||this.loadedEndOfParts(s,r))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${n?"of ["+n.startSN+"-"+n.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(r.toFixed(3))}`),u(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Jr.FRAG_LOADING;const o=this.config.progressive;let l;return l=o&&a?a.then(t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,i)).catch(e=>this.handleFragLoadError(e)):Promise.all([this.fragmentLoader.load(e,o?i:void 0),a]).then(([e])=>(!o&&e&&i&&i(e),e)).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(f.FRAG_LOADING,{frag:e,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,r,i){return new Promise((s,n)=>{var a;const o=[],l=null==(a=r.details)?void 0:a.partList,d=t=>{this.fragmentLoader.loadPart(e,t,i).then(i=>{o[t.index]=i;const n=i.part;this.hls.trigger(f.FRAG_LOADED,i);const a=Zt(r,e.sn,t.index+1)||Jt(l,e.sn,t.index+1);if(!a)return s({frag:e,part:n,partsLoaded:o});d(a)}).catch(n)};d(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===m.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(f.ERROR,t)}else this.hls.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Jr.PARSING)return void(this.fragCurrent||this.state===Jr.STOPPED||this.state===Jr.ERROR||(this.state=Jr.IDLE));const{frag:r,part:i,level:s}=t,n=self.performance.now();r.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(r,i,s,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:i,sn:s,part:n}=e;if(null==t||!t[i])return this.warn(`Levels object was unset while buffering fragment ${s} of level ${i}. The current chunk will not be buffered.`),null;const a=t[i],o=n>-1?Zt(a,s,n):null,l=o?o.fragment:Qt(a,s,r);return l?(r&&r!==l&&(l.stats=r.stats),{frag:l,part:o,level:a}):null}bufferFragmentData(e,t,r,i,s){var n;if(!e||this.state!==Jr.PARSING)return;const{data1:a,data2:o}=e;let l=a;if(a&&o&&(l=Oe(a,o)),null==(n=l)||!n.length)return;const d={type:e.type,frag:t,part:r,chunkMeta:i,parent:t.type,data:l};if(this.hls.trigger(f.BUFFER_APPENDING,d),e.dropped&&e.independent&&!r){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Or.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const r=t.currentTime,i=Or.bufferInfo(t,r,0),s=e.duration,n=Math.min(2*this.config.maxFragLookUpTolerance,.25*s),a=Math.max(Math.min(e.start-n,i.end-n),r+n);e.start-a>n&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const r=this.getLoadPosition();return u(r)?this.getFwdBufferInfoAtPos(e,r,t):null}getFwdBufferInfoAtPos(e,t,r){const{config:{maxBufferHole:i}}=this,s=Or.bufferInfo(e,t,i);if(0===s.len&&void 0!==s.nextStart){const n=this.fragmentTracker.getBufferedFrag(t,r);if(n&&s.nextStart=r&&(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0)}getAppendedFrag(e,t=_t.MAIN){const r=this.fragmentTracker.getAppendedFrag(e,_t.MAIN);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,i=r.length;if(!i)return null;const{config:s}=this,n=r[0].start;let a;if(t.live){const n=s.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,r,i,s){const n=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(null===a)return a;if(e=a,n&&e&&!e.gap&&r.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,i);if(null!==t&&r.len+t.len>=s)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,r){let i=-1,s=!1,n=!0;for(let a=0,o=e.length;a-1&&rr.start&&r.loaded}getInitialLiveFragment(e,t){const r=this.fragPrevious;let i=null;if(r){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),i=or(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const s=r.sn+1;if(s>=e.startSN&&s<=e.endSN){const n=t[s-e.startSN];r.cc===n.cc&&(i=n,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=cr(t,r.cc),i&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn))}}else{const t=this.hls.liveSyncPosition;null!==t&&(i=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,r){const{config:i}=this;let{fragPrevious:s}=this,{fragments:n,endSN:a}=r;const{fragmentHint:o}=r,l=i.maxFragLookUpTolerance,d=r.partList,h=!!(i.lowLatencyMode&&null!=d&&d.length&&o);let c;if(h&&o&&!this.bitrateTest&&(n=n.concat(o),a=o.sn),et-l?0:l;c=lr(s,n,e,r)}else c=n[n.length-1];if(c){const e=c.sn-r.startSN,t=this.fragmentTracker.getState(c);if((t===Tr.OK||t===Tr.PARTIAL&&c.gap)&&(s=c),s&&c.sn===s.sn&&(!h||d[0].fragment.sn>c.sn)){const t=s&&c.level===s.level;if(t){const t=n[e+1];c=c.sn=n-t.maxFragLookUpTolerance&&s<=a;if(null!==i&&r.duration>i&&(s${e.startSN} prev-sn: ${s?s.sn:"na"} fragments: ${a}`),r}return o}waitForCdnTuneIn(e){const t=3;return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*t)}setStartPosition(e,t){let r=this.startPosition;if(r ${null==(i=this.fragCurrent)?void 0:i.url}`);const s=t.details===m.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(r,!0);const n=t.errorAction,{action:a,retryCount:o=0,retryConfig:l}=n||{};if(n&&a===fr.RetryRequest&&l){var d;this.resetStartWhenNotLoaded(null!=(d=this.levelLastLoaded)?d:r.level);const i=rr(l,o);this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${o+1}/${l.maxNumRetry} in ${i}ms`),n.resolved=!0,this.retryDate=self.performance.now()+i,this.state=Jr.FRAG_LOADING_WAITING_RETRY}else l&&n?(this.resetFragmentErrors(e),o.5;i&&this.reduceMaxBufferLength(r.len);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===_t.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Jr.STOPPED&&(this.state=Jr.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const i=Or.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,r),this.state===Jr.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Jr.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){var t;this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(null!=(t=this.levelLastLoaded)?t:e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,i){var s;const n=r.details;if(!n)return void this.warn("level.details undefined");const a=Object.keys(e.elementaryStreams).reduce((t,s)=>{const a=e.elementaryStreams[s];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${s} duration reliably (${o})`),t||!1;const l=i?0:Kt(n,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return this.hls.trigger(f.LEVEL_PTS_UPDATED,{details:n,level:r,drift:l,type:s,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t},!1);if(a)r.fragmentError=0;else if(null===(null==(s=this.transmuxer)?void 0:s.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(0===r.fragmentError&&(r.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(t.message),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Jr.PARSED,this.hls.trigger(f.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){var t,r,i;"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(null!=(t=null!=(r=this.levelLastLoaded)?r:null==(i=this.fragCurrent)?void 0:i.level)?t:0),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function ti(){return self.SourceBuffer||self.WebKitSourceBuffer}function ri(){const e=Je();if(!e)return!1;const t=ti(),r=e&&"function"===typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!t||t.prototype&&"function"===typeof t.prototype.appendBuffer&&"function"===typeof t.prototype.remove;return!!r&&!!i}function ii(){var e;const t=ti();return"function"===typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}function si(){return"function"===typeof __HLS_WORKER_BUNDLE__}function ni(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),r=new self.Worker(t);return{worker:r,objectURL:t}}function ai(e){const t=new self.URL(e,self.location.href).href,r=new self.Worker(t);return{worker:r,scriptURL:t}}function oi(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class li{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,r,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=Oe(this.cachedData,e),this.cachedData=null);let r,i=ee(e,0),s=i?i.length:0;const n=this._audioTrack,a=this._id3Track,o=i?ie(i):void 0,l=e.length;(null===this.basePTS||0===this.frameIndex&&u(o))&&(this.basePTS=di(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),i&&i.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:It.audioId3,duration:Number.POSITIVE_INFINITY});while(s{if(u(e))return 90*e;const i=r?9e4*r.baseTime/r.timescale:0;return 9e4*t+i};function hi(e,t,r,i){let s,n,a,o;const l=navigator.userAgent.toLowerCase(),d=i,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&t[r+2])>>>6);const c=(60&t[r+2])>>>2;if(!(c>h.length-1))return a=(1&t[r+2])<<2,a|=(192&t[r+3])>>>6,T.log(`manifest codec:${i}, ADTS type:${s}, samplingIndex:${c}`),/firefox/i.test(l)?c>=6?(s=5,o=new Array(4),n=c-3):(s=2,o=new Array(2),n=c):-1!==l.indexOf("android")?(s=2,o=new Array(2),n=c):(s=5,o=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&c>=6?n=c-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(c>=6&&1===a||/vivaldi/i.test(l))||!i&&1===a)&&(s=2,o=new Array(2)),n=c)),o[0]=s<<3,o[0]|=(14&c)>>1,o[1]|=(1&c)<<7,o[1]|=a<<3,5===s&&(o[1]|=(14&n)>>1,o[2]=(1&n)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[c],channelCount:a,codec:"mp4a.40."+s,manifestCodec:d};e.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+c})}function ci(e,t){return 255===e[t]&&240===(246&e[t+1])}function ui(e,t){return 1&e[t+1]?7:9}function fi(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function pi(e,t){return t+5=e.length)return!1;const i=fi(e,t);if(i<=r)return!1;const s=t+i;return s===e.length||mi(e,s)}return!1}function vi(e,t,r,i,s){if(!e.samplerate){const n=hi(t,r,i,s);if(!n)return;e.config=n.config,e.samplerate=n.samplerate,e.channelCount=n.channelCount,e.codec=n.codec,e.manifestCodec=n.manifestCodec,T.log(`parsed codec:${e.codec}, rate:${n.samplerate}, channels:${n.channelCount}`)}}function _i(e){return 9216e4/e}function Ei(e,t){const r=ui(e,t);if(t+r<=e.length){const i=fi(e,t)-r;if(i>0)return{headerLength:r,frameLength:i}}}function bi(e,t,r,i,s){const n=_i(e.samplerate),a=i+s*n,o=Ei(t,r);let l;if(o){const{frameLength:i,headerLength:s}=o,n=s+i,d=Math.max(0,r+n-t.length);d?(l=new Uint8Array(n-s),l.set(t.subarray(r+s,t.length),0)):l=t.subarray(r+s,r+n);const h={unit:l,pts:a};return d||e.samples.push(h),{sample:h,length:n,missing:d}}const d=t.length-r;l=new Uint8Array(d),l.set(t.subarray(r,t.length),0);const h={unit:l,pts:a};return{sample:h,length:d,missing:-1}}class Ti extends li{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ee(e,0)||[];let r=t.length;for(let i=e.length;r16384?e.subarray(0,16384):e,Le(e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let r=e;const i=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Oe(this.remainderData,e));const t=Pe(r);this.remainderData=t.remainder,i.samples=t.valid||new Uint8Array}else i.samples=r;const n=this.extractID3Track(i,t);return s.samples=Me(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:n,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return r.samples=Me(e,t),{videoTrack:t,audioTrack:oi(),id3Track:i,textTrack:oi()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const i=Le(e.samples,["emsg"]);i&&i.forEach(e=>{const i=$e(e);if(Si.test(i.schemeIdUri)){const e=u(i.presentationTime)?i.presentationTime/i.timeScale:t+i.presentationTimeDelta/i.timeScale;let s=4294967295===i.eventDuration?Number.POSITIVE_INFINITY:i.eventDuration/i.timeScale;s<=.001&&(s=Number.POSITIVE_INFINITY);const n=i.payload;r.samples.push({data:n,len:n.byteLength,dts:e,pts:e,type:It.emsg,duration:s})}})}return r}demuxSampleAes(e,t,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let Ai=null;const wi=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ri=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ki=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ii=[0,1,1,4];function Di(e,t,r,i,s){if(r+24>t.length)return;const n=xi(t,r);if(n&&r+n.frameLength<=t.length){const a=9e4*n.samplesPerFrame/n.sampleRate,o=i+s*a,l={unit:t.subarray(r,r+n.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=n.channelCount,e.samplerate=n.sampleRate,e.samples.push(l),{sample:l,length:n.frameLength,missing:0}}}function xi(e,t){const r=e[t+1]>>3&3,i=e[t+1]>>1&3,s=e[t+2]>>4&15,n=e[t+2]>>2&3;if(1!==r&&0!==s&&15!==s&&3!==n){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=3===r?3-i:3===i?3:4,d=1e3*wi[14*l+s-1],h=3===r?0:2===r?1:2,c=Ri[3*h+n],u=3===o?1:2,f=ki[r][i],p=Ii[i],m=8*f*p,g=Math.floor(f*d/c+a)*p;if(null===Ai){const e=navigator.userAgent||"",t=e.match(/Chrome\/(\d+)/i);Ai=t?parseInt(t[1]):0}const y=!!Ai&&Ai<=87;return y&&2===i&&d>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:g,samplesPerFrame:m}}}function Ci(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])}function Pi(e,t){return t+1e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const r=this.word>>>32-t;if(e>32&&T.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,r=8,i=8;for(let s=0;s{const n=new Uint8Array(s);i.set(n,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)})}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t);let i=0;for(let s=32;s{s.data=this.getAvcDecryptedUnit(n,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,i)})}decryptAvcSamples(e,t,r,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length)return void i();const s=e[t].units;for(;;r++){if(r>=s.length)break;const n=s[r];if(!(n.data.length<=48||1!==n.type&&5!==n.type)&&(this.decryptAvcSample(e,t,r,i,n),!this.decrypter.isSync()))return}}}}const Ui=188;class Bi{constructor(e,t,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=r}static probe(e){const t=Bi.syncOffset(e);return t>0&&T.warn("MPEG2-TS detected but first sync word found @ offset "+t),-1!==t}static syncOffset(e){const t=e.length;let r=Math.min(5*Ui,e.length-Ui)+1,i=0;while(i1&&(0===n&&a>2||o+Ui>r))return n}i++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:ve[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,r,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=Bi.createTrack("video"),this._audioTrack=Bi.createTrack("audio",i),this._id3Track=Bi.createTrack("id3"),this._txtTrack=Bi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,r=!1,i=!1){let s;r||(this.sampleAes=null);const n=this._avcTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let d=n.pid,h=n.pesData,c=a.pid,u=o.pid,g=a.pesData,y=o.pesData,v=null,_=this.pmtParsed,E=this._pmtId,b=e.length;if(this.remainderData&&(e=Oe(this.remainderData,e),b=e.length,this.remainderData=null),b>4;let m;if(p>1){if(m=f+5+e[f+4],m===f+Ui)continue}else m=f+4;switch(i){case d:t&&(h&&(s=Vi(h))&&this.parseAVCPES(n,l,s,!1),h={data:[],size:0}),h&&(h.data.push(e.subarray(m,f+Ui)),h.size+=f+Ui-m);break;case c:if(t){if(g&&(s=Vi(g)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,s);break;case"mp3":this.parseMPEGPES(a,s);break}g={data:[],size:0}}g&&(g.data.push(e.subarray(m,f+Ui)),g.size+=f+Ui-m);break;case u:t&&(y&&(s=Vi(y))&&this.parseID3PES(o,s),y={data:[],size:0}),y&&(y.data.push(e.subarray(m,f+Ui)),y.size+=f+Ui-m);break;case 0:t&&(m+=e[m]+1),E=this._pmtId=ji(e,m);break;case E:{t&&(m+=e[m]+1);const i=Ki(e,m,this.typeSupported,r);d=i.avc,d>0&&(n.pid=d),c=i.audio,c>0&&(a.pid=c,a.segmentCodec=i.segmentCodec),u=i.id3,u>0&&(o.pid=u),null===v||_||(T.warn(`MPEG-TS PMT found at ${f} after unknown PID '${v}'. Backtracking to sync byte @${S} to parse all TS packets.`),v=null,f=S-188),_=this.pmtParsed=!0;break}case 17:case 8191:break;default:v=i;break}}else L++;if(L>0){const e=new Error(`Found ${L} TS packet/s that do not start with 0x47`);this.observer.emit(f.ERROR,f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message})}n.pesData=h,a.pesData=g,o.pesData=y;const A={audioTrack:a,videoTrack:n,id3Track:o,textTrack:l};return i&&this.extractRemainingSamples(A),A}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:i,textTrack:s}=e,n=r.pesData,a=t.pesData,o=i.pesData;let l;if(n&&(l=Vi(n))?(this.parseAVCPES(r,s,l,!0),r.pesData=null):r.pesData=n,a&&(l=Vi(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break}t.pesData=null}else null!=a&&a.size&&T.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=Vi(o))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=o}demuxSampleAes(e,t,r){const i=this.demux(e,r,!0,!this.config.progressive),s=this.sampleAes=new Ni(this.observer,this.config,t);return this.decrypt(i,s)}decrypt(e,t){return new Promise(r=>{const{audioTrack:i,videoTrack:s}=e;i.samples&&"aac"===i.segmentCodec?t.decryptAacSamples(i.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{r(e)}):r(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{r(e)})})}destroy(){this._duration=0}parseAVCPES(e,t,r,i){const s=this.parseAVCNALu(e,r.data);let n,a=this.avcSample,o=!1;r.data=null,a&&s.length&&!e.audFound&&(Hi(a,e),a=this.avcSample=$i(!1,r.pts,r.dts,"")),s.forEach(i=>{var s;switch(i.type){case 1:{let t=!1;n=!0;const s=i.data;if(o&&s.length>4){const e=new Fi(s).readSliceType();2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var l;if(t)null!=(l=a)&&l.frame&&!a.key&&(Hi(a,e),a=this.avcSample=null);a||(a=this.avcSample=$i(!0,r.pts,r.dts,"")),a.frame=!0,a.key=t;break}case 5:n=!0,null!=(s=a)&&s.frame&&!a.key&&(Hi(a,e),a=this.avcSample=null),a||(a=this.avcSample=$i(!0,r.pts,r.dts,"")),a.key=!0,a.frame=!0;break;case 6:n=!0,Ue(i.data,1,r.pts,t.samples);break;case 7:if(n=!0,o=!0,!e.sps){const t=i.data,r=new Fi(t),s=r.readSPS();e.width=s.width,e.height=s.height,e.pixelRatio=s.pixelRatio,e.sps=[t],e.duration=this._duration;const n=t.subarray(1,4);let a="avc1.";for(let e=0;e<3;e++){let t=n[e].toString(16);t.length<2&&(t="0"+t),a+=t}e.codec=a}break;case 8:n=!0,e.pps||(e.pps=[i.data]);break;case 9:n=!1,e.audFound=!0,a&&Hi(a,e),a=this.avcSample=$i(!1,r.pts,r.dts,"");break;case 12:n=!0;break;default:n=!1,a&&(a.debug+="unknown NAL "+i.type+" ");break}if(a&&n){const e=a.units;e.push(i)}}),i&&a&&(Hi(a,e),this.avcSample=null)}getLastNalUnit(e){var t;let r,i=this.avcSample;if(i&&0!==i.units.length||(i=e[e.length-1]),null!=(t=i)&&t.units){const e=i.units;r=e[e.length-1]}return r}parseAVCNALu(e,t){const r=t.byteLength;let i=e.naluState||0;const s=i,n=[];let a,o,l,d=0,h=-1,c=0;-1===i&&(h=0,c=31&t[0],i=0,d=1);while(d=0){const e={data:t.subarray(h,d-i-1),type:c};n.push(e)}else{const r=this.getLastNalUnit(e.samples);if(r&&(s&&d<=4-s&&r.state&&(r.data=r.data.subarray(0,r.data.byteLength-s)),o=d-i-1,o>0)){const e=new Uint8Array(r.data.byteLength+o);e.set(r.data,0),e.set(t.subarray(0,o),r.data.byteLength),r.data=e,r.state=0}}d=0&&i>=0){const e={data:t.subarray(h,r),type:c,state:i};n.push(e)}if(0===n.length){const r=this.getLastNalUnit(e.samples);if(r){const e=new Uint8Array(r.data.byteLength+t.byteLength);e.set(r.data,0),e.set(t,r.data.byteLength),r.data=e}}return e.naluState=i,n}parseAACPES(e,t){let r=0;const i=this.aacOverFlow;let s,n,a,o=t.data;if(i){this.aacOverFlow=null;const t=i.missing,s=i.sample.unit.byteLength;if(-1===t){const e=new Uint8Array(s+o.byteLength);e.set(i.sample.unit,0),e.set(o,s),o=e}else{const n=s-t;i.sample.unit.set(o.subarray(0,t),n),e.samples.push(i.sample),r=i.missing}}for(s=r,n=o.length;s1){const e=new Uint8Array(o[0].length+o[1].length);e.set(o[0]),e.set(o[1],o[0].length),o[0]=e,o.splice(1,1)}t=o[0];const l=(t[0]<<16)+(t[1]<<8)+t[2];if(1===l){if(r=(t[4]<<8)+t[5],r&&r>e.size-6)return null;const l=t[7];192&l&&(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(n=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,s-n>54e5&&(T.warn(Math.round((s-n)/9e4)+"s delta between PTS and DTS, align them"),s=n)):n=s),i=t[8];let d=i+9;if(e.size<=d)return null;e.size-=d;const h=new Uint8Array(e.size);for(let e=0,r=o.length;er){d-=r;continue}t=t.subarray(d),r-=d,d=0}h.set(t,a),a+=r}return r&&(r-=i+3),{data:h,pts:s,dts:n,len:r}}return null}function Hi(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const r=t.samples,i=r.length;if(!i)return void t.dropped++;{const t=r[i-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&T.log(e.pts+"/"+e.dts+":"+e.debug)}class Yi extends li{resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ee(e,0)||[];let r=t.length;for(let i=e.length;r>24&255,n[1]=r>>16&255,n[2]=r>>8&255,n[3]=255&r,n.set(e,4),i=0,r=8;i>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}static mdia(e){return qi.box(qi.types.mdia,qi.mdhd(e.timescale,e.duration),qi.hdlr(e.type),qi.minf(e))}static mfhd(e){return qi.box(qi.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?qi.box(qi.types.minf,qi.box(qi.types.smhd,qi.SMHD),qi.DINF,qi.stbl(e)):qi.box(qi.types.minf,qi.box(qi.types.vmhd,qi.VMHD),qi.DINF,qi.stbl(e))}static moof(e,t,r){return qi.box(qi.types.moof,qi.mfhd(e),qi.traf(r,t))}static moov(e){let t=e.length;const r=[];while(t--)r[t]=qi.trak(e[t]);return qi.box.apply(null,[qi.types.moov,qi.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(qi.mvex(e)))}static mvex(e){let t=e.length;const r=[];while(t--)r[t]=qi.trex(e[t]);return qi.box.apply(null,[qi.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(Wi+1)),i=Math.floor(t%(Wi+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return qi.box(qi.types.mvhd,s)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let i,s;for(i=0;i>>8&255),s.push(255&i),s=s.concat(Array.prototype.slice.call(r));for(t=0;t>>8&255),n.push(255&i),n=n.concat(Array.prototype.slice.call(r));const a=qi.box(qi.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(n))),o=e.width,l=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return qi.box(qi.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,qi.box(qi.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),qi.box(qi.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,h>>24,h>>16&255,h>>8&255,255&h])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return qi.box(qi.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),qi.box(qi.types.esds,qi.esds(e)))}static mp3(e){const t=e.samplerate;return qi.box(qi.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?qi.box(qi.types.stsd,qi.STSD,qi.mp3(e)):qi.box(qi.types.stsd,qi.STSD,qi.mp4a(e)):qi.box(qi.types.stsd,qi.STSD,qi.avc1(e))}static tkhd(e){const t=e.id,r=e.duration*e.timescale,i=e.width,s=e.height,n=Math.floor(r/(Wi+1)),a=Math.floor(r%(Wi+1));return qi.box(qi.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,s>>8&255,255&s,0,0]))}static traf(e,t){const r=qi.sdtp(e),i=e.id,s=Math.floor(t/(Wi+1)),n=Math.floor(t%(Wi+1));return qi.box(qi.types.traf,qi.box(qi.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),qi.box(qi.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,n>>24,n>>16&255,n>>8&255,255&n])),qi.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,qi.box(qi.types.trak,qi.tkhd(e),qi.mdia(e))}static trex(e){const t=e.id;return qi.box(qi.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const r=e.samples||[],i=r.length,s=12+16*i,n=new Uint8Array(s);let a,o,l,d,h,c;for(t+=8+s,n.set(["video"===e.type?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,61440&h.degradPrio,15&h.degradPrio,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*a);return qi.box(qi.types.trun,n)}static initSegment(e){qi.types||qi.init();const t=qi.moov(e),r=new Uint8Array(qi.FTYP.byteLength+t.byteLength);return r.set(qi.FTYP),r.set(t,qi.FTYP.byteLength),r}}qi.types=void 0,qi.HDLR_TYPES=void 0,qi.STTS=void 0,qi.STSC=void 0,qi.STCO=void 0,qi.STSZ=void 0,qi.VMHD=void 0,qi.SMHD=void 0,qi.STSD=void 0,qi.FTYP=void 0,qi.DINF=void 0;const Xi=9e4;function Qi(e,t,r=1,i=!1){const s=e*t*r;return i?Math.round(s):s}function Zi(e,t,r=1,i=!1){return Qi(e,t,1/r,i)}function Ji(e,t=!1){return Qi(e,1e3,1/Xi,t)}function es(e,t=1){return Qi(e,Xi,1/t)}const ts=1e4,rs=1024,is=1152;let ss,ns=null,as=null;class os{constructor(e,t,r,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===ns){const e=navigator.userAgent||"",t=e.match(/Chrome\/(\d+)/i);ns=t?parseInt(t[1]):0}if(null===as){const e=navigator.userAgent.match(/Safari\/(\d+)/i);as=e?parseInt(e[1]):0}}destroy(){}resetTimeStamp(e){T.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){T.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){T.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const r=e.reduce((e,r)=>{const i=r.pts-e;return i<-4294967296?(t=!0,ls(e,r.pts)):i>0?e:r.pts},e[0].pts);return t&&T.debug("PTS rollover detected"),r}remux(e,t,r,i,s,n,a,o){let l,d,h,c,u,f,p=s,m=s;const g=e.pid>-1,y=t.pid>-1,v=t.samples.length,_=e.samples.length>0,E=a&&v>0||v>1,b=(!g||_)&&(!y||E)||this.ISGenerated||a;if(b){this.ISGenerated||(h=this.generateIS(e,t,s,n));const r=this.isVideoContiguous;let i,a=-1;if(E&&(a=ds(t.samples),!r&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,a>0){T.warn(`[mp4-remuxer]: Dropped ${a} out of ${v} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,m+=(t.samples[0].pts-e)/t.inputTimeScale,i=m}else-1===a&&(T.warn(`[mp4-remuxer]: No keyframe found out of ${v} video samples`),f=!1);if(this.ISGenerated){if(_&&E){const r=this.getVideoStartPts(t.samples),i=ls(e.samples[0].pts,r)-r,s=i/t.inputTimeScale;p+=Math.max(0,s),m+=Math.max(0,-s)}if(_){if(e.samplerate||(T.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(e,t,s,n)),d=this.remuxAudio(e,p,this.isAudioContiguous,n,y||E||o===_t.AUDIO?m:void 0),E){const i=d?d.endPTS-d.startPTS:0;t.inputTimeScale||(T.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(e,t,s,n)),l=this.remuxVideo(t,m,r,i)}}else E&&(l=this.remuxVideo(t,m,r,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=i)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(u=hs(r,s,this._initPTS,this._initDTS)),i.samples.length&&(c=cs(i,s,this._initPTS))),{audio:d,video:l,initSegment:h,independent:f,text:c,id3:u}}generateIS(e,t,r,i){const s=e.samples,n=t.samples,a=this.typeSupported,o={},l=this._initPTS;let d,h,c,u=!l||i,f="audio/mp4";if(u&&(d=h=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(f="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):qi.initSegment([e]),metadata:{channelCount:e.channelCount}},u&&(c=e.inputTimeScale,l&&c===l.timescale?u=!1:d=h=s[0].pts-Math.round(c*r))}if(t.sps&&t.pps&&n.length&&(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:qi.initSegment([t]),metadata:{width:t.width,height:t.height}},u))if(c=t.inputTimeScale,l&&c===l.timescale)u=!1;else{const e=this.getVideoStartPts(n),t=Math.round(c*r);h=Math.min(h,ls(n[0].dts,e)-t),d=Math.min(d,e-t)}if(Object.keys(o).length)return this.ISGenerated=!0,u?(this._initPTS={baseTime:d,timescale:c},this._initDTS={baseTime:h,timescale:c}):d=c=void 0,{tracks:o,initPTS:d,timescale:c}}remuxVideo(e,t,r,i){const s=e.inputTimeScale,n=e.samples,a=[],o=n.length,l=this._initPTS;let h,c,u=this.nextAvcDts,g=8,y=this.videoSampleDuration,v=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,E=!1;if(!r||null===u){const e=t*s,r=n[0].pts-ls(n[0].dts,n[0].pts);u=e-r}const b=l.baseTime*s/l.timescale;for(let d=0;d0?d-1:d].dts&&(E=!0)}E&&n.sort((function(e,t){const r=e.dts-t.dts,i=e.pts-t.pts;return r||i})),h=n[0].dts,c=n[n.length-1].dts;const S=c-h,L=S?Math.round(S/(o-1)):y||e.inputTimeScale/30;if(r){const e=h-u,t=e>L,r=e<-1;if((t||r)&&(t?T.warn(`AVC: ${Ji(e,!0)} ms (${e}dts) hole between fragments detected, filling it`):T.warn(`AVC: ${Ji(-e,!0)} ms (${e}dts) overlapping between fragments detected`),!r||u>=n[0].pts)){h=u;const t=n[0].pts-e;n[0].dts=h,n[0].pts=t,T.log(`Video: First PTS/DTS adjusted: ${Ji(t,!0)}/${Ji(h,!0)}, delta: ${Ji(e,!0)} ms`)}}h=Math.max(0,h);let A=0,w=0;for(let d=0;d0?e.dts-n[d-1].dts:L;if(r=d>0?e.pts-n[d-1].pts:L,t.stretchShortVideoTrack&&null!==this.nextAudioPts){const r=Math.floor(t.maxBufferHole*s),n=(i?v+i*s:this.nextAudioPts)-e.pts;n>r?(y=n-a,y<0?y=a:D=!0,T.log(`[mp4-remuxer]: It is approximately ${n/90} ms to the next segment; using duration ${y/90} ms for the last video frame.`)):y=a}else y=a}const h=Math.round(e.pts-e.dts);x=Math.min(x,y),P=Math.max(P,y),C=Math.min(C,r),O=Math.max(O,r),a.push(new us(e.key,y,l,h))}if(a.length)if(ns){if(ns<70){const e=a[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(as&&O-C0&&(i&&Math.abs(b-E)<9e3||Math.abs(ls(v[0].pts-S,b)-E)<20*h),v.forEach((function(e){e.pts=ls(e.pts-S,b)})),!r||E<0){if(v=v.filter(e=>e.pts>=0),!v.length)return;E=0===s?0:i&&!y?Math.max(0,b):v[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let r=0,i=E;r=t*h&&l0))return;R+=_;try{L=new Uint8Array(R)}catch(F){return void this.observer.emit(f.ERROR,f.ERROR,{type:p.MUX_ERROR,details:m.REMUX_ALLOC_ERROR,fatal:!1,error:F,bytes:R,reason:"fail allocating audio mdat "+R})}if(!u){const e=new DataView(L.buffer);e.setUint32(0,R),L.set(qi.types.mdat,4)}}L.set(i,_);const n=i.byteLength;_+=n,g.push(new us(!0,l,n,0)),w=s}const I=g.length;if(!I)return;const D=g[g.length-1];this.nextAudioPts=E=w+o*D.duration;const x=u?new Uint8Array(0):qi.moof(e.sequenceNumber++,A/o,d({},e,{samples:g}));e.samples=[];const C=A/n,P=E/n,O="audio",M={data1:x,data2:L,startPTS:C,endPTS:P,startDTS:C,endDTS:P,type:O,hasAudio:!0,hasVideo:!1,nb:I};return this.isAudioContiguous=!0,M}remuxEmptyAudio(e,t,r,i){const s=e.inputTimeScale,n=e.samplerate?e.samplerate:s,a=s/n,o=this.nextAudioPts,l=this._initDTS,d=9e4*l.baseTime/l.timescale,h=(null!==o?o:i.startDTS*s)+d,c=i.endDTS*s+d,u=a*rs,f=Math.ceil((c-h)/u),p=zi.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(T.warn("[mp4-remuxer]: remux empty Audio"),!p)return void T.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const m=[];for(let g=0;g4294967296)e+=r;return e}function ds(e){for(let t=0;te.pts-t.pts);const n=e.samples;return e.samples=[],{samples:n}}class us{constructor(e,t,r,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=r,this.cts=i,this.flags=new fs(e)}}class fs{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}class ps{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,r,i){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(Re(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:r}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const i=this.initData=we(e);t||(t=gs(i.audio,D.AUDIO)),r||(r=gs(i.video,D.VIDEO));const s={};i.audio&&i.video?s.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:i.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?s.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:T.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,r,i,s,n){var a,o;let{initPTS:l,lastEndTime:d}=this;const h={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};u(d)||(d=this.lastEndTime=s||0);const c=t.samples;if(null==c||!c.length)return h;const f={initPTS:void 0,timescale:1};let p=this.initData;if(null!=(a=p)&&a.length||(this.generateInitSegment(c),p=this.initData),null==(o=p)||!o.length)return T.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const m=De(c,p),g=Ie(p,c),y=null===g?s:g;(ms(l,y,s,m)||f.timescale!==l.timescale&&n)&&(f.initPTS=y-s,l&&1===l.timescale&&T.warn("Adjusting initPTS by "+(f.initPTS-l.baseTime)),this.initPTS=l={baseTime:f.initPTS,timescale:1});const v=e?y-l.baseTime/l.timescale:d,_=v+m;Ce(p,c,l.baseTime/l.timescale),m>0?this.lastEndTime=_:(T.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const E=!!p.audio,b=!!p.video;let S="";E&&(S+="audio"),b&&(S+="video");const L={data1:c,startPTS:v,startDTS:v,endPTS:_,endDTS:_,type:S,hasAudio:E,hasVideo:b,nb:1,dropped:0};return h.audio="audio"===L.type?L:void 0,h.video="audio"!==L.type?L:void 0,h.initSegment=f,h.id3=hs(r,s,l,l),i.samples.length&&(h.text=cs(i,s,l)),h}}function ms(e,t,r,i){if(null===e)return!0;const s=Math.max(i,1),n=t-e.baseTime/e.timescale;return Math.abs(n-r)>s}function gs(e,t){const r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r||"hev1"===r?"hvc1.1.6.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===D.VIDEO?"avc1.42e01e":"mp4a.40.5"}try{ss=self.performance.now.bind(self.performance)}catch(Na){T.debug("Unable to use Performance API on this environment"),ss="undefined"!==typeof self&&self.Date.now}const ys=[{demux:Li,remux:ps},{demux:Bi,remux:os},{demux:Ti,remux:os},{demux:Yi,remux:os}];class vs{constructor(e,t,r,i,s){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=i,this.id=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,i){const s=r.transmuxing;s.executeStart=ss();let n=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:o}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:d,trackSwitch:h,accurateTimeOffset:c,timeOffset:u,initSegmentChange:g}=i||a,{audioCodec:y,videoCodec:v,defaultInitPts:_,duration:E,initSegmentData:b}=o,S=_s(n,t);if(S&&"AES-128"===S.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(n,S.key.buffer,S.iv.buffer).then(e=>{const t=this.push(e,null,r);return this.decryptionPromise=null,t}),this.decryptionPromise;{let t=e.softwareDecrypt(n,S.key.buffer,S.iv.buffer);const i=r.part>-1;if(i&&(t=e.flush()),!t)return s.executeEnd=ss(),Es(r);n=new Uint8Array(t)}}const L=this.needsProbing(d,h);if(L){const e=this.configureTransmuxer(n);if(e)return T.warn("[transmuxer] "+e.message),this.observer.emit(f.ERROR,f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),s.executeEnd=ss(),Es(r)}(d||h||g||L)&&this.resetInitSegment(b,y,v,E,t),(d||g||L)&&this.resetInitialTimestamp(_),l||this.resetContiguity();const A=this.transmux(n,S,u,c,r),w=this.currentTransmuxState;return w.contiguous=!0,w.discontinuity=!1,w.trackSwitch=!1,s.executeEnd=ss(),A}flush(e){const t=e.transmuxing;t.executeStart=ss();const{decrypter:r,currentTransmuxState:i,decryptionPromise:s}=this;if(s)return s.then(()=>this.flush(e));const n=[],{timeOffset:a}=i;if(r){const t=r.flush();t&&n.push(this.push(t,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l)return t.executeEnd=ss(),[Es(e)];const d=o.flush(a);return bs(d)?d.then(t=>(this.flushRemux(n,t,e),n)):(this.flushRemux(n,d,e),n)}flushRemux(e,t,r){const{audioTrack:i,videoTrack:s,id3Track:n,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;T.log(`[transmuxer.ts]: Flushed fragment ${r.sn}${r.part>-1?" p: "+r.part:""} of level ${r.level}`);const d=this.remuxer.remux(i,s,n,a,l,o,!0,this.id);e.push({remuxResult:d,chunkMeta:r}),r.transmuxing.executeEnd=ss()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,i,s){const{demuxer:n,remuxer:a}=this;n&&a&&(n.resetInitSegment(e,t,r,i),a.resetInitSegment(e,t,r,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,i,s){let n;return n=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,i,s):this.transmuxUnencrypted(e,r,i,s),n}transmuxUnencrypted(e,t,r,i){const{audioTrack:s,videoTrack:n,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive),l=this.remuxer.remux(s,n,a,o,t,r,!1,this.id);return{remuxResult:l,chunkMeta:i}}transmuxSampleAes(e,t,r,i,s){return this.demuxer.demuxSampleAes(e,t,r).then(e=>{const t=this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,r,i,!1,this.id);return{remuxResult:t,chunkMeta:s}})}configureTransmuxer(e){const{config:t,observer:r,typeSupported:i,vendor:s}=this;let n;for(let h=0,c=ys.length;h0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(r=t),r}const Es=e=>({remuxResult:{},chunkMeta:e});function bs(e){return"then"in e&&e.then instanceof Function}class Ts{constructor(e,t,r,i,s){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=i,this.defaultInitPts=s||null}}class Ss{constructor(e,t,r,i,s,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=i,this.timeOffset=s,this.initSegmentChange=n}}var Ls={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function i(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function n(e,t,i,n,a){if("function"!==typeof i)throw new TypeError("The listener must be a function");var o=new s(i,n||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,i,s=[];if(0===this._eventsCount)return s;for(i in e=this._events)t.call(e,i)&&s.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,n=i.length,a=new Array(n);s!1};class ks{constructor(e,t,r,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=r,this.onFlush=i;const n=(e,t)=>{t=t||{},t.frag=this.frag,t.id=this.id,e===f.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new ws,this.observer.on(f.FRAG_DECRYPTED,n),this.observer.on(f.ERROR,n);const a={mp4:Rs.isTypeSupported("video/mp4"),mpeg:Rs.isTypeSupported("audio/mpeg"),mp3:Rs.isTypeSupported('audio/mp4; codecs="mp3"')},o=navigator.vendor;if(this.useWorker&&"undefined"!==typeof Worker){const e=s.workerPath||si();if(e){try{s.workerPath?(T.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=ai(s.workerPath)):(T.log(`injecting Web Worker for "${t}"`),this.workerContext=ni()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const r=new Error(`${e.message} (${e.filename}:${e.lineno})`);s.enableWorker=!1,T.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:r})},e.postMessage({cmd:"init",typeSupported:a,vendor:o,id:t,config:JSON.stringify(s)})}catch(Na){T.warn(`Error setting up "${t}" Web Worker, fallback to inline`,Na),this.resetWorker(),this.error=null,this.transmuxer=new vs(this.observer,a,s,o,t)}return}}this.transmuxer=new vs(this.observer,a,s,o,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,r,i,s,n,a,o,l,d){var h,c;l.transmuxing.start=self.performance.now();const{transmuxer:u}=this,f=n?n.start:s.start,p=s.decryptdata,m=this.frag,g=!(m&&s.cc===m.cc),y=!(m&&l.level===m.level),v=m?l.sn-m.sn:-1,_=this.part?l.part-this.part.index:-1,E=0===v&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),b=!y&&(1===v||0===v&&(1===_||E&&_<=0)),S=self.performance.now();(y||v||0===s.stats.parsing.start)&&(s.stats.parsing.start=S),!n||!_&&b||(n.stats.parsing.start=S);const L=!(m&&(null==(h=s.initSegment)?void 0:h.url)===(null==(c=m.initSegment)?void 0:c.url)),A=new Ss(g,b,o,y,f,L);if(!b||g||L){T.log(`[transmuxer-interface, ${s.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${g}\n trackSwitch: ${y}\n contiguous: ${b}\n accurateTimeOffset: ${o}\n timeOffset: ${f}\n initSegmentChange: ${L}`);const e=new Ts(r,i,t,a,d);this.configureTransmuxer(e)}if(this.frag=s,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:p,chunkMeta:l,state:A},e instanceof ArrayBuffer?[e]:[]);else if(u){const t=u.push(e,p,l,A);bs(t)?(u.async=!0,t.then(e=>{this.handleTransmuxComplete(e)}).catch(e=>{this.transmuxerError(e,l,"transmuxer-interface push error")})):(u.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let r=t.flush(e);const i=bs(r);i||t.async?(bs(r)||(r=Promise.resolve(r)),r.then(t=>{this.handleFlushResult(t,e)}).catch(t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")})):this.handleFlushResult(r,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(e=>{this.handleTransmuxComplete(e)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data,r=this.hls;switch(t.event){case"init":{var i;const e=null==(i=this.workerContext)?void 0:i.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":T[t.data.logType]&&T[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data);break}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Is=250,Ds=2,xs=.1,Cs=.05;class Ps{constructor(e,t,r,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=r,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:r,media:i,stalled:s}=this;if(null===i)return;const{currentTime:n,seeking:a}=i,o=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,n!==e){if(this.moved=!0,null!==s){if(this.stallReported){const e=self.performance.now()-s;T.warn(`playback not stuck anymore @${n}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||o)return void(this.stalled=null);if(i.paused&&!a||i.ended||0===i.playbackRate||!Or.getBuffered(i).length)return;const d=Or.bufferInfo(i,n,0),h=d.len>0,c=d.nextStart||0;if(!h&&!c)return;if(a){const e=d.len>Ds,r=!c||t&&t.start<=n||c-n>Ds&&!this.fragmentTracker.getPartialFragment(n);if(e||r)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var u;const e=Math.max(c,d.start||0)-n,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,r=null==t||null==(u=t.details)?void 0:u.live,i=r?2*t.details.targetduration:Ds,s=this.fragmentTracker.getPartialFragment(n);if(e>0&&(e<=i||s))return void this._trySkipBufferHole(s)}const f=self.performance.now();if(null===s)return void(this.stalled=f);const p=f-s;if(!a&&p>=Is&&(this._reportStall(d),!this.media))return;const m=Or.bufferInfo(i,n,r.maxBufferHole);this._tryFixBufferStall(m,p)}_tryFixBufferStall(e,t){const{config:r,fragmentTracker:i,media:s}=this;if(null===s)return;const n=s.currentTime,a=i.getPartialFragment(n);if(a){const e=this._trySkipBufferHole(a);if(e||!this.media)return}(e.len>r.maxBufferHole||e.nextStart&&e.nextStart-n1e3*r.highBufferWatchdogPeriod&&(T.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:r,stallReported:i}=this;if(!i&&r){this.stallReported=!0;const i=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${JSON.stringify(e)})`);T.warn(i.message),t.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_STALLED_ERROR,fatal:!1,error:i,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:r,media:i}=this;if(null===i)return 0;const s=i.currentTime,n=Or.bufferInfo(i,s,0),a=s0&&n.len<1&&i.readyState<3,d=a-s;if(d>0&&(o||l)){if(d>t.maxBufferHole){const{fragmentTracker:t}=this;let r=!1;if(0===s){const e=t.getAppendedFrag(0,_t.MAIN);e&&a1?(e=0,this.bitrateTest=!0):e=r.nextAutoLevel),this.level=r.nextLoadLevel=e,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=Jr.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Jr.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Jr.WAITING_LEVEL:{var e;const{levels:t,level:r}=this,i=null==t||null==(e=t[r])?void 0:e.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=Jr.IDLE;break}if(this.hls.nextLoadLevel!==this.level){this.state=Jr.IDLE;break}break}case Jr.FRAG_LOADING_WAITING_RETRY:{var t;const e=self.performance.now(),r=this.retryDate;(!r||e>=r||null!=(t=this.media)&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=Jr.IDLE)}break}this.state===Jr.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:r,media:i}=this,{config:s,nextLoadLevel:n}=e;if(null===t||!i&&(this.startFragRequested||!s.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(null==r||!r[n])return;const a=r[n],o=this.getMainFwdBufferInfo();if(null===o)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(f.BUFFER_EOS,e),void(this.state=Jr.ENDED)}e.loadLevel!==n&&-1===e.manualLevel&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const d=a.details;if(!d||this.state===Jr.WAITING_LEVEL||d.live&&this.levelLastLoaded!==n)return this.level=n,void(this.state=Jr.WAITING_LEVEL);const h=o.len,c=this.getMaxBufferLength(a.maxBitrate);if(h>=c)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const u=this.backtrackFragment?this.backtrackFragment.start:o.end;let p=this.getNextFragment(u,d);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==Tr.OK){var m;const e=(null!=(m=this.backtrackFragment)?m:p).sn,t=e-d.startSN,r=d.fragments[t-1];r&&p.cc===r.cc&&(p=r,this.fragmentTracker.removeFragment(r))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,u)){const e=p.gap;if(!e){const e=this.audioOnly&&!this.altAudio?D.AUDIO:D.VIDEO,t=(e===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,_t.MAIN)}p=this.getNextFragmentLoopLoading(p,d,o,_t.MAIN,c)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,a,u))}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===Tr.NOT_LOADED||i===Tr.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,r)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,_t.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let r;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const s=this.getLevelDetails();if(null!=s&&s.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*s.targetduration)return}if(!t.paused&&e){const t=this.hls.nextLoadLevel,i=e[t],s=this.fragLastKbps;r=s&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*s)+1:0}else r=0;const n=this.getBufferedFrag(t.currentTime+r);if(n){const e=this.followingBufferedFrag(n);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,r=e.duration,i=Math.max(n.end,t+Math.min(Math.max(r-this.config.maxFragLookUpTolerance,.5*r),.75*r));this.flushMainBuffer(i,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Jr.KEY_LOADING:case Jr.FRAG_LOADING:case Jr.FRAG_LOADING_WAITING_RETRY:case Jr.PARSING:case Jr.PARSED:this.state=Jr.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new Ps(this.config,r,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;u(t)&&this.log("Media seeked to "+t.toFixed(3));const r=this.getMainFwdBufferInfo();null!==r&&0!==r.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${r?r.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(f.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1}onManifestParsed(e,t){let r,i=!1,s=!1;t.levels.forEach(e=>{r=e.audioCodec,r&&(-1!==r.indexOf("mp4a.40.2")&&(i=!0),-1!==r.indexOf("mp4a.40.5")&&(s=!0))}),this.audioCodecSwitch=i&&s&&!ii(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:r}=this;if(!r||this.state!==Jr.IDLE)return;const i=r[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(i.details))&&(this.state=Jr.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:i}=this,s=t.level,n=t.details,a=n.totalduration;if(!i)return void this.warn("Levels were reset while loading level "+s);this.log(`Level ${s} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${a}`);const o=i[s],l=this.fragCurrent;!l||this.state!==Jr.FRAG_LOADING&&this.state!==Jr.FRAG_LOADING_WAITING_RETRY||l.level===t.level&&l.urlId===o.urlId||!l.loader||this.abortCurrentFrag();let d=0;if(n.live||null!=(r=o.details)&&r.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;d=this.alignPlaylists(n,o.details)}if(o.details=n,this.levelLastLoaded=s,this.hls.trigger(f.LEVEL_UPDATED,{details:n,level:s}),this.state===Jr.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=Jr.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,d),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:r,part:i,payload:s}=e,{levels:n}=this;if(!n)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const a=n[r.level],o=a.details;if(!o)return this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),void this.fragmentTracker.removeFragment(r);const l=a.videoCodec,d=o.PTSKnown||!o.live,h=null==(t=r.initSegment)?void 0:t.data,c=this._getAudioCodec(a),u=this.transmuxer=this.transmuxer||new ks(this.hls,_t.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,p=-1!==f,m=new Mr(r.level,r.sn,r.stats.chunkCount,s.byteLength,f,p),g=this.initPTS[r.cc];u.push(s,h,c,l,r,i,o.totalduration,d,m,g)}onAudioTrackSwitching(e,t){const r=this.altAudio,i=!!t.url;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;r&&(e.trigger(f.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(f.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=t.id,i=!!this.hls.audioTracks[r].url;if(i){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const r=t.tracks;let i,s,n=!1;for(const a in r){const e=r[a];if("main"===e.id){if(s=a,i=e,"video"===a){const e=r[a];e&&(this.videoBuffer=e.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r&&r.type!==_t.MAIN)return;if(this.fragContextChanged(r))return this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Jr.PARSED&&(this.state=Jr.IDLE));const s=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}onError(e,t){var r;if(t.fatal)this.state=Jr.ERROR;else switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_t.MAIN,t);break;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Jr.WAITING_LEVEL||(null==(r=t.context)?void 0:r.type)!==vt.LEVEL||(this.state=Jr.IDLE);break;case m.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!Or.getBuffered(e).length){const e=this.state!==Jr.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Jr.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==D.AUDIO||this.audioOnly&&!this.altAudio){const e=(t===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,_t.MAIN)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let r=this.startPosition;if(r>=0&&t0&&(n{const{hls:i}=this;if(!r||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Jr.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(f.FRAG_LOADED,r),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const r="main",{hls:i}=this,{remuxResult:s,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a)return void this.resetWhenMissingContext(n);const{frag:o,part:l,level:d}=a,{video:h,text:c,id3:p,initSegment:m}=s,{details:g}=d,y=this.altAudio?void 0:s.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Jr.PARSING,m){if(null!=m&&m.tracks){const e=o.initSegment||o;this._bufferInitSegment(d,m.tracks,e,n),i.trigger(f.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:m.tracks})}const e=m.initPTS,t=m.timescale;u(e)&&(this.initPTS[o.cc]={baseTime:e,timescale:t},i.trigger(f.INIT_PTS_FOUND,{frag:o,id:r,initPTS:e,timescale:t}))}if(h&&g&&"initSegment"!==o.sn){const e=g.fragments[o.sn-1-g.startSN],t=o.sn===g.startSN,r=!e||o.cc>e.cc;if(!1!==s.independent){const{startPTS:e,endPTS:i,startDTS:s,endDTS:a}=h;if(l)l.elementaryStreams[h.type]={startPTS:e,endPTS:i,startDTS:s,endDTS:a};else if(h.firstKeyFrame&&h.independent&&1===n.id&&!r&&(this.couldBacktrack=!0),h.dropped&&h.independent){const s=this.getMainFwdBufferInfo(),n=(s?s.end:this.getLoadPosition())+this.config.maxBufferHole,l=h.firstKeyFramePTS?h.firstKeyFramePTS:e;if(!t&&n{const s=t[e],n=s.initSegment;null!=n&&n.byteLength&&this.hls.trigger(f.BUFFER_APPENDING,{type:e,data:n,frag:r,part:null,chunkMeta:i,parent:r.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,_t.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Jr.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const r=e.currentTime;if(Or.isBuffered(e,r)?t=this.getAppendedFrag(r):Or.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,r=t.level;e&&t.sn===e.sn&&e.level===r&&t.urlId===e.urlId||(this.fragPlaying=t,this.hls.trigger(f.FRAG_CHANGED,{frag:t}),e&&e.level===r||this.hls.trigger(f.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,r=this.currentFrag;if(r&&u(t)&&u(r.programDateTime)){const e=r.programDateTime+1e3*(t-r.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Fs{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class Ns{constructor(e,t,r,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Fs(e),this.fast_=new Fs(t),this.defaultTTFB_=i,this.ttfb_=new Fs(e)}update(e,t){const{slow_:r,fast_:i,ttfb_:s}=this;r.halfLife!==e&&(this.slow_=new Fs(e,r.getEstimate(),r.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Fs(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new Fs(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,i=e/1e3,s=r/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class Us{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new Ns(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var r;const i=t.frag;this.ignoreFragment(i)||(this.fragCurrent=i,this.partCurrent=null!=(r=t.part)?r:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,r,i){const s=e+r/t,n=i?this.lastLevelLoadSec:0;return s+n}onLevelLoaded(e,t){const r=this.hls.config,{total:i,bwEstimate:s}=t.stats;u(i)&&u(s)&&(this.lastLevelLoadSec=8*i/s),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:r}=this,{autoLevelEnabled:i,media:s}=r;if(!e||!s)return;const n=performance.now(),a=t?t.stats:e.stats,o=t?t.duration:e.duration,l=n-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!i||s.paused||!s.playbackRate||!s.readyState)return;const d=r.mainForwardBufferInfo;if(null===d)return;const h=this.bwEstimator.getEstimateTTFB(),c=Math.abs(s.playbackRate);if(l<=Math.max(h,o/(2*c)*1e3))return;const p=d.len/c;if(p>=2*o/c)return;const m=a.loading.first?a.loading.first-a.loading.start:-1,g=a.loaded&&m>-1,y=this.bwEstimator.getEstimate(),{levels:v,minAutoLevel:_}=r,E=v[e.level],b=a.total||Math.max(a.loaded,Math.round(o*E.maxBitrate/8));let S=l-m;S<1&&g&&(S=Math.min(l,8*a.loaded/y));const L=g?1e3*a.loaded/S:0,A=L?(b-a.loaded)/L:8*b/y+h/1e3;if(A<=p)return;const w=L?8*L:y;let R,k=Number.POSITIVE_INFINITY;for(R=e.level-1;R>_;R--){const e=v[R].maxBitrate;if(k=this.getTimeToLoadFrag(h/1e3,w,o*e,!v[R].details),k=A||k>10*o||(r.nextLoadLevel=R,g?this.bwEstimator.sample(l-Math.min(h,m),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),T.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${p.toFixed(3)} s\n Estimated load time for current fragment: ${A.toFixed(3)} s\n Estimated load time for down switch fragment: ${k.toFixed(3)} s\n TTFB estimate: ${m}\n Current BW estimate: ${u(y)?(y/1024).toFixed(3):"Unknown"} Kb/s\n New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s\n Aborting and switching to level ${R}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),r.trigger(f.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:r}){const i=r?r.stats:t.stats;if(t.type===_t.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const e=r?r.duration:t.duration,s=this.hls.levels[t.level],n=(s.loaded?s.loaded.bytes:0)+i.loaded,a=(s.loaded?s.loaded.duration:0)+e;s.loaded={bytes:n,duration:a},s.realBitrate=Math.round(8*n/a)}if(t.bitrateTest){const e={stats:i,frag:t,part:r,id:t.type};this.onFragBuffered(f.FRAG_BUFFERED,e),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:r,part:i}=t,s=null!=i&&i.stats.loaded?i.stats:r.stats;if(s.aborted)return;if(this.ignoreFragment(r))return;const n=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,s.loaded),s.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==_t.MAIN||"initSegment"===e.sn}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;let r=this.getNextABRAutoLevel();if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return-1!==e&&(r=Math.min(e,r)),r}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this,{maxAutoLevel:i,config:s,minAutoLevel:n,media:a}=r,o=t?t.duration:e?e.duration:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():s.abrEwmaDefaultEstimate,h=r.mainForwardBufferInfo,c=(h?h.len:0)/l;let u=this.findBestLevel(d,n,i,c,s.abrBandWidthFactor,s.abrBandWidthUpFactor);if(u>=0)return u;T.trace(`[abr] ${c?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let f=o?Math.min(o,s.maxStarvationDelay):s.maxStarvationDelay,p=s.abrBandWidthFactor,m=s.abrBandWidthUpFactor;if(!c){const e=this.bitrateTestDelay;if(e){const t=o?Math.min(o,s.maxLoadingDelay):s.maxLoadingDelay;f=t-e,T.trace(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*f)} ms`),p=m=1}}return u=this.findBestLevel(d,n,i,c+f,p,m),Math.max(u,0)}findBestLevel(e,t,r,i,s,n){var a;const{fragCurrent:o,partCurrent:l,lastLoadedFragLevel:d}=this,{levels:h}=this.hls,c=h[d],f=!(null==c||null==(a=c.details)||!a.live),p=null==c?void 0:c.codecSet,m=l?l.duration:o?o.duration:0,g=this.bwEstimator.getEstimateTTFB()/1e3;let y=t,v=-1;for(let _=r;_>=t;_--){const t=h[_];if(!t||p&&t.codecSet!==p){t&&(y=Math.min(_,y),v=Math.max(_,v));continue}-1!==v&&T.trace(`[abr] Skipped level(s) ${y}-${v} with CODECS:"${h[v].attrs.CODECS}"; not compatible with "${c.attrs.CODECS}"`);const r=t.details,a=(l?null==r?void 0:r.partTarget:null==r?void 0:r.averagetargetduration)||m;let o;o=_<=d?s*e:n*e;const E=h[_].maxBitrate,b=this.getTimeToLoadFrag(g,o,E*a,void 0===r);if(T.trace(`[abr] level:${_} adjustedbw-bitrate:${Math.round(o-E)} avgDuration:${a.toFixed(1)} maxFetchDuration:${i.toFixed(1)} fetchDuration:${b.toFixed(1)}`),o>E&&(0===b||!u(b)||f&&!this.bitrateTestDelay||b0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=Jr.IDLE):(this.loadedmetadata=!1,this.state=Jr.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Jr.IDLE:this.doTickIdle();break;case Jr.WAITING_TRACK:{var e;const{levels:t,trackId:r}=this,i=null==t||null==(e=t[r])?void 0:e.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=Jr.WAITING_INIT_PTS}break}case Jr.FRAG_LOADING_WAITING_RETRY:{var t;const e=performance.now(),r=this.retryDate;(!r||e>=r||null!=(t=this.media)&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Jr.IDLE);break}case Jr.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:i,complete:s}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Jr.FRAG_LOADING;const e=i.flush(),n={frag:t,part:r,payload:e,networkDetails:null};this._handleFragmentLoadProgress(n),s&&super._handleFragmentLoadComplete(n)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),r=Or.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole),i=dr(r.end,this.config.maxFragLookUpTolerance,t);i<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${r.end} is needed`),this.clearWaitingFragment())}}else this.state=Jr.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Jr.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:r,trackId:i}=this,s=e.config;if(null==t||!t[i])return;if(!r&&(this.startFragRequested||!s.startFragPrefetch))return;const n=t[i],a=n.details;if(!a||a.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(a))return void(this.state=Jr.WAITING_TRACK);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,D.AUDIO,_t.AUDIO));const l=this.getFwdBufferInfo(o,_t.AUDIO);if(null===l)return;const{bufferedTrack:d,switchingTrack:h}=this;if(!h&&this._streamEnded(l,a))return e.trigger(f.BUFFER_EOS,{type:"audio"}),void(this.state=Jr.ENDED);const c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,_t.MAIN),u=l.len,p=this.getMaxBufferLength(null==c?void 0:c.len);if(u>=p&&!h)return;const m=a.fragments,g=m[0].start;let y=l.end;if(h&&r){const e=this.getLoadPosition();d&&h.attrs!==d.attrs&&(y=e),a.PTSKnown&&eg||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=g+.05)}let v=this.getNextFragment(y,a),_=!1;if(v&&this.isLoopLoading(v,y)&&(_=!!v.gap,v=this.getNextFragmentLoopLoading(v,a,l,_t.MAIN,p)),!v)return void(this.bufferFlushed=!0);const E=c&&v.start>c.end+a.targetduration;if(E||(null==c||!c.len)&&l.len){const e=this.getAppendedFrag(v.start,_t.MAIN);if(null===e)return;if(_||(_=!!e.gap||!!E&&0===c.len),E&&!_||_&&l.nextStart&&l.nextStartnew Gt(e))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),r?this.setInterval(Gs):this.resetTransmuxer(),r?(this.switchingTrack=t,this.state=Jr.IDLE):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Jr.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(f.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var r;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:i}=this,{details:s,id:n}=t;if(!i)return void this.warn("Audio tracks were reset while loading level "+n);this.log(`Track ${n} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const a=i[n];let o=0;if(s.live||null!=(r=a.details)&&r.live){this.checkLiveUpdate(s);const e=this.mainDetails;if(s.deltaUpdateFailed||!e)return;!a.details&&s.hasProgramDateTime&&e.hasProgramDateTime?(Hr(s,e),o=s.fragments[0].start):o=this.alignPlaylists(s,a.details)}a.details=s,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(a.details,o),this.state!==Jr.WAITING_TRACK||this.waitForCdnTuneIn(s)||(this.state=Jr.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:r,part:i,payload:s}=e,{config:n,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const d=l.details;if(!d)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(r.start);const h=n.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let c=this.transmuxer;c||(c=this.transmuxer=new ks(this.hls,_t.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const u=this.initPTS[r.cc],f=null==(t=r.initSegment)?void 0:t.data;if(void 0!==u){const e=!1,t=i?i.index:-1,n=-1!==t,a=new Mr(r.level,r.sn,r.stats.chunkCount,s.byteLength,t,n);c.push(s,f,h,"",r,i,d.totalduration,e,a,u)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${d.startSN} ,${d.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:r,part:i,cache:new Bs,complete:!1};e.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=Jr.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r.type===_t.AUDIO)if(this.fragContextChanged(r))this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==r.sn){this.fragPrevious=r;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(f.AUDIO_TRACK_SWITCHED,o({},e)))}this.fragBufferedComplete(r,i)}else if(!this.loadedmetadata&&r.type===_t.MAIN){const e=this.videoBuffer||this.media;if(e){const t=Or.getBuffered(e);t.length&&(this.loadedmetadata=!0)}}}onError(e,t){var r;if(t.fatal)this.state=Jr.ERROR;else switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_t.AUDIO,t);break;case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Jr.WAITING_TRACK||(null==(r=t.context)?void 0:r.type)!==vt.AUDIO_TRACK||(this.state=Jr.IDLE);break;case m.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushed(e,{type:t}){t===D.AUDIO&&(this.bufferFlushed=!0,this.state===Jr.ENDED&&(this.state=Jr.IDLE))}_handleTransmuxComplete(e){var t;const r="audio",{hls:i}=this,{remuxResult:s,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a)return void this.resetWhenMissingContext(n);const{frag:o,part:l,level:h}=a,{details:c}=h,{audio:u,text:p,id3:m,initSegment:g}=s;if(!this.fragContextChanged(o)&&c){if(this.state=Jr.PARSING,this.switchingTrack&&u&&this.completeAudioSwitch(this.switchingTrack),null!=g&&g.tracks){const e=o.initSegment||o;this._bufferInitSegment(g.tracks,e,n),i.trigger(f.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:g.tracks})}if(u){const{startPTS:e,endPTS:t,startDTS:r,endDTS:i}=u;l&&(l.elementaryStreams[D.AUDIO]={startPTS:e,endPTS:t,startDTS:r,endDTS:i}),o.setElementaryStreamInfo(D.AUDIO,e,t,r,i),this.bufferFragmentData(u,o,l,n)}if(null!=m&&null!=(t=m.samples)&&t.length){const e=d({id:r,frag:o,details:c},m);i.trigger(f.FRAG_PARSING_METADATA,e)}if(p){const e=d({id:r,frag:o,details:c},p);i.trigger(f.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,r){if(this.state!==Jr.PARSING)return;e.video&&delete e.video;const i=e.audio;if(!i)return;i.levelCodec=i.codec,i.id="audio",this.log(`Init audio buffer, container:${i.container}, codecs[parsed]=[${i.codec}]`),this.hls.trigger(f.BUFFER_CODECS,e);const s=i.initSegment;if(null!=s&&s.byteLength){const e={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:s};this.hls.trigger(f.BUFFER_APPENDING,e)}this.tick()}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);var s;(this.fragCurrent=e,this.switchingTrack||i===Tr.NOT_LOADED||i===Tr.PARTIAL)?"initSegment"===e.sn?this._loadInitSegment(e,t):null!=(s=t.details)&&s.live&&!this.initPTS[e.cc]?(this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=Jr.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(e,t,r)):this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:r,bufferedTrack:i}=this,s=null==i?void 0:i.attrs,n=e.attrs;r&&s&&(s.CHANNELS!==n.CHANNELS||s.NAME!==n.NAME||s.LANGUAGE!==n.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(f.AUDIO_TRACK_SWITCHED,o({},e))}}class Ks extends yr{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(f.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:r,groupId:i,details:s}=t,n=this.tracksInGroup[r];if(!n||n.groupId!==i)return void this.warn(`Track with id:${r} and group:${i} not found in active group ${n.groupId}`);const a=n.details;n.details=t.details,this.log(`audio-track ${r} "${n.name}" lang:${n.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.audioGroupIds)return;const r=t.audioGroupIds[t.urlId];if(this.groupId!==r){this.groupId=r||null;const e=this.tracks.filter(e=>!r||e.groupId===r);this.selectDefaultTrack&&!e.some(e=>e.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=e;const t={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group:${r}`),this.hls.trigger(f.AUDIO_TRACKS_UPDATED,t),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&t.context.type===vt.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn("Invalid id passed to audio-track controller");this.clearTimer();const r=this.currentTrack;t[this.trackId];const i=t[e],{groupId:s,name:n}=i;if(this.log(`Switching to audio-track ${e} "${n}" lang:${i.lang} group:${s}`),this.trackId=e,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger(f.AUDIO_TRACK_SWITCHING,o({},i)),i.details&&!i.details.live)return;const a=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{const t=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}findTrackId(e){const t=this.tracksInGroup;for(let r=0;re[r]!==t[r])}const Ys=500;class zs extends ei{constructor(e,t,r){super(e,t,r,"[subtitle-stream-controller]",_t.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.ERROR,this.onError,this),e.on(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(f.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.ERROR,this.onError,this),e.off(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(f.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Jr.IDLE,this.setInterval(Ys),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:r,success:i}=t;if(this.fragPrevious=r,this.state=Jr.IDLE,!i)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let n;const a=r.start;for(let l=0;l=s[l].start&&a<=s[l].end){n=s[l];break}const o=r.start+r.duration;n?n.end=o:(n={start:a,end:o},s.push(n)),this.fragmentTracker.fragBuffered(r)}onBufferFlushing(e,t){const{startOffset:r,endOffset:i}=t;if(0===r&&i!==Number.POSITIVE_INFINITY){const e=i-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach(t=>{for(let r=0;rnew Gt(e)):(this.tracksBuffered=[],this.levels=t.map(e=>{const t=new Gt(e);return this.tracksBuffered[t.id]=[],t}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,_t.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(Ys)}onSubtitleTrackLoaded(e,t){var r;const{details:i,id:s}=t,{currentTrackId:n,levels:a}=this;if(!a.length)return;const o=a[n];if(s>=a.length||s!==n||!o)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(i.live||null!=(r=o.details)&&r.live){const e=this.mainDetails;if(i.deltaUpdateFailed||!e)return;const t=e.fragments[0];o.details?(l=this.alignPlaylists(i,o.details),0===l&&t&&(l=t.start,qt(i,l))):i.hasProgramDateTime&&e.hasProgramDateTime?(Hr(i,e),l=i.fragments[0].start):t&&(l=t.start,qt(i,l))}if(o.details=i,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(o.details,l),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===Jr.IDLE){const e=lr(null,i.fragments,this.media.currentTime,0);e||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){const e=performance.now();this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).catch(e=>{throw s.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e}).then(r=>{const i=performance.now();s.trigger(f.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:e,tdecrypt:i}})}).catch(e=>{this.warn(`${e.name}: ${e.message}`),this.state=Jr.IDLE})}}doTick(){if(this.media){if(this.state===Jr.IDLE){const{currentTrackId:e,levels:t}=this,r=t[e];if(!t.length||!r||!r.details)return;const{config:i}=this,s=this.getLoadPosition(),n=Or.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,i.maxBufferHole),{end:a,len:o}=n,l=this.getFwdBufferInfo(this.media,_t.MAIN),d=r.details,h=this.getMaxBufferLength(null==l?void 0:l.len)+d.levelTargetDuration;if(o>h)return;const c=d.fragments,u=c.length,f=d.edge;let p=null;const m=this.fragPrevious;if(af-e?0:e;p=lr(m,c,Math.max(c[0].start,a),t),!p&&m&&m.start{if(r>>>=0,r>i-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${i})`);return e[r][t]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}class qs extends yr{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(f.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);const e=Xs(this.media.textTracks);e.forEach(e=>{At(e)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:r,details:i}=t,{trackId:s}=this,n=this.tracksInGroup[s];if(!n)return void this.warn("Invalid subtitle track id "+r);const a=n.details;n.details=t.details,this.log(`subtitle track ${r} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.textGroupIds)return;const r=t.textGroupIds[t.urlId],i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==r){const e=this.tracks.filter(e=>!r||e.groupId===r);this.tracksInGroup=e;const t=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r||null;const s={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${r}" group-id`),this.hls.trigger(f.SUBTITLE_TRACKS_UPDATED,s),-1!==t&&this.setSubtitleTrack(t,i)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId,i)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;re.groupId===this.groupId);if(-1===e)[].slice.call(i).forEach(e=>{e.mode="disabled"});else{const e=s[r];e&&(e.mode="disabled")}const n=s[e];n&&(n.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var r;const i=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(-1===e||null!=(r=i[e])&&r.details)||e<-1||e>=i.length)return;this.clearTimer();const s=i[e];if(this.log("Switching to subtitle-track "+e+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:"")),this.trackId=e,s){const{id:e,groupId:r="",name:i,type:n,url:a}=s;this.hls.trigger(f.SUBTITLE_TRACK_SWITCH,{id:e,groupId:r,name:i,type:n,url:a});const o=this.switchParams(s.url,null==t?void 0:t.details);this.loadPlaylist(o)}else this.hls.trigger(f.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=Xs(this.media.textTracks);for(let r=0;r{t=e}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),r}executeNext(e){const{buffers:t,queues:r}=this,i=t[e],s=r[e];if(s.length){const t=s[0];try{t.execute()}catch(n){T.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),t.onError(n),null!=i&&i.updating||(s.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Zs=Je(),Js=/([ha]vc.)(?:\.[^.,]+)+/;class en{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;T.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(f.MEDIA_ATTACHED,{media:e})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{T.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{T.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:t}=this;e&&e.src!==t&&T.error(`Media element src was set while attaching MediaSource (${t} > ${e.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.BUFFER_RESET,this.onBufferReset,this),e.on(f.BUFFER_APPENDING,this.onBufferAppending,this),e.on(f.BUFFER_CODECS,this.onBufferCodecs,this),e.on(f.BUFFER_EOS,this.onBufferEos,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(f.FRAG_PARSED,this.onFragParsed,this),e.on(f.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.BUFFER_RESET,this.onBufferReset,this),e.off(f.BUFFER_APPENDING,this.onBufferAppending,this),e.off(f.BUFFER_CODECS,this.onBufferCodecs,this),e.off(f.BUFFER_EOS,this.onBufferEos,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(f.FRAG_PARSED,this.onFragParsed,this),e.off(f.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Qs(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,T.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")}onMediaAttaching(e,t){const r=this.media=t.media;if(r&&Zs){const e=this.mediaSource=new Zs;e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(e),this._objectUrl=r.src,r.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:r}=this;if(t){if(T.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(Na){T.warn(`[buffer-controller]: onMediaDetaching: ${Na.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):T.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(f.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(Na){T.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,Na)}}),this._initSourceBuffer()}onBufferCodecs(e,t){const r=this.getSourceBufferTypes().length;Object.keys(t).forEach(e=>{if(r){const r=this.tracks[e];if(r&&"function"===typeof r.buffer.changeType){const{id:i,codec:s,levelCodec:n,container:a,metadata:o}=t[e],l=(r.levelCodec||r.codec).replace(Js,"$1"),d=(n||s).replace(Js,"$1");if(l!==d){const t=`${a};codecs=${n||s}`;this.appendChangeType(e,t),T.log(`[buffer-controller]: switching codec ${l} to ${d}`),this.tracks[e]={buffer:r.buffer,codec:s,container:a,levelCodec:n,metadata:o,id:i}}}}else this.pendingTracks[e]=t[e]}),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:r}=this,i={execute:()=>{const i=this.sourceBuffer[e];i&&(T.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),i.changeType(t)),r.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{T.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,t)}};r.append(i,e)}onBufferAppending(e,t){const{hls:r,operationQueue:i,tracks:s}=this,{data:n,type:a,frag:o,part:l,chunkMeta:d}=t,h=d.buffering[a],c=self.performance.now();h.start=c;const u=o.stats.buffering,g=l?l.stats.buffering:null;0===u.start&&(u.start=c),g&&0===g.start&&(g.start=c);const y=s.audio;let v=!1;"audio"===a&&"audio/mpeg"===(null==y?void 0:y.container)&&(v=!this.lastMpegAudioChunk||1===d.id||this.lastMpegAudioChunk.sn!==d.sn,this.lastMpegAudioChunk=d);const _=o.start,E={execute:()=>{if(h.executeStart=self.performance.now(),v){const e=this.sourceBuffer[a];if(e){const t=_-e.timestampOffset;Math.abs(t)>=.1&&(T.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${_} (delta: ${t}) sn: ${o.sn})`),e.timestampOffset=_)}}this.appendExecutor(n,a)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();h.executeEnd=h.end=e,0===u.first&&(u.first=e),g&&0===g.first&&(g.first=e);const{sourceBuffer:t}=this,r={};for(const i in t)r[i]=Or.getBuffered(t[i]);this.appendError=0,this.hls.trigger(f.BUFFER_APPENDED,{type:a,frag:o,part:l,chunkMeta:d,parent:o.type,timeRanges:r})},onError:e=>{T.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,e);const t={type:p.MEDIA_ERROR,parent:o.type,details:m.BUFFER_APPEND_ERROR,frag:o,part:l,chunkMeta:d,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=m.BUFFER_FULL_ERROR:(this.appendError++,t.details=m.BUFFER_APPEND_ERROR,this.appendError>r.config.appendErrorMaxRetry&&(T.error(`[buffer-controller]: Failed ${r.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),t.fatal=!0)),r.trigger(f.ERROR,t)}};i.append(E,a)}onBufferFlushing(e,t){const{operationQueue:r}=this,i=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(f.BUFFER_FLUSHED,{type:e})},onError:t=>{T.warn(`[buffer-controller]: Failed to remove from ${e} SourceBuffer`,t)}});t.type?r.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(e=>{r.append(i(e),e)})}onFragParsed(e,t){const{frag:r,part:i}=t,s=[],n=i?i.elementaryStreams:r.elementaryStreams;n[D.AUDIOVIDEO]?s.push("audiovideo"):(n[D.AUDIO]&&s.push("audio"),n[D.VIDEO]&&s.push("video"));const a=()=>{const e=self.performance.now();r.stats.buffering.end=e,i&&(i.stats.buffering.end=e);const t=i?i.stats:r.stats;this.hls.trigger(f.FRAG_BUFFERED,{frag:r,part:i,stats:t,id:r.type})};0===s.length&&T.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(a,s)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){const r=this.getSourceBufferTypes().reduce((e,r)=>{const i=this.sourceBuffer[r];return!i||t.type&&t.type!==r||(i.ending=!0,i.ended||(i.ended=!0,T.log(`[buffer-controller]: ${r} sourceBuffer now EOS`))),e&&!(i&&!i.ended)},!0);r&&(T.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)});const{mediaSource:e}=this;e&&"open"===e.readyState?(T.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&T.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+e.readyState)}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:r,sourceBuffer:i}=this;if(!r||null===t)return;const s=this.getSourceBufferTypes();if(!s.length)return;const n=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(!u(n)||n<0)return;const a=r.currentTime,o=t.levelTargetDuration,l=Math.max(n,o),d=Math.floor(a/o)*o-l;s.forEach(r=>{const s=i[r];if(s){const i=Or.getBuffered(s);if(i.length>0&&d>i.start(0)){if(e.trigger(f.BACK_BUFFER_REACHED,{bufferEnd:d}),t.live)e.trigger(f.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d});else if(s.ended&&i.end(i.length-1)-a<2*o)return void T.info(`[buffer-controller]: Cannot flush ${r} back buffer while SourceBuffer is in ended state`);e.trigger(f.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:r})}}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:r,mediaSource:i}=this,s=e.fragments[0].start+e.totalduration,n=r.duration,a=u(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(T.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(e)):(s>a&&s>n||!u(n))&&(T.log("[buffer-controller]: Updating Media Source duration to "+s.toFixed(3)),i.duration=s)}updateSeekableRange(e){const t=this.mediaSource,r=e.fragments,i=r.length;if(i&&e.live&&null!=t&&t.setLiveSeekableRange){const i=Math.max(0,r[0].start),s=Math.max(i,i+e.totalduration);t.setLiveSeekableRange(i,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:r}=this,i=Object.keys(r).length;if(i&&!e||2===i){this.createSourceBuffers(r),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(f.BUFFER_CREATED,{tracks:this.tracks}),e.forEach(e=>{t.executeNext(e)});else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:r}=this;if(!r)throw Error("createSourceBuffers called when mediaSource was null");for(const i in e)if(!t[i]){const s=e[i];if(!s)throw Error(`source buffer exists for track ${i}, however track does not`);const n=s.levelCodec||s.codec,a=`${s.container};codecs=${n}`;T.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const e=t[i]=r.addSourceBuffer(a),o=i;this.addBufferListener(o,"updatestart",this._onSBUpdateStart),this.addBufferListener(o,"updateend",this._onSBUpdateEnd),this.addBufferListener(o,"error",this._onSBUpdateError),this.tracks[i]={buffer:e,codec:n,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(Na){T.error("[buffer-controller]: error while trying to add sourceBuffer: "+Na.message),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:Na,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this,r=t.current(e);r.onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this,r=t.current(e);r.onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const r=new Error(e+" SourceBuffer error");T.error("[buffer-controller]: "+r,t),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_APPENDING_ERROR,error:r,fatal:!1});const i=this.operationQueue.current(e);i&&i.onError(t)}removeExecutor(e,t,r){const{media:i,mediaSource:s,operationQueue:n,sourceBuffer:a}=this,o=a[e];if(!i||!s||!o)return T.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void n.shiftAndExecuteNext(e);const l=u(i.duration)?i.duration:1/0,d=u(s.duration)?s.duration:1/0,h=Math.max(0,t),c=Math.min(r,l,d);c>h&&!o.ending?(o.ended=!1,T.log(`[buffer-controller]: Removing [${h},${c}] from the ${e} SourceBuffer`),o.remove(h,c)):n.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:r,sourceBuffer:i}=this,s=i[t];if(!s)return T.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),void r.shiftAndExecuteNext(t);s.ended=!1,s.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return T.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:r}=this,i=t.map(e=>r.appendBlocker(e));Promise.all(i).then(()=>{e(),t.forEach(e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||r.shiftAndExecuteNext(e)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,r){const i=this.sourceBuffer[e];if(!i)return;const s=r.bind(this,e);this.listeners[e].push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(e=>{t.removeEventListener(e.event,e.listener)})}}const tn={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},rn=function(e){let t=e;return tn.hasOwnProperty(e)&&(t=tn[e]),String.fromCharCode(t)},sn=15,nn=100,an={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},on={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ln={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},dn={25:2,26:4,29:6,30:8,31:10,27:13,28:15},hn=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class cn{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r="function"===typeof t?t():t;T.log(`${this.time} [${e}] ${r}`)}}}const un=function(e){const t=[];for(let r=0;rnn&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=nn)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r=144&&this.backSpace();const t=rn(e);this.pos>=nn?this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let r="",i=-1;for(let s=0;s0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}getTextAndFormat(){return this.rows}}class yn{constructor(e,t,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new gn(r),this.nonDisplayedMemory=new gn(r),this.lastOutputScreen=new gn(r),this.currRollUpRow=this.displayedMemory.rows[sn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[sn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let r=0;rt+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class vn{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const i=new cn;this.channels=[null,new yn(e,t,i),new yn(e+1,r,i)],this.cmdHistory=bn(),this.logger=i}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let r,i,s,n=!1;this.logger.time=e;for(let a=0;a ("+un([i,s])+")"),r=this.parseCmd(i,s),r||(r=this.parseMidrow(i,s)),r||(r=this.parsePAC(i,s)),r||(r=this.parseBackgroundAttributes(i,s)),!r&&(n=this.parseChars(i,s),n)){const e=this.currentChannel;if(e&&e>0){const t=this.channels[e];t.insertChars(n)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||n||this.logger.log(2,"Couldn't parse cleaned data "+un([i,s])+" orig: "+un([t[a],t[a+1]]))}}parseCmd(e,t){const{cmdHistory:r}=this,i=(20===e||28===e||21===e||29===e)&&t>=32&&t<=47,s=(23===e||31===e)&&t>=33&&t<=35;if(!i&&!s)return!1;if(En(e,t,r))return _n(null,null,r),this.logger.log(3,"Repeated command ("+un([e,t])+") is dropped"),!0;const n=20===e||21===e||23===e?1:2,a=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),_n(e,t,r),this.currentChannel=n,!0}parseMidrow(e,t){let r=0;if((17===e||25===e)&&t>=32&&t<=47){if(r=17===e?1:2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[r];return!!i&&(i.ccMIDROW(t),this.logger.log(3,"MIDROW ("+un([e,t])+")"),!0)}return!1}parsePAC(e,t){let r;const i=this.cmdHistory,s=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,n=(16===e||24===e)&&t>=64&&t<=95;if(!s&&!n)return!1;if(En(e,t,i))return _n(null,null,i),!0;const a=e<=23?1:2;r=t>=64&&t<=95?1===a?an[e]:ln[e]:1===a?on[e]:dn[e];const o=this.channels[a];return!!o&&(o.setPAC(this.interpretPAC(r,t)),_n(e,t,i),this.currentChannel=a,!0)}interpretPAC(e,t){let r;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1===(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i}parseChars(e,t){let r,i=null,s=null;if(e>=25?(r=2,s=e-8):(r=1,s=e),s>=17&&s<=19){let e;e=17===s?t+80:18===s?t+112:t+144,this.logger.log(2,"Special char '"+rn(e)+"' in channel "+r),i=[e]}else e>=32&&e<=127&&(i=0===t?[e]:[e,t]);if(i){const r=un(i);this.logger.log(3,"Char codes = "+r.join(",")),_n(e,t,this.cmdHistory)}return i}parseBackgroundAttributes(e,t){const r=(16===e||24===e)&&t>=32&&t<=47,i=(23===e||31===e)&&t>=45&&t<=47;if(!r&&!i)return!1;let s;const n={};16===e||24===e?(s=Math.floor((t-32)/2),n.background=hn[s],t%2===1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));const a=e<=23?1:2,o=this.channels[a];return o.setBkgData(n),_n(e,t,this.cmdHistory),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Sn=function(){if("undefined"!==typeof self&&self.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!==typeof t)return!1;if(!Array.isArray(e))return!1;const r=t.toLowerCase();return!!~e.indexOf(r)&&r}function i(t){return r(e,t)}function s(e){return r(t,e)}function n(e,...t){let r=1;for(;r100)throw new Error("Position must be between 0 and 100.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",n({},o,{get:function(){return _},set:function(e){const t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",n({},o,{get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",n({},o,{get:function(){return b},set:function(e){const t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),a.displayState=void 0}return a.prototype.getCueAsHTML=function(){const e=self.WebVTT;return e.convertCueToDOMTree(self,this.text)},a}();class Ln{decode(e,t){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function An(e){function t(e,t,r,i){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(i||0)}const r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}class wn{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let i=0;i=0&&r<=100)return this.set(e,r),!0}return!1}}function Rn(e,t,r,i){const s=i?e.split(i):[e];for(const n in s){if("string"!==typeof s[n])continue;const e=s[n].split(r);if(2!==e.length)continue;const i=e[0],a=e[1];t(i,a)}}const kn=new Sn(0,0,""),In="middle"===kn.align?"middle":"center";function Dn(e,t,r){const i=e;function s(){const t=An(e);if(null===t)throw new Error("Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function n(e,t){const i=new wn;Rn(e,(function(e,t){let s;switch(e){case"region":for(let s=r.length-1;s>=0;s--)if(r[s].id===t){i.set(e,r[s].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":s=t.split(","),i.integer(e,s[0]),i.percent(e,s[0])&&i.set("snapToLines",!1),i.alt(e,s[0],["auto"]),2===s.length&&i.alt("lineAlign",s[1],["start",In,"end"]);break;case"position":s=t.split(","),i.percent(e,s[0]),2===s.length&&i.alt("positionAlign",s[1],["start",In,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",In,"end","left","right"]);break}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");let s=i.get("line","auto");"auto"===s&&-1===kn.line&&(s=-1),t.line=s,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",In);let n=i.get("position","auto");"auto"===n&&50===kn.position&&(n="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=n}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=s(),a(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.slice(3),a(),t.endTime=s(),a(),n(e,t)}function xn(e){return e.replace(//gi,"\n")}class Cn{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Ln,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function r(){let e=t.buffer,r=0;e=xn(e);while(r9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!u(t)||!u(r)||!u(i)||!u(s))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*r,t+=6e4*i,t+=36e5*s,t},Fn=function(e){let t=5381,r=e.length;while(r)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()};function Nn(e,t,r){return Fn(e.toString())+Fn(t.toString())+Fn(r)}const Un=function(e,t,r){let i=e[t],s=e[i.prevCC];if(!s||!s.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);while(null!=(n=s)&&n.new){var n;e.ccOffset+=i.start-s.start,i.new=!1,i=s,s=e[i.prevCC]}e.presentationOffset=r};function Bn(e,t,r,i,s,n,a){const o=new Cn,l=ue(new Uint8Array(e)).trim().replace(Pn,"\n").split("\n"),d=[],h=t?es(t.baseTime,t.timescale):0;let c,u="00:00.000",f=0,p=0,m=!0;o.oncue=function(e){const n=r[i];let a=r.ccOffset;const o=(f-h)/9e4;if(null!=n&&n.new&&(void 0!==p?a=r.ccOffset=n.start:Un(r,i,o)),o){if(!t)return void(c=new Error("Missing initPTS for VTT MPEGTS"));a=o-r.presentationOffset}const l=e.endTime-e.startTime,u=ls(9e4*(e.startTime+a-p),9e4*s)/9e4;e.startTime=Math.max(u,0),e.endTime=Math.max(u+l,0);const m=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(m)),e.id||(e.id=Nn(e.startTime,e.endTime,m)),e.endTime>0&&d.push(e)},o.onparsingerror=function(e){c=e},o.onflush=function(){c?a(c):n(d)},l.forEach(e=>{if(m){if(On(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach(e=>{On(e,"LOCAL:")?u=e.slice(6):On(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))});try{p=Mn(u)/1e3}catch(t){c=t}return}""===e&&(m=!1)}o.parse(e+"\n")}),o.flush()}const $n="stpp.ttml.im1t",Gn=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,jn=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Kn={left:"start",center:"center",right:"end",start:"start",end:"end"};function Vn(e,t,r,i){const s=Le(new Uint8Array(e),["mdat"]);if(0===s.length)return void i(new Error("Could not parse IMSC1 mdat"));const n=s.map(e=>ue(e)),a=Zi(t.baseTime,1,t.timescale);try{n.forEach(e=>r(Hn(e,a)))}catch(o){i(o)}}function Hn(e,t){const r=new DOMParser,i=r.parseFromString(e,"text/xml"),s=i.getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(n).reduce((e,t)=>(e[t]=s.getAttribute("ttp:"+t)||n[t],e),{}),o="preserve"!==s.getAttribute("xml:space"),l=zn(Yn(s,"styling","style")),h=zn(Yn(s,"layout","region")),c=Yn(s,"body","[begin]");return[].map.call(c,e=>{const r=Wn(e,o);if(!r||!e.hasAttribute("begin"))return null;const i=Zn(e.getAttribute("begin"),a),s=Zn(e.getAttribute("dur"),a);let n=Zn(e.getAttribute("end"),a);if(null===i)throw Qn(e);if(null===n){if(null===s)throw Qn(e);n=i+s}const c=new Sn(i-t,n-t,r);c.id=Nn(c.startTime,c.endTime,c.text);const u=h[e.getAttribute("region")],f=l[e.getAttribute("style")],p=qn(u,f,l),{textAlign:m}=p;if(m){const e=Kn[m];e&&(c.lineAlign=e),c.align=m}return d(c,p),c}).filter(e=>null!==e)}function Yn(e,t,r){const i=e.getElementsByTagName(t)[0];return i?[].slice.call(i.querySelectorAll(r)):[]}function zn(e){return e.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function Wn(e,t){return[].slice.call(e.childNodes).reduce((e,r,i)=>{var s;return"br"===r.nodeName&&i?e+"\n":null!=(s=r.childNodes)&&s.length?Wn(r,t):t?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent},"")}function qn(e,t,r){const i="http://www.w3.org/ns/ttml#styling";let s=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return a&&r.hasOwnProperty(a)&&(s=r[a]),n.reduce((r,n)=>{const a=Xn(t,i,n)||Xn(e,i,n)||Xn(s,i,n);return a&&(r[n]=a),r},{})}function Xn(e,t,r){return e&&e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function Qn(e){return new Error("Could not parse ttml timestamp "+e)}function Zn(e,t){if(!e)return null;let r=An(e);return null===r&&(Gn.test(e)?r=Jn(e,t):jn.test(e)&&(r=ea(e,t))),r}function Jn(e,t){const r=Gn.exec(e),i=(0|r[4])+(0|r[5])/t.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+i/t.frameRate}function ea(e,t){const r=jn.exec(e),i=Number(r[1]),s=r[2];switch(s){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/t.frameRate;case"t":return i/t.tickRate}return i}class ta{constructor(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=sa(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new Tn(this,"textTrack1"),t=new Tn(this,"textTrack2"),r=new Tn(this,"textTrack3"),i=new Tn(this,"textTrack4");this.cea608Parser1=new vn(1,e,t),this.cea608Parser2=new vn(3,r,i)}e.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(f.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(f.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(f.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(f.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,r,i,s){let n=!1;for(let a=s.length;a--;){const e=s[a],i=ia(e[0],e[1],t,r);if(i>=0&&(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],r),n=!0,i/(r-t)>.5))return}if(n||s.push([t,r]),this.config.renderTextTracksNatively){const s=this.captionsTracks[e];this.Cues.newCue(s,t,r,i)}else{const s=this.Cues.newCue(null,t,r,i);this.hls.trigger(f.CUES_PARSED,{type:"captions",cues:s,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:i,timescale:s}){const{unparsedVttFrags:n}=this;"main"===r&&(this.initPTS[t.cc]={baseTime:i,timescale:s}),n.length&&(this.unparsedVttFrags=[],n.forEach(e=>{this.onFragLoaded(f.FRAG_LOADED,e)}))}getExistingTrack(e){const{media:t}=this;if(t)for(let r=0;r{At(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=sa(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let r=0;re.textCodec===$n);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){const e=Vs(this.tracks,r);if(e)return void(this.tracks=r);if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const e=this.media?this.media.textTracks:null;this.tracks.forEach((t,r)=>{let i;if(e&&r({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}));this.hls.trigger(f.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),r=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&r)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const r="textTrack"+t[1],i=this.captionsProperties[r];i&&(i.label=e.name,e.lang&&(i.languageCode=e.lang),i.media=e)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:r,cea608Parser2:i,lastSn:s,lastPartIndex:n}=this;if(this.enabled&&r&&i&&t.frag.type===_t.MAIN){var a,o;const e=t.frag.sn,l=null!=(a=null==t||null==(o=t.part)?void 0:o.index)?a:-1;e===s+1||e===s&&l===n+1||(r.reset(),i.reset()),this.lastSn=e,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:r,payload:i}=t;if(r.type===_t.SUBTITLE)if(i.byteLength){const e=r.decryptdata,s="stats"in t;if(null==e||!e.encrypted||s){const e=this.tracks[r.level],s=this.vttCCs;s[r.cc]||(s[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),e&&e.textCodec===$n?this._parseIMSC1(r,i):this._parseVTTs(t)}}else this.hls.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;Vn(t,this.initPTS[e.cc],t=>{this._appendCues(t,e.level),r.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},t=>{T.log("Failed to parse IMSC1: "+t),r.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})}_parseVTTs(e){var t;const{frag:r,payload:i}=e,{initPTS:s,unparsedVttFrags:n}=this,a=s.length-1;if(!s[r.cc]&&-1===a)return void n.push(e);const o=this.hls,l=null!=(t=r.initSegment)&&t.data?Oe(r.initSegment.data,new Uint8Array(i)):i;Bn(l,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,e=>{this._appendCues(e,r.level),o.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},t=>{const s="Missing initPTS for VTT MPEGTS"===t.message;s?n.push(e):this._fallbackToIMSC1(r,i),T.log("Failed to parse VTT cue: "+t),s&&a>r.cc||o.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:t})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||Vn(t,this.initPTS[e.cc],()=>{r.textCodec=$n,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||"disabled"===r.mode)return;e.forEach(e=>Lt(r,e))}else{const i=this.tracks[t];if(!i)return;const s=i.default?"default":"subtitles"+t;r.trigger(f.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===_t.SUBTITLE&&this.onFragLoaded(f.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:r,cea608Parser2:i}=this;if(!this.enabled||!r||!i)return;const{frag:s,samples:n}=t;if(s.type!==_t.MAIN||"NONE"!==this.closedCaptionsForLevel(s))for(let a=0;awt(e[i],t,r))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==i){const{textTracks:e}=this;Object.keys(e).forEach(r=>wt(e[r],t,i))}}}extractCea608Data(e){const t=[[],[]],r=31&e[0];let i=2;for(let s=0;s0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const r=t.filter((t,r)=>this.isLevelAllowed(t)&&r<=e);return this.clientRect=null,na.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}isLevelAllowed(e){const t=this.restrictedLevels;return!t.some(t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height)}static getMaxLevelByMediaSize(e,t,r){if(null==e||!e.length)return-1;const i=(e,t)=>!t||(e.width!==t.width||e.height!==t.height);let s=e.length-1;for(let n=0;n=t||a.height>=r)&&i(a,e[n+1])){s=n;break}}return s}}class aa{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"===typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,r){const i=performance.now();if(t){if(this.lastTime){const e=i-this.lastTime,s=r-this.lastDroppedFrames,n=t-this.lastDecodedFrames,a=1e3*s/e,o=this.hls;if(o.trigger(f.FPS_DROP,{currentDropped:s,currentDecoded:n,totalDroppedFrames:r}),a>0&&s>o.config.fpsDroppedMonitoringThreshold*n){let e=o.currentLevel;T.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(f.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const oa="[eme]";class la{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=la.CDMCleanupPromise?[la.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=T.debug.bind(T,oa),this.log=T.log.bind(T,oa),this.warn=T.warn.bind(T,oa),this.error=T.error.bind(T,oa),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(f.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(f.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(f.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(f.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===G.WIDEVINE&&r)return r;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,r=t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(e,t,r)=>!!e&&r.indexOf(e)===t,i=t.map(e=>e.audioCodec).filter(r),s=t.map(e=>e.videoCodec).filter(r);return i.length+s.length===0&&s.push("avc1.42e01e"),new Promise((t,r)=>{const n=e=>{const a=e.shift();this.getMediaKeysPromise(a,i,s).then(e=>t({keySystem:a,mediaKeys:e})).catch(t=>{e.length?n(e):r(t instanceof da?t:new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))})};n(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if("function"!==typeof r){let e="Configured requestMediaKeySystemAccess is not a function "+r;return null===W&&"http:"===self.location.protocol&&(e="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(e))}return r(e,t)}getMediaKeysPromise(e,t,r){const i=q(e,t,r,this.config.drmSystemOptions),s=this.keySystemAccessPromises[e];let n=null==s?void 0:s.keySystemAccess;if(!n){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),n=this.requestMediaKeySystemAccess(e,i);const t=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch(t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)}),n.then(r=>{this.log(`Access for key-system "${r.keySystem}" obtained`);const i=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=r.createMediaKeys().then(t=>(this.log(`Media-keys created for "${e}"`),i.then(r=>r?this.setMediaKeysServerCertificate(t,e,r):t))),t.mediaKeys.catch(t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)}),t.mediaKeys})}return n.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${me.hexDump(e.keyId||[])}`);const i=r.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(r,s,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return me.hexDump(e.keyId)}updateKeySession(e,t){var r;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${me.hexDump((null==(r=e.decryptdata)?void 0:r.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,r)=>{const i=z(this.config),s=e.map(K).filter(e=>!!e&&-1!==i.indexOf(e));return this.getKeySystemSelectionPromise(s).then(({keySystem:e})=>{const i=Y(e);i?t(i):r(new Error(`Unable to find format for key-system "${e}"`))}).catch(r)})}loadKey(e){const t=e.keyInfo.decryptdata,r=this.getKeyIdString(t),i=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log("Starting session for key "+i);let s=this.keyIdToKeySessionPromise[r];return s||(s=this.keyIdToKeySessionPromise[r]=this.getKeySystemForKeyPromise(t).then(({keySystem:r,mediaKeys:s})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(r,s).then(()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:r,mediaKeys:s,decryptdata:t}),i="cenc";return this.generateRequestWithPreferredKeySession(e,i,t.pssh,"playlist-key")}))),s.catch(e=>this.handleError(e))),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof da?this.hls.trigger(f.ERROR,e.data):this.hls.trigger(f.ERROR,{type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){const t=K(e.keyFormat),r=t?[t]:z(this.config);return this.attemptKeySystemAccess(r)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=z(this.config)),0===e.length)throw new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:r}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===r)return;let i,s;if("sinf"===t&&this.config.drmSystems[G.FAIRPLAY]){const e=_e(new Uint8Array(r));try{const t=F(JSON.parse(e).sinf),r=ke(new Uint8Array(t));if(!r)return;i=r.subarray(8,24),s=G.FAIRPLAY}catch(d){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=Ke(r);if(null===e)return;0===e.version&&e.systemId===V.WIDEVINE&&e.data&&(i=e.data.subarray(8,24)),s=H(e.systemId)}if(!s||!i)return;const n=me.hexDump(i),{keyIdToKeySessionPromise:a,mediaKeySessions:o}=this;let l=a[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(e,t,r,"encrypted-event-key-match"));break}}l||(l=a[n]=this.getKeySystemSelectionPromise([s]).then(({keySystem:e,mediaKeys:s})=>{var a;this.throwIfDestroyed();const o=new He("ISO-23001-7",n,null!=(a=Y(e))?a:"");return o.pssh=new Uint8Array(r),o.keyId=i,this.attemptSetMediaKeys(e,s).then(()=>{this.throwIfDestroyed();const i=this.createMediaKeySessionContext({decryptdata:o,keySystem:e,mediaKeys:s});return this.generateRequestWithPreferredKeySession(i,t,r,"encrypted-event-no-match")})})),l.catch(e=>this.handleError(e))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(r).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(e=>-1===r.indexOf(e))})}generateRequestWithPreferredKeySession(e,t,r,i){var s,n;const a=null==(s=this.config.drmSystems)||null==(n=s[e.keySystem])?void 0:n.generateRequest;if(a)try{const i=a.call(this.hls,t,r,e);if(!i)throw new Error("Invalid response from configured generateRequest filter");t=i.initDataType,r=e.decryptdata.pssh=i.initData?new Uint8Array(i.initData):null}catch(c){var o;if(this.warn(c.message),null!=(o=this.hls)&&o.config.debug)throw c}if(null===r)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${l} (init data type: ${t} length: ${r?r.byteLength:null})`);const d=new ws;e.mediaKeysSession.onmessage=t=>{const r=e.mediaKeysSession;if(!r)return void d.emit("error",new Error("invalid state"));const{messageType:i,message:s}=t;this.log(`"${i}" message event for session "${r.sessionId}" message size: ${s.byteLength}`),"license-request"===i||"license-renewal"===i?this.renewLicense(e,s).catch(e=>{this.handleError(e),d.emit("error",e)}):"license-release"===i?e.keySystem===G.FAIRPLAY&&(this.updateKeySession(e,$("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${i}"`)},e.mediaKeysSession.onkeystatuseschange=t=>{const r=e.mediaKeysSession;if(!r)return void d.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const i=e.keyStatus;d.emit("keyStatus",i),"expired"===i&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const h=new Promise((e,t)=>{d.on("error",t),d.on("keyStatus",r=>{r.startsWith("usable")?e():"output-restricted"===r?t(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===r?t(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${r}"`)):"expired"===r?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${r}"`)})});return e.mediaKeysSession.generateRequest(t,r).then(()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)}).catch(e=>{throw new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},"Error generating key-session request: "+e)}).then(()=>h).catch(t=>{throw d.removeAllListeners(),this.removeSession(e),t}).then(()=>(d.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,r)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${me.hexDump("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))} session keyId: ${me.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,r=t.loader,i=new r(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching serverCertificate for "${e}"`),new Promise((r,n)=>{const a={responseType:"arraybuffer",url:s},l=t.certLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(e,t,i,s)=>{r(e.data)},onError:(t,r,i,l)=>{n(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:o({url:a.url,data:void 0},t)},`"${e}" certificate request failed (${s}). Status: ${t.code} (${t.text})`))},onTimeout:(t,r,i)=>{n(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(e,t,r)=>{n(new Error("aborted"))}};i.load(a,d,h)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((i,s)=>{e.setServerCertificate(r).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${null==r?void 0:r.byteLength}) on "${t}"`),i(e)}).catch(e=>{s(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(t=>this.updateKeySession(e,new Uint8Array(t)).catch(e=>{throw new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))}setupLicenseXHR(e,t,r,i){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,r,i)}).catch(n=>{if(!r.decryptdata)throw n;return e.open("POST",t,!0),s.call(this.hls,e,t,r,i)}).then(r=>{e.readyState||e.open("POST",t,!0);const s=r||i;return{xhr:e,licenseChallenge:s}}):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((i,s)=>{const n=this.getLicenseServerUrl(e.keySystem);this.log("Sending license request to URL: "+n);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let t=a.response;this.log("License received "+(t instanceof ArrayBuffer?t.byteLength:t));const r=this.config.licenseResponseCallback;if(r)try{t=r.call(this.hls,a,n,e)}catch(o){this.error(o)}i(t)}else{const o=r.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)s(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:n,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${n}). Status: ${a.status} (${a.statusText})`));else{const r=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${r} attempts left`),this.requestLicense(e,t).then(i,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,n,e,t).then(({xhr:e,licenseChallenge:t})=>{e.send(t)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},He.clearKeyUriToKeyIdMap();const r=t.length;la.CDMCleanupPromise=Promise.all(t.map(e=>this.removeSession(e)).concat(null==e?void 0:e.setMediaKeys(null).catch(t=>{this.log(`Could not clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)}))).then(()=>{r&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(t=>{this.log(`Could not close sessions and clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e),[]);this.log("Selecting key-system from session-keys "+e.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r}=e;if(t){this.log("Remove licenses and keys and close session "+t.sessionId),t.onmessage=null,t.onkeystatuseschange=null,r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(e=>{this.log("Could not remove session: "+e)}).then(()=>t.close()).catch(e=>{this.log("Could not close session: "+e)})}}}la.CDMCleanupPromise=void 0;class da extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}const ha=1;var ca={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const ua="h";class fa{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:ca.MANIFEST,su:!this.initialized})}catch(t){T.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=e=>{try{const t=e.frag,r=this.hls.levels[t.level],i=this.getObjectType(t),s={d:1e3*t.duration,ot:i};i!==ca.VIDEO&&i!==ca.AUDIO&&i!=ca.MUXED||(s.br=r.bitrate/1e3,s.tb=this.getTopBandwidth(i)/1e3,s.bl=this.getBufferLength(i)),this.apply(e,s)}catch(t){T.warn("Could not generate segment CMCD data.",t)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;null!=r&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||fa.uuid(),this.cid=r.contentId,this.useHeaders=!0===r.useHeaders,this.registerListeners())}registerListeners(){const e=this.hls;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHED,this.onMediaDetached,this),e.on(f.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHED,this.onMediaDetached,this),e.off(f.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var r,i;this.audioBuffer=null==(r=t.tracks.audio)?void 0:r.buffer,this.videoBuffer=null==(i=t.tracks.video)?void 0:i.buffer}createData(){var e;return{v:ha,sf:ua,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){d(t,this.createData());const r=t.ot===ca.INIT||t.ot===ca.VIDEO||t.ot===ca.MUXED;if(this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering),this.useHeaders){const r=fa.toHeaders(t);if(!Object.keys(r).length)return;e.headers||(e.headers={}),d(e.headers,r)}else{const r=fa.toQuery(t);if(!r)return;e.url=fa.appendQueryToUri(e.url,r)}}getObjectType(e){const{type:t}=e;return"subtitle"===t?ca.TIMED_TEXT:"initSegment"===e.sn?ca.INIT:"audio"===t?ca.AUDIO:"main"===t?this.hls.audioTracks.length?ca.VIDEO:ca.MUXED:void 0}getTopBandwidth(e){let t,r=0;const i=this.hls;if(e===ca.AUDIO)t=i.audioTracks;else{const e=i.maxAutoLevel,r=e>-1?e+1:i.levels.length;t=i.levels.slice(0,r)}for(const s of t)s.bitrate>r&&(r=s.bitrate);return r>0?r:NaN}getBufferLength(e){const t=this.hls.media,r=e===ca.AUDIO?this.audioBuffer:this.videoBuffer;if(!r||!t)return NaN;const i=Or.bufferInfo(r,t.currentTime,this.config.maxBufferHole);return 1e3*i.len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,i){t(e),this.loader.load(e,r,i)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,i){t(e),this.loader.load(e,r,i)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],r=e=>!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e,i=e=>Math.round(e),s=e=>100*i(e/100),n=e=>encodeURIComponent(e),a={br:i,d:i,bl:s,dl:s,mtp:s,nor:n,rtp:s,tb:i},o=Object.keys(e||{}).sort();for(const l of o){let i=e[l];if(!r(i))continue;if("v"===l&&1===i)continue;if("pr"==l&&1===i)continue;const s=a[l];s&&(i=s(i));const n=typeof i;let o;o="ot"===l||"sf"===l||"st"===l?`${l}=${i}`:"boolean"===n?l:"number"===n?`${l}=${i}`:`${l}=${JSON.stringify(i)}`,t.push(o)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),r={},i=["Object","Request","Session","Status"],s=[{},{},{},{}],n={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};for(const a of t){const t=null!=n[a]?n[a]:1;s[t][a]=e[a]}for(let a=0;at!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:r}=t;null!==r&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((null==r?void 0:r.action)===fr.SendAlternateToPenaltyBox&&r.flags===pr.MoveAllAlternatesMatchingHost){let e=this.pathwayPriority;const t=this.pathwayId;this.penalizedPathways[t]||(this.penalizedPathways[t]=performance.now()),!e&&this.levels&&(e=this.levels.reduce((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e),[])),e&&e.length>1&&(this.updatePathwayPriority(e),r.resolved=this.pathwayId!==t)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){let t;this.pathwayPriority=e;const r=this.penalizedPathways,i=performance.now();Object.keys(r).forEach(e=>{i-r[e]>pa&&delete r[e]});for(let s=0;s0){this.log(`Setting Pathway to "${i}"`),this.pathwayId=i,this.hls.trigger(f.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[n];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=n);break}}}clonePathways(e){const t=this.levels;if(!t)return;const r={},i={};e.forEach(e=>{const{ID:s,"BASE-ID":n,"URI-REPLACEMENT":a}=e;if(t.some(e=>e.pathwayId===s))return;const o=this.getLevelsForPathway(n).map(e=>{const t=d({},e);t.details=void 0,t.url=ya(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a);const n=new A(e.attrs);n["PATHWAY-ID"]=s;const o=n.AUDIO&&`${n.AUDIO}_clone_${s}`,l=n.SUBTITLES&&`${n.SUBTITLES}_clone_${s}`;o&&(r[n.AUDIO]=o,n.AUDIO=o),l&&(i[n.SUBTITLES]=l,n.SUBTITLES=l),t.attrs=n;const h=new Gt(t);return Er(h,"audio",o),Er(h,"text",l),h});t.push(...o),ga(this.audioTracks,r,a,s),ga(this.subtitleTracks,i,a,s)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;let i;this.loader&&this.loader.destroy(),this.loader=new r(t);try{i=new self.URL(e)}catch(d){return this.enabled=!1,void this.log("Failed to parse Steering Manifest URI: "+e)}if("data:"!==i.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+e)}const s={responseType:"json",url:i.href},n=t.steeringManifestLoadPolicy.default,a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,r,s)=>{this.log(`Loaded steering manifest: "${i}"`);const n=e.data;if(1!==n.VERSION)return void this.log(`Steering VERSION ${n.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=n.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=n;if(a)try{this.uri=new self.URL(a,i).href}catch(d){return this.enabled=!1,void this.log("Failed to parse Steering Manifest RELOAD-URI: "+a)}this.scheduleRefresh(this.uri||r.url),o&&this.clonePathways(o),l&&this.updatePathwayPriority(l)},onError:(e,t,r,i)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let s=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,s);else{const e=this.loader;if("function"===typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(s=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,r)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log("Requesting steering manifest: "+i),this.loader.load(s,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(e)},t)}}function ga(e,t,r,i){e&&Object.keys(t).forEach(s=>{const n=e.filter(e=>e.groupId===s).map(e=>{const n=d({},e);return n.details=void 0,n.attrs=new A(n.attrs),n.url=n.attrs.URI=ya(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",r),n.groupId=n.attrs["GROUP-ID"]=t[s],n.attrs["PATHWAY-ID"]=i,n});e.push(...n)})}function ya(e,t,r,i){const{HOST:s,PARAMS:n,[r]:a}=i;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return s&&!o&&(l.host=s),n&&Object.keys(n).sort().forEach(e=>{e&&l.searchParams.set(e,n[e])}),l.href}const va=/^age:\s*[\d.]+\s*$/im;class _a{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new I,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!this.stats.aborted)return s(r,t.url)}).catch(e=>(r.open("GET",t.url,!0),s(r,t.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(e=>{this.callbacks.onError({code:r.status,text:e.message},t,r,i)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const i=this.context.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:n}=r.loadPolicy;if(i)for(const a in i)e.setRequestHeader(a,i[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=s&&u(s)?s:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const i=t.readyState,s=this.config;if(!r.aborted&&i>=2&&(0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),4===i)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const i=t.status,n="text"!==t.responseType;if(i>=200&&i<300&&(n&&t.response||null!==t.responseText)){r.loading.end=Math.max(self.performance.now(),r.loading.first);const s=n?t.response:t.responseText,a="arraybuffer"===t.responseType?s.byteLength:s.length;if(r.loaded=r.total=a,r.bwEstimate=8e3*r.total/(r.loading.end-r.loading.first),!this.callbacks)return;const o=this.callbacks.onProgress;if(o&&o(r,e,s,t),!this.callbacks)return;const l={url:t.responseURL,data:s,code:i};this.callbacks.onSuccess(l,r,e,t)}else{const n=s.loadPolicy.errorRetry,a=r.retry;sr(n,a,!1,i)?this.retry(n):(T.error(`${i} while loading ${e.url}`),this.callbacks.onError({code:i,text:t.statusText},e,t,r))}}}loadtimeout(){var e;const t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry,r=this.stats.retry;if(sr(t,r,!0))this.retry(t);else{T.warn("timeout while loading "+this.context.url);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=rr(e,r.retry),r.retry++,T.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${r.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&va.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function Ea(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}const ba=/(\d+)-(\d+)\/(\d+)/;class Ta{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||wa,this.controller=new self.AbortController,this.stats=new I}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,r){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const s=Sa(e,this.controller.signal),n=r.onProgress,a="arraybuffer"===e.responseType,o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:d}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=l&&u(l)?l:d,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),r.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(s=>{this.response=this.loader=s;const o=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=d,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),r.onTimeout(i,e,this.response)},d-(o-i.loading.start)),!s.ok){const{status:e,statusText:t}=s;throw new Ra(t||"fetch, bad network response",e,s)}return i.loading.first=o,i.total=Aa(s.headers)||i.total,n&&u(t.highWaterMark)?this.loadProgressively(s,i,e,t.highWaterMark,n):a?s.arrayBuffer():"json"===e.responseType?s.json():s.text()}).then(s=>{const{response:a}=this;self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const l=s[o];l&&(i.loaded=i.total=l);const d={url:a.url,data:s,code:a.status};n&&!u(t.highWaterMark)&&n(i,e,s,a),r.onSuccess(d,i,e,a)}).catch(t=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const s=t&&t.code||0,n=t?t.message:null;r.onError({code:s,text:n},e,t?t.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,i=0,s){const n=new Bs,a=e.body.getReader(),o=()=>a.read().then(a=>{if(a.done)return n.dataLength&&s(t,r,n.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=a.value,d=l.length;return t.loaded+=d,d=i&&s(t,r,n.flush(),e)):s(t,r,l,e),o()}).catch(()=>Promise.reject());return o()}}function Sa(e,t){const r={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(d({},e.headers))};return e.rangeEnd&&r.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),r}function La(e){const t=ba.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}function Aa(e){const t=e.get("Content-Range");if(t){const e=La(t);if(u(e))return e}const r=e.get("Content-Length");if(r)return parseInt(r)}function wa(e,t){return new self.Request(e.url,t)}class Ra extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const ka=/\s/,Ia={newCue(e,t,r,i){const s=[];let n,a,o,l,d;const h=self.VTTCue||self.TextTrackCue;for(let u=0;u=16?l--:l++;const i=xn(d.trim()),f=Nn(t,r,i);null!=e&&null!=(c=e.cues)&&c.getCueById(f)||(a=new h(t,r,i),a.id=f,a.line=u+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),s.push(a))}return e&&s.length&&(s.sort((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line),s.forEach(t=>Lt(e,t))),s}},Da={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},xa=o(o({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:_a,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Us,bufferController:en,capLevelController:na,errorController:mr,fpsController:aa,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:W,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:Da},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Ca()),{},{subtitleStreamController:zs,subtitleTrackController:qs,timelineController:ta,audioStreamController:js,audioTrackController:Ks,emeController:la,cmcdController:fa,contentSteeringController:ma});function Ca(){return{cueHandler:Ia,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Pa(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=Oa(e),i=["manifest","level","frag"],s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(e=>{const i=("level"===e?"playlist":e)+"LoadPolicy",n=void 0===t[i],a=[];s.forEach(s=>{const o=`${e}Loading${s}`,l=t[o];if(void 0!==l&&n){a.push(o);const e=r[i].default;switch(t[i]={default:e},s){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l;break}}}),a.length&&T.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${i}": ${JSON.stringify(t[i])}`)}),o(o({},r),t)}function Oa(e){return e&&"object"===typeof e?Array.isArray(e)?e.map(Oa):Object.keys(e).reduce((t,r)=>(t[r]=Oa(e[r]),t),{}):e}function Ma(e){const t=e.loader;if(t!==Ta&&t!==_a)T.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{const t=Ea();t&&(e.loader=Ta,e.progressive=!0,e.enableSoftwareAES=!0,T.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class Fa{static get version(){return"1.4.12"}static isSupported(){return ri()}static get Events(){return f}static get ErrorTypes(){return p}static get ErrorDetails(){return m}static get DefaultConfig(){return Fa.defaultConfig?Fa.defaultConfig:xa}static set DefaultConfig(e){Fa.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ws,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,b(e.debug||!1,"Hls instance");const t=this.config=Pa(Fa.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&Ma(t);const{abrController:r,bufferController:i,capLevelController:s,errorController:n,fpsController:a}=t,o=new n(this),l=this.abrController=new r(this),d=this.bufferController=new i(this),h=this.capLevelController=new s(this),c=new a(this),u=new Tt(this),p=new Mt(this),m=t.contentSteeringController,g=m?new m(this):null,y=this.levelController=new _r(this,g),v=new Sr(this),_=new xr(this.config),E=this.streamController=new Ms(this,v,_);h.setStreamController(E),c.setStreamController(E);const T=[u,y,E];g&&T.splice(1,0,g),this.networkControllers=T;const S=[l,d,h,c,p,v];this.audioTrackController=this.createController(t.audioTrackController,T);const L=t.audioStreamController;L&&T.push(new L(this,v,_)),this.subtitleTrackController=this.createController(t.subtitleTrackController,T);const A=t.subtitleStreamController;A&&T.push(new A(this,v,_)),this.createController(t.timelineController,S),_.emeController=this.emeController=this.createController(t.emeController,S),this.cmcdController=this.createController(t.cmcdController,S),this.latencyController=this.createController(Ft,S),this.coreComponents=S,T.push(o);const w=o.onErrorOut;"function"===typeof w&&this.on(f.ERROR,w,o)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,i){this._emitter.off(e,t,r,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){T.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:!1,event:e,error:r})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){T.log("destroy"),this.trigger(f.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){T.log("attachMedia"),this._media=e,this.trigger(f.MEDIA_ATTACHING,{media:e})}detachMedia(){T.log("detachMedia"),this.trigger(f.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,r=this.url,i=this.url=n.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});T.log("loadSource:"+i),t&&r&&(r!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(f.MANIFEST_LOADING,{url:e})}startLoad(e=-1){T.log(`startLoad(${e})`),this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){T.log("stopLoad"),this.networkControllers.forEach(e=>{e.stopLoad()})}swapAudioCodec(){T.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){T.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){T.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){T.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){T.log("set loadLevel:"+e),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){T.log("set firstLevel:"+e),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){T.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(T.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Nt.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const r=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let i;if(i=-1===t&&e&&e.length?e.length-1:t,r)for(let s=i;s--;){const t=e[s].attrs["HDCP-LEVEL"];if(t&&t<=r)return s}return i}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Fa.defaultConfig=void 0},ae74:function(e,t,r){var i=r("24fb");t=i(!1),t.push([e.i,'/*!\n* Mui Player Css Library v1.8.1 @Professional edition\n* Date:2023-01-28\n* Released under GPL-3.0 license\n* https://muiplayer.js.org/\n*/.m-player{width:auto;height:225px;position:relative;overflow:hidden;background:#000;outline:none;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.m-player .mplayer-footer{color:#fff;position:absolute;bottom:0;right:0;left:0;background:linear-gradient(180deg,hsla(0,0%,100%,0),rgba(0,0,0,.65));-webkit-transform:translateY(50px);transform:translateY(50px);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;z-index:7;height:48px;padding:0 10px}.m-player .mplayer-footer.show{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}.m-player .mplayer-footer .progress{display:flex;align-items:center;justify-content:space-between;height:inherit}.m-player .mplayer-footer .progress .progress-container{display:flex;align-items:center;flex:1;height:25px}.m-player .mplayer-footer .progress .progress-container.upper-position{position:absolute;left:20px;right:20px;bottom:100%;margin-bottom:-10.5px}.m-player .mplayer-footer .progress .progress-container .touch-effective{position:relative;height:100%;display:flex;flex:1;align-items:center;margin-left:8px;margin-right:8px;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-default-scale{border-radius:0!important;-webkit-transform:translateY(-50%) translateZ(0) scaleY(2)!important;transform:translateY(-50%) translateZ(0) scaleY(2)!important}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-hover-scale{-webkit-transform:translateY(-50%) translateZ(0) scaleY(3)!important;transform:translateY(-50%) translateZ(0) scaleY(3)!important}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-total{width:100%;background-color:hsla(0,0%,100%,.2);overflow:hidden}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-play,.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-total{position:absolute;height:2px;border-radius:5px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-buffered{background-color:hsla(0,0%,71%,.7);position:absolute;height:2px;border-top-left-radius:5px;border-bottom-left-radius:5px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:width .15s,-webkit-transform;transition:transform,width .15s;transition:transform,width .15s,-webkit-transform}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-prompt{position:absolute;height:2px;width:9px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;z-index:6}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-seekline{position:absolute;background-color:#ddd;height:2px;width:3px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:left 0s linear;z-index:5;visibility:hidden}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container{position:absolute;height:100%;width:100%}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag{height:30px;width:30px;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;z-index:7}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag.hover-scale,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag.hover-scale{-webkit-transform:translate(-50%,-50%) scale(1)!important;transform:translate(-50%,-50%) scale(1)!important}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag.default-scale,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag.default-scale{-webkit-transform:translate(-50%,-50%) scale(0);transform:translate(-50%,-50%) scale(0)}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag .progress-ball,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag .progress-ball{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);height:17px;width:17px;border-radius:50%;display:inline-block;background:#fff}.m-player .mplayer-footer .progress .progress-begin{font-size:13px;min-width:40px;text-align:left}.m-player .mplayer-footer .progress .progress-long{font-size:13px;min-width:40px;text-align:right}.m-player .mplayer-footer .progress .left-part,.m-player .mplayer-footer .progress .right-part{display:flex;height:inherit}.m-player .mplayer-footer .progress .left-part .footer-control,.m-player .mplayer-footer .progress .right-part .footer-control{position:relative}.m-player .mplayer-footer .progress .left-part .footer-control:not(.no-active):active,.m-player .mplayer-footer .progress .right-part .footer-control:not(.no-active):active{opacity:.75}.m-player .mplayer-footer .progress .left-part .footer-control svg,.m-player .mplayer-footer .progress .right-part .footer-control svg{vertical-align:middle}.m-player .mplayer-footer .progress .panel-controls{position:absolute;min-height:50px;bottom:50px;padding:12px;background-color:rgba(0,0,0,.6);border-radius:3px}.m-player .mplayer-footer .progress .live-mode{color:#fff;position:relative;font-size:14px;width:auto;white-space:nowrap}.m-player .mplayer-footer .progress .live-mode .spot{width:6px;height:6px;border-radius:50%;background:#1e98d4;margin-right:5px;display:inline-block;vertical-align:middle}.m-player .mplayer-footer .progress .live-mode .mode-text{display:inline-block;vertical-align:middle}.m-player .mplayer-header{background:linear-gradient(180deg,rgba(0,0,0,.5),hsla(0,0%,100%,0));padding:0 10px;height:60px;position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;-webkit-transform:translateY(-50px);transform:translateY(-50px);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;z-index:7}.m-player .mplayer-header.show{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}.m-player .mplayer-header .title-groupt{height:100%}.m-player .mplayer-header .title-groupt .back-button{white-space:nowrap;width:auto}.m-player .mplayer-header .title-groupt .back-button div,.m-player .mplayer-header .title-groupt .back-button svg{vertical-align:middle}.m-player .mplayer-header .title-groupt .back-button .title-name{position:relative;color:#fff;margin-left:5px;display:inline-block}.m-player .mplayer-header .buttom-group{display:flex;height:100%}.m-player .mplayer-header .buttom-group .battery-info{display:flex;flex-direction:column;align-items:center;justify-content:center;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:right;transform-origin:right}.m-player .mplayer-header .buttom-group .battery-info .time{color:#fff;font-size:14px;position:relative;top:4px;right:0}.m-player .mplayer-header .buttom-group .battery-info .capacity{border:1px solid #fff;height:11px;width:24px;border-radius:2px;position:relative}.m-player .mplayer-header .buttom-group .battery-info .capacity:after{content:"";height:7px;width:2px;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);border-right:none;border-top-left-radius:3px;border-bottom-left-radius:3px;left:-3px;background:#fff}.m-player .mplayer-header .buttom-group .battery-info .capacity .level{position:absolute;top:1px;bottom:1px;left:1px;right:1px}.m-player .mplayer-header .buttom-group .battery-info .capacity .level .count{background:#fff;height:100%;width:0;float:right;border-top-right-radius:1px;border-bottom-right-radius:1px}.m-player .mplayer-sidebar{display:block;position:absolute;top:0;bottom:0;right:0;background-color:rgba(0,0,0,.75);z-index:8;-webkit-transform:translateX(100%);transform:translateX(100%);transition:-webkit-transform .4s ease;transition:transform .4s ease;transition:transform .4s ease,-webkit-transform .4s ease;overflow:auto}.m-player .mplayer-sidebar.open{-webkit-transform:none!important;transform:none!important}.m-player .mplayer-sidebar::-webkit-scrollbar{width:4px;background:transparent}.m-player .mplayer-sidebar::-webkit-scrollbar-thumb{background:rgba(230,230,250,.24);border-radius:3px;height:100px}.m-player .mplayer-sidebar .title{color:#9a9e98;font-size:15px;line-height:40px;position:relative;margin-left:20px;margin-right:50px;text-align:left}.m-player .mplayer-sidebar .title:before{content:"";border-bottom:1px solid hsla(0,0%,87%,.3);position:absolute;left:0;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.m-player .mplayer-sidebar .setting-box{font-size:15px;color:#fff;display:flex;flex-wrap:wrap;align-items:center;margin:15px 50px 20px 20px}.m-player .mplayer-sidebar .setting-box .box-name{margin-left:12px;flex:1;text-align:left}.m-player .mplayer-sidebar .setting-box .toogle-switch{margin-left:12px;cursor:pointer;border-radius:50px;width:45px;height:22px;position:relative;transition:background-color .2s ease-in}.m-player .mplayer-sidebar .setting-box .toogle-switch.open .ball{right:3px}.m-player .mplayer-sidebar .setting-box .toogle-switch.close{background-color:hsla(0,0%,100%,.3)!important}.m-player .mplayer-sidebar .setting-box .toogle-switch.close .ball{right:24px}.m-player .mplayer-sidebar .setting-box .toogle-switch .ball{border-radius:50px;height:18px;width:18px;border-radius:50%;background:#fff;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);transition:right .2s ease-in}.m-player .mplayer-sidebar .setting-box .toogle-switch .disable{position:absolute;top:0;bottom:0;right:0;left:0;border-radius:50px;background:rgba(0,0,0,.6)}.m-player .mplayer-sidebar .setting-box .play-speed{cursor:pointer;font-size:16px;height:35px;width:48px;display:flex;justify-content:center;align-items:center;border-radius:5px;margin-right:4px;flex-shrink:0}.m-player .mplayer-sidebar .setting-box .share-box{cursor:pointer;height:45px;width:45px;display:flex;justify-content:center;align-items:center;margin-right:22px;margin-bottom:12px;flex-shrink:0}.m-player .mp-tooltip{position:absolute;font-size:12px;white-space:nowrap;background-color:rgba(0,0,0,.73);padding:3px 10px;display:block;color:#fff;z-index:9;border-radius:3px;pointer-events:none}.m-player .player-btn{position:relative;cursor:pointer;border:none;background-color:initial;padding:0;padding:0 11px;outline:0;width:45px;min-width:45px;height:inherit;font-size:14px}.m-player .player-btn:focus{outline:none}.m-player .player-btn::-moz-focus-inner{border:0;outline:0}.m-player .mplayer-poster{position:absolute;top:0;bottom:0;left:0;right:0;background:#000}.m-player .mplayer-poster:before{content:"";position:absolute;top:0;bottom:0;left:0;right:0;background:rgba(0,0,0,.4)}.m-player .mplayer-cover{position:absolute;top:0;bottom:0;left:0;right:0;background:#000;z-index:8;opacity:0;transition:opacity .2s;pointer-events:none}.m-player .mplayer-time{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:8;opacity:0}.m-player .mplayer-time .time{color:#fff;font-size:26px;text-align:center;white-space:nowrap}.m-player .mplayer-time .time-progress{margin:auto;height:3px;background:hsla(0,0%,100%,.6);width:180px;border-radius:50px;margin-top:9px;overflow:hidden}.m-player .mplayer-time .time-progress .time-total{background:#fff;height:100%;width:50%;border-top-left-radius:50px;border-bottom-left-radius:50px}.m-player .small-control{height:32px;position:absolute;width:143px;top:15%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border-radius:50px;background-color:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;opacity:0;z-index:7}.m-player .small-control .progress{border-radius:50px;overflow:hidden;height:3px;width:96px;background:hsla(0,0%,87%,.85);margin-left:6px}.m-player .small-control .progress .total{width:50%;height:100%;background:#fff}.m-player .mplayer-loading{color:#1e98d4;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:100%;max-height:100%;display:none;z-index:8}@-webkit-keyframes mp-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mp-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes mp-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}to{stroke-dasharray:90,150;stroke-dashoffset:-120}}@keyframes mp-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}to{stroke-dasharray:90,150;stroke-dashoffset:-120}}.m-player .mplayer-loading .mplayer-loading__circular{width:40px;height:40px;-webkit-animation:mp-rotate 1.8s linear infinite;animation:mp-rotate 1.8s linear infinite}.m-player .mplayer-loading .mplayer-loading__circular circle{-webkit-animation:mp-circular 1.5s ease-in-out infinite;animation:mp-circular 1.5s ease-in-out infinite;stroke:currentColor;stroke-width:3;stroke-linecap:round}.m-player .mplayer-toast{padding:7px 12px;background-color:rgba(80,80,77,.9);position:absolute;bottom:18%;color:#fff;border-radius:50px;font-size:14px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);-webkit-animation:mplayerToast .25s;animation:mplayerToast .25s;z-index:10}@-webkit-keyframes mplayerToast{0%{bottom:-18%}to{bottom:18%}}@keyframes mplayerToast{0%{bottom:-18%}to{bottom:18%}}.m-player .mplayer-left{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);transition:left .3s;opacity:0;z-index:7}.m-player .mplayer-left ._unlock,.m-player .mplayer-left .control-icon ._lock{height:38px;width:38px;border-radius:50%;background-color:rgba(0,0,0,.3);display:flex;justify-content:center;align-items:center;cursor:pointer}.m-player .mplayer-error{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff;z-index:10;font-size:13px;text-align:center;display:none;opacity:1;-webkit-animation:mplayerError .7s;animation:mplayerError .7s}@-webkit-keyframes mplayerError{0%{opacity:0}to{opacity:1}}@keyframes mplayerError{0%{opacity:0}to{opacity:1}}.m-player .mplayer-error .errop-tip{height:25px}.m-player .mplayer-error:active{opacity:.75}.m-player .mini-progress{height:2px;position:absolute;bottom:0;left:0;right:0;-webkit-transform:translateY(.3px);transform:translateY(.3px);opacity:0;z-index:7}.m-player .mini-progress .mini-total{position:absolute;background-color:hsla(0,0%,100%,.2);width:100%;height:100%}.m-player .mini-progress .mini-buffered{position:absolute;background-color:hsla(0,0%,71%,.5);height:100%}.m-player .mini-progress .mini-play{position:absolute;height:100%}@-webkit-keyframes mp-bezel-fadeout{0%{opacity:1}to{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}}@keyframes mp-bezel-fadeout{0%{opacity:1}to{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}}.m-player .mp-bezel-text-hide .mp-bezel{z-index:10;position:absolute;left:50%;top:50%;width:52px;height:52px;margin-left:-26px;margin-top:-26px;background:rgba(0,0,0,.6);border-radius:26px;-webkit-animation:mp-bezel-fadeout .4s linear 1 normal forwards;animation:mp-bezel-fadeout .4s linear 1 normal forwards;pointer-events:none}.m-player .mp-bezel-text-hide .mp-bezel .mp-bezel-icon{width:24px;height:24px;margin:14px}.m-player .mp-bezel-text-hide .mp-bezel .mp-bezel-icon .mp-svg-shadow{stroke:#000;stroke-opacity:.15;stroke-width:2px;fill:none}.m-player .ctxmenu-wrapper{position:absolute;top:0;bottom:0;left:0;right:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:none}.m-player .ctxmenu-wrapper .ctxmenulist{text-align:left;position:absolute;list-style:none;font-size:14px;background:rgba(28,28,28,.9);text-shadow:0 0 2px rgba(0,0,0,.5);color:#eee;border-radius:2px;margin:0;padding:0;min-width:170px;transition:opacity .1s;opacity:0;outline:0;z-index:9}.m-player .ctxmenu-wrapper .ctxmenulist li{padding:9px 30px;cursor:pointer}.m-player .ctxmenu-wrapper .ctxmenulist li:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.m-player .ctxmenu-wrapper .ctxmenulist li:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.m-player .ctxmenu-wrapper .ctxmenulist li:hover{background-color:hsla(0,0%,100%,.1)}.m-player .mplayer-shortcut{text-align:left;font-size:16px;background:rgba(28,28,28,.9);text-shadow:0 0 2px rgba(0,0,0,.5);color:#eee;border-radius:3px;padding:15px 0 15px 20px;position:absolute;top:10px;left:10px;z-index:8;display:none;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;width:430px;max-width:calc(100% - 40px)}.m-player .mplayer-shortcut .title{margin:0;padding-bottom:10px}.m-player .mplayer-shortcut .close-shortcut-panel{position:absolute;top:15px;right:15px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:24px;height:24px}.m-player .mplayer-shortcut .close-shortcut-panel:active{opacity:.8}.m-player .mplayer-shortcut ul{list-style:none;margin:0 0 2px;padding:0;font-size:14px}.m-player .mplayer-shortcut ul li{display:inline-block;height:28px;line-height:28px;width:50%}.m-player .mplayer-shortcut ul li span{color:#999}.m-player .mp-popup-animation{transition:all .25s cubic-bezier(0,0,.2,1)}.m-player .popup-toggle{transition:opacity .1s cubic-bezier(0,0,.2,1)!important}.m-player .mp-popup{border-radius:2px;overflow:hidden;position:absolute;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:width,height;background:rgba(28,28,28,.9);opacity:0;min-width:42px}.m-player .mp-popup .mp-panel{min-width:260px}.m-player .mp-popup .mp-panel.mp-panel-child .mp-menuitem{padding-left:14.5%}.m-player .mp-popup .mp-panel.mp-panel-item{position:absolute;bottom:0;right:0;overflow-y:auto;overflow-x:hidden}.m-player .mp-popup .mp-panel.mp-panel-item::-webkit-scrollbar{width:8px;background-color:#424242}.m-player .mp-popup .mp-panel.mp-panel-item::-webkit-scrollbar-thumb{background-color:#8e8e8e;border:1px solid #424242;border-radius:3px}.m-player .mp-popup .mp-panel.mp-panel-item::-webkit-scrollbar-track{background-color:#424242}.m-player .mp-popup .mp-panel.mp-panel-item .mp-panel-selected{background-size:8%;background-repeat:no-repeat;background-position:4%;vertical-align:middle;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTkgMTYuMkw0LjggMTJsLTEuNCAxLjRMOSAxOSAyMSA3bC0xLjQtMS40TDkgMTYuMnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.m-player .mp-popup .mp-panel.mp-panel-item .mp-panel-header{height:50px;padding-left:0;line-height:50px}.m-player .mp-popup .mp-panel.mp-panel-item .mp-panel-header:before{content:"";position:absolute;border-bottom:1px solid #fff;left:0;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);opacity:.2;z-index:100}.m-player .mp-popup .mp-panel .mp-menuitem{position:relative;list-style:none;color:#eee;margin:0;padding:0;display:flex;justify-content:space-between;align-items:center;padding-left:10%;height:40px;line-height:40px;white-space:nowrap;outline:none}.m-player .mp-popup .mp-panel .mp-menuitem:not(.mp-panel-header){cursor:pointer}.m-player .mp-popup .mp-panel .mp-menuitem:not(.mp-panel-header):hover{background-color:hsla(0,0%,100%,.1)}.m-player .mp-popup .mp-panel .mp-menuitem li{height:inherit;width:50%}.m-player .mp-popup .mp-panel .mp-menuitem li:first-child{padding-right:40px;white-space:pre;overflow:hidden;text-overflow:ellipsis;text-align:left}.m-player .mp-popup .mp-panel .mp-menuitem li:last-child{text-align:right}.m-player .mp-popup .mp-panel .mp-menuitem li .mp-menuitem-content{height:inherit}.m-player .mp-popup .mp-panel .mp-menuitem li .arrow-icon{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTEyLjU5IDIwLjM0bDQuNTgtNC41OS00LjU4LTQuNTlMMTQgOS43NWw2IDYtNiA2eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==);background-size:35%;background-repeat:no-repeat;background-position:100%;vertical-align:middle;padding-right:35%}.m-player .mp-popup .mp-panel .mp-menuitem li .left-arrow-icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTE5LjQxIDIwLjA5bC00LjU4LTQuNTkgNC41OC00LjU5TDE4IDkuNWwtNiA2IDYgNnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=);background-repeat:no-repeat;background-position:0;background-size:30%;padding-left:30%;text-align:left;cursor:pointer}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch{cursor:pointer;border-radius:50px;width:41px;height:20px;position:relative;display:inline-block;transition:background-color .2s ease-in;vertical-align:middle;right:13%}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch.close{background-color:hsla(0,0%,100%,.3)!important}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch.open .ball{right:4.83%}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch .ball{border-radius:50px;height:16px;width:16px;border-radius:50%;background:#fff;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);transition:right .15s ease-in;right:56.46%}.m-player .volume-container{width:100%;height:100%;border-radius:2px;color:#fff;text-align:center;outline:0;font-size:12px;padding-top:8px;padding-bottom:8px}.m-player .volume-container .volume-size{color:#fff}.m-player .volume-container .volume-capacity{cursor:pointer;height:100px;width:4px;background-color:#373838;border-radius:7px;margin:25% auto 0;position:relative}.m-player .volume-container .volume-capacity .volume-drag-ball{background-color:#fff;width:14px;height:14px;border-radius:50%;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:0;z-index:7}.m-player .volume-container .volume-capacity .progress-bar{border-radius:7px;position:absolute;bottom:0;left:0;right:0;height:0}.m-player .danmaku-controls{display:flex;flex-direction:row;align-items:center;font-size:12px;flex:0.65;margin:auto .82%}.m-player .danmaku-controls .dms-button:active{cursor:pointer;opacity:.85}.m-player .danmaku-controls .danmaku-input-wrap{position:relative;width:auto;height:34px;background-color:#111226;flex:1;flex-shrink:0;border-radius:50px;background:hsla(0,0%,100%,.25);color:#fff;margin-left:1.2%;display:flex}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text{height:100%;border:0;left:0;border-radius:50px 0 0 50px;flex:1;padding:0;margin:0;outline:0;background-color:initial;padding:0 12px;color:#fff;font-size:14px;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::-webkit-input-placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::-moz-placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::-ms-input-placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-btn-submit{top:0;right:0;width:66px;height:100%;border:none;border-radius:0 50px 50px 0;outline:0;background-color:#292a3c;color:#eee;cursor:pointer;margin-left:8px;position:relative}.m-player .danmaku-controls .danmaku-input-wrap .dms-btn-submit span{display:inline-block;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.m-player .mp-rolling{position:absolute;top:0;width:100%;color:#fff;overflow:hidden;z-index:6;-webkit-transform-origin:right;transform-origin:right}.m-player .mp-rolling .rolling-content{position:relative;white-space:nowrap;display:inline-block}.m-player .mp-logot-box{position:absolute;width:100%;height:100%;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);pointer-events:none;z-index:6}@-webkit-keyframes mp-logot-show{0%{opacity:.1}to{opacity:1}}@keyframes mp-logot-show{0%{opacity:.1}to{opacity:1}}.m-player .mp-logot-box .mp-logot{position:absolute;background-repeat:no-repeat;background-size:contain;opacity:0;-webkit-animation:mp-logot-show .35s linear both;animation:mp-logot-show .35s linear both;image-rendering:-moz-crisp-edges;image-rendering:-o-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;-ms-interpolation-mode:nearest-neighbor}.m-player .mp-logot-box .mp-logot.logot-top-right{right:1.5%;top:3%;-webkit-transform-origin:top right;transform-origin:top right}.m-player .mp-logot-box .mp-logot.logot-top-left{left:1.5%;top:3%;-webkit-transform-origin:top left;transform-origin:top left}.m-player .mp-logot-box .mp-logot.logot-bottom-left{left:1.5%;bottom:3%;-webkit-transform-origin:bottom left;transform-origin:bottom left}.m-player .mp-logot-box .mp-logot.logot-bottom-right{right:1.5%;bottom:3%;-webkit-transform-origin:bottom right;transform-origin:bottom right}.m-player .advertise-wrap{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:7;width:320px;height:240px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;overflow:hidden;background:rgba(0,0,0,.65);max-height:calc(100% - 40px);max-width:calc(100% - 40px);box-shadow:0 2px 5px 0 rgba(0,0,0,.16)}.m-player .advertise-wrap .ad-tip{position:absolute;bottom:3px;left:3px;display:inline-block;cursor:auto;height:20px;margin:0 2px 0 0;padding:0 4px;line-height:20px;font-size:12px;color:#fff;background:rgba(0,0,0,.5);border-radius:2px}.m-player .advertise-wrap .ad-close{position:absolute;right:4px;top:4px;cursor:pointer}.m-player .advertise-wrap .ad-close .ad-icon{width:18px;height:18px;padding:3px;border-radius:100%;vertical-align:middle;background:rgba(0,0,0,.5)}.m-player .advertise-wrap .ad-close .ad-icon path{transition:fill .3s}.m-player:-webkit-full-screen{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;box-sizing:border-box!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;width:100%!important;height:100%!important;-webkit-transform:none!important;transform:none!important;margin:0!important;padding:0!important;z-index:1000!important}.m-player:-webkit-full-screen uni-video{position:relative}.m-player.browser-fullscreen{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;box-sizing:border-box!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;width:100%!important;height:100%!important;-webkit-transform:none!important;transform:none!important;margin:0!important;padding:0!important;z-index:1000!important}.m-player.browser-fullscreen uni-video{position:relative}.m-player.page-fullscreen{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;box-sizing:border-box!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;width:100%!important;height:100%!important;-webkit-transform:none!important;transform:none!important;margin:0!important;padding:0!important;z-index:1000!important}.m-player.page-fullscreen uni-video{position:relative}.m-player.mp-keyboard-focus .keyboard-input:focus,.m-player.mp-keyboard-focus .mp-menuitem:focus{box-shadow:inset 0 0 0 2px rgba(27,127,204,.8)}.m-player .player-wrapper{height:100%;width:100%;position:relative}.m-player .player-wrapper.mplayer-miniwindow{position:fixed;transition-property:width,height,opacity,bottom,right,border-radius;will-change:bottom,right,border-radius;overflow:hidden;z-index:1000;border-radius:0;opacity:1;background:#000;box-shadow:0 2px 5px 0 rgba(0,0,0,.16)}.m-player .player-wrapper.mplayer-miniwindow.transition-disable{transition-property:none;cursor:move}.m-player .player-wrapper.mplayer-miniwindow .element-hidden,.m-player .player-wrapper.mplayer-miniwindow .mp-popup{visibility:hidden}.m-player .player-wrapper.mplayer-miniwindow uni-video{width:100%!important;height:100%!important}.m-player .player-wrapper.mplayer-miniwindow .scrim-layer{position:absolute;height:100%;width:100%;top:0;z-index:7;background-color:initial;transition-property:background-color;transition-duration:.08s;transition-timing-function:linear}.m-player .player-wrapper .video-wrapper{height:100%;display:flex;justify-content:center;align-items:center}.m-player .player-wrapper .video-wrapper uni-video{-o-object-fit:contain;object-fit:contain;display:block;opacity:0}.m-player .player-wrapper .video-wrapper uni-video.covered{height:100%!important;width:100%!important;-o-object-fit:cover;object-fit:cover}.m-player .player-wrapper .video-wrapper uni-video::cue{color:#fff;background:transparent;text-shadow:0 0 1px #000}.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-text-track-display{margin-top:-5px}.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-controls-overlay-play-button,.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-controls-start-playback-button,.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-controls-volume-slider,.m-player .player-wrapper .video-wrapper uni-video uni-video::-webkit-media-controls-mute-button{display:none}',""]),e.exports=t},bf15:function(module,exports,__webpack_require__){"use strict";(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__; +/*! +* Mui Player Javascript Library v1.8.1 @Professional edition +* Date:2023-01-28 +* Released under GPL-3.0 license +* https://muiplayer.js.org/ +*/function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0;t=function(){};return{s:t,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,n=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return n=e.done,e},e:function(e){a=!0,s=e},f:function(){try{n||null==r.return||r.return()}finally{if(a)throw s}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r',mplayerPoster:'
',mplayerCover:'\x3c!-- 媒体播放遮罩层 --\x3e
',mplayerLoading:'\x3c!-- Mplayer加载Loading --\x3e
',mplayerError:'\x3c!-- 视频加载错误显示 --\x3e
视频加载失败,点击刷新
',mplayerHeader:'\x3c!-- Mplayer 顶部导航 --\x3e
',mplayerFooter:'\x3c!-- Mplayer 底部操作控件 --\x3e',miniProgress:'\x3c!-- Mplayer 底部播放迷你进度条 --\x3e
\x3c!--加载进度条总长--\x3e
\x3c!--资源缓存进度--\x3e
\x3c!--播放进度--\x3e
'},$global=function(){return{first_authplay:!1,isReady:!1,webpagePlugin:{},mobilePlugin:{},cssAutoprefixer:["webkit","ms","moz","o"]}},element=function(){return{mPlayer:con,videoObject:con.querySelector("video"),mplayerCover:con.querySelector("#mplayer-cover"),mplayerPoster:con.querySelector("#mplayer-poster"),mplayerHeader:con.querySelector("#mplayer-header"),headerMenu:con.querySelector("#buttom-group"),backButton:con.querySelector("#back-button"),mplayerFooter:con.querySelector("#mplayer-footer"),progressContainer:con.querySelector("#progress-container"),playSwitch:con.querySelector("#play-switch"),fullSwitch:con.querySelector("#full-switch"),progressBall:con.querySelector("#progress-ball"),progressBegin:con.querySelector("#progress-begin"),progressLong:con.querySelector("#progress-long"),touchEffective:con.querySelector("#touch-effective"),progressBuffered:con.querySelector("#progress-buffered"),progressPlay:con.querySelector("#progress-play"),miniProgress:con.querySelector("#mini-progress"),miniBuffered:con.querySelector("#mini-buffered"),miniPlay:con.querySelector("#mini-play"),mplayerLoading:con.querySelector("#mplayer-loading"),mplayerError:con.querySelector("#mplayer-error")}},$el=new element,variable=function(){return{mediaPlayDirectives:0,isFullScreen:!1,showScreenControls:!1,ball_move_status:!1,isPlay:!1,mediaStatus:!1,duration:0,percentage:0,currentTime:0,playError:0,isDestroy:!1,isShowRightSidebar:!1,startX:null,startY:null,moveX:null,moveY:null,_defaultPlayProgressPro:null,isTouchMove:!1,isControlsTimer:!0}},$data=new variable,$method={getLanguageText:function(){return{"zh-cn":{srcNull:"视频地址为空",begin:"开始",end:"结束",live:"直播",settings:"设置",coveredPlay:"铺满播放",loopPlay:"循环播放",playbackSpeed:"播放速度",share:"分享",pictureInPicture:"画中画",exitPictureInPicture:"退出画中画",pageScreen:"网页全屏",exitPageScreen:"退出网页全屏",fullScreen:"全屏",exitFullScreen:"退出全屏",normal:"正常",open:"打开",subtitles:"字幕",selectLangage:"选择语言",dsps:"切换到默认倍速度播放",tsps:"切换到?倍速度播放",errorTip:"视频加载失败,点击刷新",shortcuts:"快捷键",shortcutsPanel:{title:"快捷功能",space:"空格",spaceAction:"播放/暂停",esc:"退出全屏",up:"音量增加5%",down:"音量减少5%",right:"快进5秒",left:"快退5秒"},advertise:"广告"},en:{srcNull:"Video address is empty",begin:"Begin",end:"End",live:"Live",settings:"Settings",coveredPlay:"Covered play",loopPlay:"Loop play",playbackSpeed:"Playback speed",share:"Share",pictureInPicture:"Picture in picture",exitPictureInPicture:"Exit picture in picture",pageScreen:"Page screen",exitPageScreen:"Exit page screen",fullScreen:"Full screen",exitFullScreen:"Exit full screen",normal:"Normal",open:"Open",subtitles:"Subtitles",selectLangage:"Select langage",dsps:"to default speed playback",tsps:"to ?x speed playback",errorTip:"Video failed to load, click refresh",shortcuts:"Shortcuts",shortcutsPanel:{title:"Shortcuts function",space:"Space",spaceAction:"play/pause",esc:"exit full screen",up:"voice increase 5%",down:"voice reduce 5%",right:"fast forward 5 seconds",left:"fast backward 5 seconds"},advertise:"Advertise"},"zh-tw":{srcNull:"視頻地址為空",begin:"開始",end:"結束",live:"直播",settings:"設置",coveredPlay:"鋪滿播放",loopPlay:"循環播放",playbackSpeed:"播放速度",share:"分享",pictureInPicture:"畫中畫",exitPictureInPicture:"退出畫中畫",pageScreen:"網頁全屏",exitPageScreen:"退出網頁全屏",fullScreen:"全屏",exitFullScreen:"退出全屏",normal:"正常",open:"打開",subtitles:"字幕",selectLangage:"選擇語言",dsps:"切換到默認倍速度播放",tsps:"切換到?倍速度播放",errorTip:"視頻加載失敗,點擊刷新",shortcuts:"快捷鍵",shortcutsPanel:{title:"快捷功能",space:"空格",spaceAction:"播放/暫停",esc:"退出全屏",up:"音量增加5%",down:"音量减少5%",right:"快進5秒",left:"快退5秒"},advertise:"廣告"}}},getLangObject:function(){var e=option.lang||navigator.language||navigator.browserLanguage||"zh-cn";return-1!=["zh-cn","en","zh-tw"].indexOf(e.toLowerCase())?$method.getLanguageText()[e.toLowerCase()]:$method.getLanguageText()["zh-cn"]},initCreateMplayer:function(e){for(var t=$node.video+$node.mplayerPoster+$node.mplayerCover+$node.mplayerLoading+$node.mplayerError+$node.mplayerHeader+$node.mplayerFooter+$node.miniProgress,r=(t=$node.logWrite?t+$node.logWrite:t,0);r/g,""),t=$method.createRangeIsDocFragment(t),t=$method.initConifgAttribute(t,e),t=$method.initConfigControl(t),t=$method.initConfigCustom(t),t=$method.initConfigTheme(t),e={option:option,_this:_this,$el:element,$data:$data,$method:$method,$habit:$habit,$CONSTANT:$CONSTANT},mobilePlugin&&(t=mobilePlugin.appendTemplate(t,e)),webpagePlugin&&(t=webpagePlugin.appendTemplate(t,e)),e=con.querySelector("#mplayer-media-wrapper"),e&&$method.removeNode(con,"#mplayer-media-wrapper"),(e=document.createElement("div")).setAttribute("id","mplayer-media-wrapper"),e.setAttribute("class","player-wrapper"),e.appendChild(t),$el.mPlayer.appendChild(e),option.src?($method.playerReady(),setTimeout((function(){_this._global_.isReady=!0,_this.emit("ready"),setTimeout((function(){$method.onScreenResize({type:"showControls"}),$method.removeOriginControls()}),10)}),100)):$method.showToast($method.getLangObject().srcNull)},onAction:function(){},removeOriginControls:function(){$el.videoObject.removeAttribute("controls")},playerReady:function(){$method.resetVariable(),!0===option.autoplay&&($data.mediaPlayDirectives=1,$method.onPlay()),$method.toggleEventListenerGlobal("add","playerReady"),$method.toggleEventListenerCustom("add"),$method.nodesObserver()},overloadingEl:function(){$el=new element;for(var e=0,t=Object.keys($el);es.toFixed(2)?(a.videoWidth=r.toFixed(),a.videoHeight=(r*s).toFixed()):(n.toFixed(2)$data.currentTime){r=r/$data.duration*100,$el.progressBuffered.style.width=r+"%",$el.miniBuffered.style.width=r+"%";break}}}},showLoading:function(){"inline-block"!=$el.mplayerLoading.style.display&&($el.mplayerLoading.style.display="inline-block")},hideLoading:function(){"none"!=$el.mplayerLoading.style.display&&($el.mplayerLoading.style.display="none")},showCover:function(){$el.mplayerCover.style.opacity<=0&&($el.mplayerCover.style.zIndex=8,$el.mplayerCover.style.opacity=.2)},hideCover:function(){"0"!=$el.mplayerCover.style.opacity&&($el.mplayerCover.style.opacity=0,$el.mplayerCover.style.zIndex=-1)},showToast:function(){var e=0=0;i--){var s=e[i];"."===s?e.splice(i,1):".."===s?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function i(e){"string"!==typeof e&&(e+="");var t,r=0,i=-1,s=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!s){r=t+1;break}}else-1===i&&(s=!1,i=t+1);return-1===i?"":e.slice(r,i)}function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;i=-1&&!i;n--){var a=n>=0?arguments[n]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=r(s(t.split("/"),(function(e){return!!e})),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===n(e,-1);return e=r(s(e.split("/"),(function(e){return!!e})),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(s(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function i(e){for(var t=0;t=0;r--)if(""!==e[r])break;return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var s=i(e.split("/")),n=i(r.split("/")),a=Math.min(s.length,n.length),o=a,l=0;l=1;--n)if(t=e.charCodeAt(n),47===t){if(!s){i=n;break}}else s=!1;return-1===i?r?"/":".":r&&1===i?"/":e.slice(0,i)},t.basename=function(e,t){var r=i(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,r=0,i=-1,s=!0,n=0,a=e.length-1;a>=0;--a){var o=e.charCodeAt(a);if(47!==o)-1===i&&(s=!1,i=a+1),46===o?-1===t?t=a:1!==n&&(n=1):-1!==t&&(n=-1);else if(!s){r=a+1;break}}return-1===t||-1===i||0===n||1===n&&t===i-1&&t===r+1?"":e.slice(t,i)};var n="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r("4362"))},e2e5:function(e,t,r){"use strict";r("7a82");var i=r("ee27").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r("3315");var s=i(r("bf15")),n=i(r("fc78")),a=i(r("a567"));t.default={props:{url:{type:String,default:null},type:{type:String}},mounted:function(){this.videoPlayer()},methods:{videoPlayer:function(){var e=this;if("iframe"==this.type)console.log("=====");else{var t={};t="m3u8"==this.type?{type:"hls",loader:a.default,config:{debug:!1}}:{type:"flv",loader:n.default,config:{debug:!1}},this.mp=new s.default({container:this.$refs.muiPlayer,live:!0,src:this.url,autoplay:!0,muted:!0,parse:t,pageHead:!1,width:"100%",height:"100%",autoFit:!1,objectFit:"contain",videoAttribute:[{attrKey:"webkit-playsinline",attrValue:"webkit-playsinline"},{attrKey:"playsinline",attrValue:"playsinline"},{attrKey:"x5-video-player-type",attrValue:"h5-page"}],custom:{footerControls:[{style:{}}]}});var r=this.mp.video();this.$nextTick((function(){e.mp.on("ready",(function(t){r.play(),r.addEventListener("play",(function(t){e.$emit("onPlayFn")})),r.addEventListener("ended",(function(t){e.$emit("onEndedFn")}))}))}))}}}}},e52e:function(e,t,r){"use strict";r.r(t);var i=r("d4f0"),s=r.n(i);for(var n in i)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(n);t["default"]=s.a},fc78:function(e,t,r){(function(t){(function(t,r){e.exports=r()})(self,(function(){return function(){var e={"./node_modules/es6-promise/dist/es6-promise.js": +/*!******************************************************!*\ + !*** ./node_modules/es6-promise/dist/es6-promise.js ***! + \******************************************************/function(e,r,i){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */ +(function(t,r){e.exports=r()})(0,(function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function r(e){return"function"===typeof e}var s=void 0;s=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var n=s,a=0,o=void 0,l=void 0,d=function(e,t){T[a]=e,T[a+1]=t,a+=2,2===a&&(l?l(S):A())};function h(e){l=e}function c(e){d=e}var u="undefined"!==typeof window?window:void 0,f=u||{},p=f.MutationObserver||f.WebKitMutationObserver,m="undefined"===typeof self&&"undefined"!==typeof t&&"[object process]"==={}.toString.call(t),g="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel;function y(){return function(){return t.nextTick(S)}}function v(){return"undefined"!==typeof o?function(){o(S)}:b()}function _(){var e=0,t=new p(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function E(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var T=new Array(1e3);function S(){for(var e=0;e0&&o.length>n&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,s(h)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=c.bind(i);return s.listener=r,i.wrapFn=s,s}function f(e,t,r){var i=e._events;if(void 0===i)return[];var s=i[t];return void 0===s?[]:"function"===typeof s?r?[s.listener||s]:[s]:r?y(s):m(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),i=0;i0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=n[e];if(void 0===l)return!1;if("function"===typeof l)i(l,this,t);else{var d=l.length,h=m(l,d);for(r=0;r=0;n--)if(r[n]===t||r[n].listener===t){a=r[n].listener,s=n;break}if(s<0)return this;0===s?r.shift():g(r,s),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,n=Object.keys(r);for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},"./node_modules/webworkify-webpack/index.js": +/*!**************************************************!*\ + !*** ./node_modules/webworkify-webpack/index.js ***! + \**************************************************/function(e,t,r){function i(e){var t={};function r(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var i=r(r.s=ENTRY_MODULE);return i.default||i}var s="[\\.|\\-|\\+|\\w|/|@]+",n="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+s+").*?\\)";function a(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function o(e){return!isNaN(1*e)}function l(e,t,i){var l={};l[i]=[];var d=t.toString(),h=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return l;var c,u=h[1],f=new RegExp("(\\\\n|\\W)"+a(u)+n,"g");while(c=f.exec(d))"dll-reference"!==c[3]&&l[i].push(c[3]);f=new RegExp("\\("+a(u)+'\\("(dll-reference\\s('+s+'))"\\)\\)'+n,"g");while(c=f.exec(d))e[c[2]]||(l[i].push(c[1]),e[c[2]]=r(c[1]).m),l[c[2]]=l[c[2]]||[],l[c[2]].push(c[4]);for(var p=Object.keys(l),m=0;m0}),!1)}function h(e,t){var r={main:[t]},i={main:[]},s={main:{}};while(d(r))for(var n=Object.keys(r),a=0;a=e[s]&&t0&&e[0].originalDts=t[s].dts&&et[i].lastSample.originalDts&&e=t[i].lastSample.originalDts&&(i===t.length-1||i0&&(s=this._searchNearestSegmentBefore(r.originalBeginDts)+1),this._lastAppendLocation=s,this._list.splice(s,0,r)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){var t=this._searchNearestSegmentBefore(e),r=this._list[t].syncPoints;while(0===r.length&&t>0)t--,r=this._list[t].syncPoints;return r.length>0?r[r.length-1]:null},e}()},"./src/core/mse-controller.js": +/*!************************************!*\ + !*** ./src/core/mse-controller.js ***! + \************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! ../utils/logger.js */"./src/utils/logger.js"),a=r(/*! ../utils/browser.js */"./src/utils/browser.js"),o=r(/*! ./mse-events.js */"./src/core/mse-events.js"),l=r(/*! ./media-segment-info.js */"./src/core/media-segment-info.js"),d=r(/*! ../utils/exception.js */"./src/utils/exception.js"),h=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(s()),this._config.isLive&&void 0==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new l.IDRSampleList}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new d.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var r=this._pendingSegments[t];r.splice(0,r.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var i=this._sourceBuffers[t];if(i){if("closed"!==e.readyState){try{e.removeSourceBuffer(i)}catch(s){n.default.e(this.TAG,s.message)}i.removeEventListener("error",this.e.onSourceBufferError),i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(s){n.default.e(this.TAG,s.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var r=e,i=""+r.container;r.codec&&r.codec.length>0&&(i+=";codecs="+r.codec);var s=!1;if(n.default.v(this.TAG,"Received Initialization Segment, mimeType: "+i),this._lastInitSegments[r.type]=r,i!==this._mimeTypes[r.type]){if(this._mimeTypes[r.type])n.default.v(this.TAG,"Notice: "+r.type+" mimeType changed, origin: "+this._mimeTypes[r.type]+", target: "+i);else{s=!0;try{var l=this._sourceBuffers[r.type]=this._mediaSource.addSourceBuffer(i);l.addEventListener("error",this.e.onSourceBufferError),l.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(d){return n.default.e(this.TAG,d.message),void this._emitter.emit(o.default.ERROR,{code:d.code,msg:d.message})}}this._mimeTypes[r.type]=i}t||this._pendingSegments[r.type].push(r),s||this._sourceBuffers[r.type]&&!this._sourceBuffers[r.type].updating&&this._doAppendSegments(),a.default.safari&&"audio/mpeg"===r.container&&r.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=r.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var r=this._sourceBuffers[t.type];!r||r.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var r=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{r.abort()}catch(h){n.default.e(this.TAG,h.message)}this._idrList.clear();var i=this._pendingSegments[t];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var s=0;s=1&&e-i.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var r=this._sourceBuffers[t];if(r){for(var i=r.buffered,s=!1,n=0;n=this._config.autoCleanupMaxBackwardDuration){s=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:l})}}else o0&&(isNaN(t)||r>t)&&(n.default.v(this.TAG,"Update MediaSource duration from "+t+" to "+r),this._mediaSource.duration=r),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating){var t=this._sourceBuffers[e],r=this._pendingRemoveRanges[e];while(r.length&&!t.updating){var i=r.shift();t.remove(i.start,i.end)}}},e.prototype._doAppendSegments=function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var r=e[t].shift();if(r.timestampOffset){var i=this._sourceBuffers[t].timestampOffset,s=r.timestampOffset/1e3,a=Math.abs(i-s);a>.1&&(n.default.v(this.TAG,"Update MPEG audio timestampOffset from "+i+" to "+s),this._sourceBuffers[t].timestampOffset=s),delete r.timestampOffset}if(!r.data||0===r.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(r.data),this._isBufferFull=!1,"video"===t&&r.hasOwnProperty("info")&&this._idrList.appendArray(r.info.syncPoints)}catch(l){this._pendingSegments[t].unshift(r),22===l.code?(this._isBufferFull||this._emitter.emit(o.default.BUFFER_FULL),this._isBufferFull=!0):(n.default.e(this.TAG,l.message),this._emitter.emit(o.default.ERROR,{code:l.code,msg:l.message}))}}},e.prototype._onSourceOpen=function(){if(n.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){var e=this._pendingSourceBufferInit;while(e.length){var t=e.shift();this.appendInitSegment(t,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(o.default.SOURCE_OPEN)},e.prototype._onSourceEnded=function(){n.default.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){n.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(o.default.UPDATE_END)},e.prototype._onSourceBufferError=function(e){n.default.e(this.TAG,"SourceBuffer Error: "+e)},e}();t["default"]=h},"./src/core/mse-events.js": +/*!********************************!*\ + !*** ./src/core/mse-events.js ***! + \********************************/function(e,t,r){"use strict";r.r(t);var i={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};t["default"]=i},"./src/core/transmuxer.js": +/*!********************************!*\ + !*** ./src/core/transmuxer.js ***! + \********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),a=r.n(n),o=r(/*! ../utils/logger.js */"./src/utils/logger.js"),l=r(/*! ../utils/logging-control.js */"./src/utils/logging-control.js"),d=r(/*! ./transmuxing-controller.js */"./src/core/transmuxing-controller.js"),h=r(/*! ./transmuxing-events.js */"./src/core/transmuxing-events.js"),c=r(/*! ./media-info.js */"./src/core/media-info.js"),u=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(s()),t.enableWorker&&"undefined"!==typeof Worker)try{this._worker=a()(/*! ./transmuxing-worker */"./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},l.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:l.default.getConfig()})}catch(i){o.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new d.default(e,t)}else this._controller=new d.default(e,t);if(this._controller){var r=this._controller;r.on(h.default.IO_ERROR,this._onIOError.bind(this)),r.on(h.default.DEMUX_ERROR,this._onDemuxError.bind(this)),r.on(h.default.INIT_SEGMENT,this._onInitSegment.bind(this)),r.on(h.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),r.on(h.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),r.on(h.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),r.on(h.default.MEDIA_INFO,this._onMediaInfo.bind(this)),r.on(h.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),r.on(h.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),r.on(h.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),r.on(h.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),l.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},e.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},e.prototype.seek=function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)},e.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},e.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},e.prototype._onInitSegment=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(h.default.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(h.default.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,r=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case h.default.INIT_SEGMENT:case h.default.MEDIA_SEGMENT:this._emitter.emit(t.msg,r.type,r.data);break;case h.default.LOADING_COMPLETE:case h.default.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case h.default.MEDIA_INFO:Object.setPrototypeOf(r,c.default.prototype),this._emitter.emit(t.msg,r);break;case h.default.METADATA_ARRIVED:case h.default.SCRIPTDATA_ARRIVED:case h.default.STATISTICS_INFO:this._emitter.emit(t.msg,r);break;case h.default.IO_ERROR:case h.default.DEMUX_ERROR:this._emitter.emit(t.msg,r.type,r.info);break;case h.default.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,r);break;case"logcat_callback":o.default.emitter.emit("log",r.type,r.logcat);break;default:break}},e}();t["default"]=u},"./src/core/transmuxing-controller.js": +/*!********************************************!*\ + !*** ./src/core/transmuxing-controller.js ***! + \********************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! ../utils/logger.js */"./src/utils/logger.js"),a=r(/*! ../utils/browser.js */"./src/utils/browser.js"),o=r(/*! ./media-info.js */"./src/core/media-info.js"),l=r(/*! ../demux/flv-demuxer.js */"./src/demux/flv-demuxer.js"),d=r(/*! ../remux/mp4-remuxer.js */"./src/remux/mp4-remuxer.js"),h=r(/*! ../demux/demux-errors.js */"./src/demux/demux-errors.js"),c=r(/*! ../io/io-controller.js */"./src/io/io-controller.js"),u=r(/*! ./transmuxing-events.js */"./src/core/transmuxing-events.js"),f=function(){function e(e,t){this.TAG="TransmuxingController",this._emitter=new(s()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!==typeof e.cors&&(e.cors=!0),"boolean"!==typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var r=0;this._mediaDataSource.segments.forEach((function(i){i.timestampBase=r,r+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(r)||this._mediaDataSource.duration===r||(this._mediaDataSource.duration=r),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){this._currentSegmentIndex=e;var r=this._mediaDataSource.segments[e],i=this._ioctl=new c.default(r,this._config,e);i.onError=this._onIOException.bind(this),i.onSeeked=this._onIOSeeked.bind(this),i.onComplete=this._onIOComplete.bind(this),i.onRedirect=this._onIORedirect.bind(this),i.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):i.onDataArrival=this._onInitChunkArrival.bind(this),i.open(t)},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var r=this._mediaInfo.segments[t];if(void 0==r)this._pendingSeekTime=e;else{var i=r.getNearestKeyframe(e);this._remuxer.seek(i.milliseconds),this._ioctl.seek(i.fileposition),this._pendingResolveSeekPoint=i.milliseconds}}else{var s=this._mediaInfo.segments[t];if(void 0==s)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{i=s.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,i.fileposition),this._pendingResolveSeekPoint=i.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,r=t.length-1,i=0;i0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,s=this._demuxer.parseChunks(e,t);else if((i=l.default.probe(e)).match){this._demuxer=new l.default(i,this._config),this._remuxer||(this._remuxer=new d.default(this._config));var a=this._mediaDataSource;void 0==a.duration||isNaN(a.duration)||(this._demuxer.overridedDuration=a.duration),"boolean"===typeof a.hasAudio&&(this._demuxer.overridedHasAudio=a.hasAudio),"boolean"===typeof a.hasVideo&&(this._demuxer.overridedHasVideo=a.hasVideo),this._demuxer.timestampBase=a.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),s=this._demuxer.parseChunks(e,t)}else i=null,n.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){r._internalAbort()})),this._emitter.emit(u.default.DEMUX_ERROR,h.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),s=0;return s},e.prototype._onMediaInfo=function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,o.default.prototype));var r=Object.assign({},e);Object.setPrototypeOf(r,o.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=r,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(u.default.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(u.default.SCRIPTDATA_ARRIVED,e)},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e,r=t+1;r0&&r[0].originalDts===i&&(i=r[0].pts),this._emitter.emit(u.default.RECOMMEND_SEEKPOINT,i)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t=this._mediaInfo.segments[e],r=Object.assign({},t);r.duration=this._mediaInfo.duration,r.segmentCount=this._mediaInfo.segmentCount,delete r.segments,delete r.keyframesIndex,this._emitter.emit(u.default.MEDIA_INFO,r)},e.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(u.default.STATISTICS_INFO,e)},e}();t["default"]=f},"./src/core/transmuxing-events.js": +/*!****************************************!*\ + !*** ./src/core/transmuxing-events.js ***! + \****************************************/function(e,t,r){"use strict";r.r(t);var i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};t["default"]=i},"./src/core/transmuxing-worker.js": +/*!****************************************!*\ + !*** ./src/core/transmuxing-worker.js ***! + \****************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logging-control.js */"./src/utils/logging-control.js"),s=r(/*! ../utils/polyfill.js */"./src/utils/polyfill.js"),n=r(/*! ./transmuxing-controller.js */"./src/core/transmuxing-controller.js"),a=r(/*! ./transmuxing-events.js */"./src/core/transmuxing-events.js"),o=function(e){var t=null,r=v.bind(this);function o(t,r){var i={msg:a.default.INIT_SEGMENT,data:{type:t,data:r}};e.postMessage(i,[r.data])}function l(t,r){var i={msg:a.default.MEDIA_SEGMENT,data:{type:t,data:r}};e.postMessage(i,[r.data])}function d(){var t={msg:a.default.LOADING_COMPLETE};e.postMessage(t)}function h(){var t={msg:a.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function c(t){var r={msg:a.default.MEDIA_INFO,data:t};e.postMessage(r)}function u(t){var r={msg:a.default.METADATA_ARRIVED,data:t};e.postMessage(r)}function f(t){var r={msg:a.default.SCRIPTDATA_ARRIVED,data:t};e.postMessage(r)}function p(t){var r={msg:a.default.STATISTICS_INFO,data:t};e.postMessage(r)}function m(t,r){e.postMessage({msg:a.default.IO_ERROR,data:{type:t,info:r}})}function g(t,r){e.postMessage({msg:a.default.DEMUX_ERROR,data:{type:t,info:r}})}function y(t){e.postMessage({msg:a.default.RECOMMEND_SEEKPOINT,data:t})}function v(t,r){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:r}})}s.default.install(),e.addEventListener("message",(function(s){switch(s.data.cmd){case"init":t=new n.default(s.data.param[0],s.data.param[1]),t.on(a.default.IO_ERROR,m.bind(this)),t.on(a.default.DEMUX_ERROR,g.bind(this)),t.on(a.default.INIT_SEGMENT,o.bind(this)),t.on(a.default.MEDIA_SEGMENT,l.bind(this)),t.on(a.default.LOADING_COMPLETE,d.bind(this)),t.on(a.default.RECOVERED_EARLY_EOF,h.bind(this)),t.on(a.default.MEDIA_INFO,c.bind(this)),t.on(a.default.METADATA_ARRIVED,u.bind(this)),t.on(a.default.SCRIPTDATA_ARRIVED,f.bind(this)),t.on(a.default.STATISTICS_INFO,p.bind(this)),t.on(a.default.RECOMMEND_SEEKPOINT,y.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(s.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var v=s.data.param;i.default.applyConfig(v),!0===v.enableCallback?i.default.addLogListener(r):i.default.removeLogListener(r);break}}))};t["default"]=o},"./src/demux/amf-parser.js": +/*!*********************************!*\ + !*** ./src/demux/amf-parser.js ***! + \*********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ../utils/utf8-conv.js */"./src/utils/utf8-conv.js"),n=r(/*! ../utils/exception.js */"./src/utils/exception.js"),a=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),o=function(){function e(){}return e.parseScriptData=function(t,r,s){var n={};try{var a=e.parseValue(t,r,s),o=e.parseValue(t,r+a.size,s-a.size);n[a.data]=o.data}catch(l){i.default.e("AMF",l.toString())}return n},e.parseObject=function(t,r,i){if(i<3)throw new n.IllegalStateException("Data not enough when parse ScriptDataObject");var s=e.parseString(t,r,i),a=e.parseValue(t,r+s.size,i-s.size),o=a.objectEnd;return{data:{name:s.data,value:a.data},size:s.size+a.size,objectEnd:o}},e.parseVariable=function(t,r,i){return e.parseObject(t,r,i)},e.parseString=function(e,t,r){if(r<2)throw new n.IllegalStateException("Data not enough when parse String");var i,o=new DataView(e,t,r),l=o.getUint16(0,!a);return i=l>0?(0,s.default)(new Uint8Array(e,t+2,l)):"",{data:i,size:2+l}},e.parseLongString=function(e,t,r){if(r<4)throw new n.IllegalStateException("Data not enough when parse LongString");var i,o=new DataView(e,t,r),l=o.getUint32(0,!a);return i=l>0?(0,s.default)(new Uint8Array(e,t+4,l)):"",{data:i,size:4+l}},e.parseDate=function(e,t,r){if(r<10)throw new n.IllegalStateException("Data size invalid when parse Date");var i=new DataView(e,t,r),s=i.getFloat64(0,!a),o=i.getInt16(8,!a);return s+=60*o*1e3,{data:new Date(s),size:10}},e.parseValue=function(t,r,s){if(s<1)throw new n.IllegalStateException("Data not enough when parse Value");var o,l=new DataView(t,r,s),d=1,h=l.getUint8(0),c=!1;try{switch(h){case 0:o=l.getFloat64(1,!a),d+=8;break;case 1:var u=l.getUint8(1);o=!!u,d+=1;break;case 2:var f=e.parseString(t,r+1,s-1);o=f.data,d+=f.size;break;case 3:o={};var p=0;9===(16777215&l.getUint32(s-4,!a))&&(p=3);while(d32)throw new i.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var r=this._current_word_bits_left?this._current_word:0;r>>>=32-this._current_word_bits_left;var s=e-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(s,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,r=r<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}();t["default"]=s},"./src/demux/flv-demuxer.js": +/*!**********************************!*\ + !*** ./src/demux/flv-demuxer.js ***! + \**********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ./amf-parser.js */"./src/demux/amf-parser.js"),n=r(/*! ./sps-parser.js */"./src/demux/sps-parser.js"),a=r(/*! ./demux-errors.js */"./src/demux/demux-errors.js"),o=r(/*! ../core/media-info.js */"./src/core/media-info.js"),l=r(/*! ../utils/exception.js */"./src/utils/exception.js");function d(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}var h=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new o.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e),r={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return r;var i=(4&t[4])>>>2!==0,s=0!==(1&t[4]),n=d(t,5);return n<9?r:{match:!0,consumed:n,dataOffset:n,hasAudioTrack:i,hasVideoTrack:s}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new o.default},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,r){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new l.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var s=0,n=this._littleEndian;if(0===r){if(!(t.byteLength>13))return 0;var a=e.probe(t);s=a.dataOffset}if(this._firstParse){this._firstParse=!1,r+s!==this._dataOffset&&i.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var o=new DataView(t,s),d=o.getUint32(0,!n);0!==d&&i.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),s+=4}while(st.byteLength)break;var h=o.getUint8(0),c=16777215&o.getUint32(0,!n);if(s+11+c+4>t.byteLength)break;if(8===h||9===h||18===h){var u=o.getUint8(4),f=o.getUint8(5),p=o.getUint8(6),m=o.getUint8(7),g=p|f<<8|u<<16|m<<24,y=16777215&o.getUint32(7,!n);0!==y&&i.default.w(this.TAG,"Meet tag which has StreamID != 0!");var v=s+11;switch(h){case 8:this._parseAudioData(t,v,c,g);break;case 9:this._parseVideoData(t,v,c,g,r+s);break;case 18:this._parseScriptData(t,v,c);break}var _=o.getUint32(11+c,!n);_!==11+c&&i.default.w(this.TAG,"Invalid PrevTagSize "+_),s+=11+c+4}else i.default.w(this.TAG,"Unsupported tag type "+h+", skipped"),s+=11+c+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),s},e.prototype._parseScriptData=function(e,t,r){var n=s.default.parseScriptData(e,t,r);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!==typeof n.onMetaData)return void i.default.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&i.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var a=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},a)),"boolean"===typeof a.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=a.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"===typeof a.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=a.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"===typeof a.audiodatarate&&(this._mediaInfo.audioDataRate=a.audiodatarate),"number"===typeof a.videodatarate&&(this._mediaInfo.videoDataRate=a.videodatarate),"number"===typeof a.width&&(this._mediaInfo.width=a.width),"number"===typeof a.height&&(this._mediaInfo.height=a.height),"number"===typeof a.duration){if(!this._durationOverrided){var o=Math.floor(a.duration*this._timescale);this._duration=o,this._mediaInfo.duration=o}}else this._mediaInfo.duration=0;if("number"===typeof a.framerate){var l=Math.floor(1e3*a.framerate);if(l>0){var d=l/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=d,this._referenceFrameRate.fps_num=l,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=d}}if("object"===typeof a.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var h=a.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h),a.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=a,i.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],r=[],i=1;i>>4;if(2===l||10===l){var d=0,h=(12&o)>>>2;if(h>=0&&h<=4){d=this._flvSoundRateTable[h];var c=1&o,u=this._audioMetadata,f=this._audioTrack;if(u||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),u=this._audioMetadata={},u.type="audio",u.id=f.id,u.timescale=this._timescale,u.duration=this._duration,u.audioSampleRate=d,u.channelCount=0===c?1:2),10===l){var p=this._parseAACAudioData(e,t+1,r-1);if(void 0==p)return;if(0===p.packetType){u.config&&i.default.w(this.TAG,"Found another AudioSpecificConfig!");var m=p.data;u.audioSampleRate=m.samplingRate,u.channelCount=m.channelCount,u.codec=m.codec,u.originalCodec=m.originalCodec,u.config=m.config,u.refSampleDuration=1024/u.audioSampleRate*u.timescale,i.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",u);var g=this._mediaInfo;g.audioCodec=u.originalCodec,g.audioSampleRate=u.audioSampleRate,g.audioChannelCount=u.channelCount,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}else if(1===p.packetType){var y=this._timestampBase+s,v={unit:p.data,length:p.data.byteLength,dts:y,pts:y};f.samples.push(v),f.length+=p.data.length}else i.default.e(this.TAG,"Flv: Unsupported AAC data type "+p.packetType)}else if(2===l){if(!u.codec){m=this._parseMP3AudioData(e,t+1,r-1,!0);if(void 0==m)return;u.audioSampleRate=m.samplingRate,u.channelCount=m.channelCount,u.codec=m.codec,u.originalCodec=m.originalCodec,u.refSampleDuration=1152/u.audioSampleRate*u.timescale,i.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",u);g=this._mediaInfo;g.audioCodec=u.codec,g.audioSampleRate=u.audioSampleRate,g.audioChannelCount=u.channelCount,g.audioDataRate=m.bitRate,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}var _=this._parseMP3AudioData(e,t+1,r-1,!1);if(void 0==_)return;y=this._timestampBase+s;var E={unit:_,length:_.byteLength,dts:y,pts:y};f.samples.push(E),f.length+=_.length}}else this._onError(a.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+h)}else this._onError(a.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+l)}},e.prototype._parseAACAudioData=function(e,t,r){if(!(r<=1)){var s={},n=new Uint8Array(e,t,r);return s.packetType=n[0],0===n[0]?s.data=this._parseAACAudioSpecificConfig(e,t+1,r-1):s.data=n.subarray(1),s}i.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,r){var i=new Uint8Array(e,t,r),s=null,n=0,o=0,l=0,d=null;if(n=o=i[0]>>>3,l=(7&i[0])<<1|i[1]>>>7,l<0||l>=this._mpegSamplingRates.length)this._onError(a.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var h=this._mpegSamplingRates[l],c=(120&i[1])>>>3;if(!(c<0||c>=8)){5===n&&(d=(7&i[1])<<1|i[2]>>>7,(124&i[2])>>>2);var u=self.navigator.userAgent.toLowerCase();return-1!==u.indexOf("firefox")?l>=6?(n=5,s=new Array(4),d=l-3):(n=2,s=new Array(2),d=l):-1!==u.indexOf("android")?(n=2,s=new Array(2),d=l):(n=5,d=l,s=new Array(4),l>=6?d=l-3:1===c&&(n=2,s=new Array(2),d=l)),s[0]=n<<3,s[0]|=(15&l)>>>1,s[1]=(15&l)<<7,s[1]|=(15&c)<<3,5===n&&(s[1]|=(15&d)>>>1,s[2]=(1&d)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:h,channelCount:c,codec:"mp4a.40."+n,originalCodec:"mp4a.40."+o}}this._onError(a.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,r,s){if(!(r<4)){this._littleEndian;var n=new Uint8Array(e,t,r),a=null;if(s){if(255!==n[0])return;var o=n[1]>>>3&3,l=(6&n[1])>>1,d=(240&n[2])>>>4,h=(12&n[2])>>>2,c=n[3]>>>6&3,u=3!==c?2:1,f=0,p=0,m="mp3";switch(o){case 0:f=this._mpegAudioV25SampleRateTable[h];break;case 2:f=this._mpegAudioV20SampleRateTable[h];break;case 3:f=this._mpegAudioV10SampleRateTable[h];break}switch(l){case 1:34,d>>4,d=15&o;7===d?this._parseAVCVideoPacket(e,t+1,r-1,s,n,l):this._onError(a.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+d)}},e.prototype._parseAVCVideoPacket=function(e,t,r,s,n,o){if(r<4)i.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,d=new DataView(e,t,r),h=d.getUint8(0),c=16777215&d.getUint32(0,!l),u=c<<8>>8;if(0===h)this._parseAVCDecoderConfigurationRecord(e,t+4,r-4);else if(1===h)this._parseAVCVideoData(e,t+4,r-4,s,n,o,u);else if(2!==h)return void this._onError(a.default.FORMAT_ERROR,"Flv: Invalid video packet type "+h)}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,r){if(r<7)i.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var s=this._videoMetadata,o=this._videoTrack,l=this._littleEndian,d=new DataView(e,t,r);s?"undefined"!==typeof s.avcc&&i.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),s=this._videoMetadata={},s.type="video",s.id=o.id,s.timescale=this._timescale,s.duration=this._duration);var h=d.getUint8(0),c=d.getUint8(1);d.getUint8(2),d.getUint8(3);if(1===h&&0!==c)if(this._naluLengthSize=1+(3&d.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var u=31&d.getUint8(5);if(0!==u){u>1&&i.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+u);for(var f=6,p=0;p1&&i.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+A),f++;for(p=0;p=r){i.default.w(this.TAG,"Malformed Nalu near timestamp "+p+", offset = "+u+", dataSize = "+r);break}var g=d.getUint32(u,!l);if(3===f&&(g>>>=8),g>r-f)return void i.default.w(this.TAG,"Malformed Nalus near timestamp "+p+", NaluSize > DataSize!");var y=31&d.getUint8(u+f);5===y&&(m=!0);var v=new Uint8Array(e,t+u,f+g),_={type:y,data:v};h.push(_),c+=v.byteLength,u+=f+g}if(h.length){var E=this._videoTrack,b={units:h,length:c,isKeyframe:m,dts:p,cts:o,pts:p+o};m&&(b.fileposition=n),E.samples.push(b),E.length+=c}},e}();t["default"]=h},"./src/demux/sps-parser.js": +/*!*********************************!*\ + !*** ./src/demux/sps-parser.js ***! + \*********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ./exp-golomb.js */"./src/demux/exp-golomb.js"),s=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,r=t.byteLength,i=new Uint8Array(r),s=0,n=0;n=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(i[s]=t[n],s++);return new Uint8Array(i.buffer,0,s)},e.parseSPS=function(t){var r=e._ebsp2rbsp(t),s=new i.default(r);s.readByte();var n=s.readByte();s.readByte();var a=s.readByte();s.readUEG();var o=e.getProfileString(n),l=e.getLevelString(a),d=1,h=420,c=[0,420,422,444],u=8;if((100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n)&&(d=s.readUEG(),3===d&&s.readBits(1),d<=3&&(h=c[d]),u=s.readUEG()+8,s.readUEG(),s.readBits(1),s.readBool()))for(var f=3!==d?8:12,p=0;p0&&P<16?(w=O[P-1],R=M[P-1]):255===P&&(w=s.readByte()<<8|s.readByte(),R=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var F=s.readBits(32),N=s.readBits(32);I=s.readBool(),D=N,x=2*F,k=D/x}}var U=1;1===w&&1===R||(U=w/R);var B=0,$=0;if(0===d)B=1,$=2-E;else{var G=3===d?1:2,j=1===d?2:1;B=G,$=j*(2-E)}var K=16*(v+1),V=16*(_+1)*(2-E);K-=(b+T)*B,V-=(S+L)*$;var H=Math.ceil(K*U);return s.destroy(),s=null,{profile_string:o,level_string:l,bit_depth:u,ref_frames:y,chroma_format:h,chroma_format_string:e.getChromaFormatString(h),frame_rate:{fixed:I,fps:k,fps_den:x,fps_num:D},sar_ratio:{width:w,height:R},codec_size:{width:K,height:V},present_size:{width:H,height:V}}},e._skipScalingList=function(e,t){for(var r=8,i=8,s=0,n=0;n=15048,t=!i.default.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(r){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var r=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);var a=this._seekHandler.getConfig(i,t),o=new self.Headers;if("object"===typeof a.headers){var l=a.headers;for(var d in l)l.hasOwnProperty(d)&&o.append(d,l[d])}var h={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===typeof this._config.headers)for(var d in this._config.headers)o.append(d,this._config.headers[d]);!1===e.cors&&(h.mode="same-origin"),e.withCredentials&&(h.credentials="include"),e.referrerPolicy&&(h.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,h.signal=this._abortController.signal),this._status=s.LoaderStatus.kConnecting,self.fetch(a.url,h).then((function(e){if(r._requestAbort)return r._status=s.LoaderStatus.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.url&&r._onURLRedirect){var t=r._seekHandler.removeURLParameters(e.url);r._onURLRedirect(t)}var i=e.headers.get("Content-Length");return null!=i&&(r._contentLength=parseInt(i),0!==r._contentLength&&r._onContentLengthKnown&&r._onContentLengthKnown(r._contentLength)),r._pump.call(r,e.body.getReader())}if(r._status=s.LoaderStatus.kError,!r._onError)throw new n.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);r._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!r._abortController||!r._abortController.signal.aborted){if(r._status=s.LoaderStatus.kError,!r._onError)throw e;r._onError(s.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==s.LoaderStatus.kBuffering||!i.default.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(r){if(r.done)if(null!==t._contentLength&&t._receivedLength0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new s.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||void 0!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===l.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new h.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",r=e.seekParamEnd||"bend";this._seekHandler=new c.default(t,r)}else{if("custom"!==e.seekType)throw new u.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!==typeof e.customSeekHandler)throw new u.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=d.default;else if(a.default.isSupported())this._loaderClass=a.default;else if(o.default.isSupported())this._loaderClass=o.default;else{if(!l.default.isSupported())throw new u.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=l.default}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},e.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var r={from:e,to:-1};this._currentRange={from:r.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,r),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!==typeof e||0===e.length)throw new u.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){var t=this._stashSize;while(t+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed),s=new Uint8Array(r,0,t);s.set(i,0)}this._stashBuffer=r,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,r=t.length-1,i=0,s=0,n=r;if(e=t[i]&&e=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);var r=1024*t+1048576;this._bufferSize0){var n=this._stashBuffer.slice(0,this._stashUsed);a=this._dispatchChunks(n,this._stashByteStart);if(a0){d=new Uint8Array(n,a);l.set(d,0),this._stashUsed=d.byteLength,this._stashByteStart+=a}}else this._stashUsed=0,this._stashByteStart+=a;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),l=new Uint8Array(this._stashBuffer,0,this._bufferSize)),l.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{a=this._dispatchChunks(e,t);if(athis._bufferSize&&(this._expandBuffer(o),l=new Uint8Array(this._stashBuffer,0,this._bufferSize)),l.set(new Uint8Array(e,a),0),this._stashUsed+=o,this._stashByteStart=t+a}}}else if(0===this._stashUsed){var a=this._dispatchChunks(e,t);if(athis._bufferSize&&this._expandBuffer(o);var l=new Uint8Array(this._stashBuffer,0,this._bufferSize);l.set(new Uint8Array(e,a),0),this._stashUsed+=o,this._stashByteStart=t+a}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var l=new Uint8Array(this._stashBuffer,0,this._bufferSize);l.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var a=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(a0){var d=new Uint8Array(this._stashBuffer,a);l.set(d,0)}this._stashUsed-=a,this._stashByteStart+=a}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),r=this._dispatchChunks(t,this._stashByteStart),s=t.byteLength-r;if(r0){var n=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,r);n.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=r}return 0}i.default.w(this.TAG,s+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,s}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(i.default.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=n.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case n.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var r=this._currentRange.to+1;return void(r0)for(var n=r.split("&"),a=0;a0;o[0]!==this._startName&&o[0]!==this._endName&&(l&&(s+="&"),s+=n[a])}return 0===s.length?t:t+"?"+s},e}();t["default"]=i},"./src/io/range-seek-handler.js": +/*!**************************************!*\ + !*** ./src/io/range-seek-handler.js ***! + \**************************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var r={};if(0!==t.from||-1!==t.to){var i=void 0;i=-1!==t.to?"bytes="+t.from.toString()+"-"+t.to.toString():"bytes="+t.from.toString()+"-",r["Range"]=i}else this._zeroStart&&(r["Range"]="bytes=0-");return{url:e,headers:r}},e.prototype.removeURLParameters=function(e){return e},e}();t["default"]=i},"./src/io/speed-sampler.js": +/*!*********************************!*\ + !*** ./src/io/speed-sampler.js ***! + \*********************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();t["default"]=i},"./src/io/websocket-loader.js": +/*!************************************!*\ + !*** ./src/io/websocket-loader.js ***! + \************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ./loader.js */"./src/io/loader.js"),s=r(/*! ../utils/exception.js */"./src/utils/exception.js"),n=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),a=function(e){function t(){var t=e.call(this,"websocket-loader")||this;return t.TAG="WebSocketLoader",t._needStash=!0,t._ws=null,t._requestAbort=!1,t._receivedLength=0,t}return n(t,e),t.isSupported=function(){try{return"undefined"!==typeof self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=i.LoaderStatus.kConnecting}catch(n){this._status=i.LoaderStatus.kError;var r={code:n.code,msg:n.message};if(!this._onError)throw new s.RuntimeException(r.msg);this._onError(i.LoaderErrors.EXCEPTION,r)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=i.LoaderStatus.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=i.LoaderStatus.kBuffering},t.prototype._onWebSocketClose=function(e){!0!==this._requestAbort?(this._status=i.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var r=new FileReader;r.onload=function(){t._dispatchArrayBuffer(r.result)},r.readAsArrayBuffer(e.data)}else{this._status=i.LoaderStatus.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new s.RuntimeException(n.msg);this._onError(i.LoaderErrors.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,r=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,r,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=i.LoaderStatus.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new s.RuntimeException(t.msg);this._onError(i.LoaderErrors.EXCEPTION,t)},t}(i.BaseLoader);t["default"]=a},"./src/io/xhr-moz-chunked-loader.js": +/*!******************************************!*\ + !*** ./src/io/xhr-moz-chunked-loader.js ***! + \******************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ./loader.js */"./src/io/loader.js"),n=r(/*! ../utils/exception.js */"./src/utils/exception.js"),a=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),o=function(e){function t(t,r){var i=e.call(this,"xhr-moz-chunked-loader")||this;return i.TAG="MozChunkedLoader",i._seekHandler=t,i._config=r,i._needStash=!0,i._xhr=null,i._requestAbort=!1,i._contentLength=null,i._receivedLength=0,i}return a(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(t){return i.default.w("MozChunkedLoader",t.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(r=e.redirectedURL);var i=this._seekHandler.getConfig(r,t);this._requestURL=i.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",i.url,!0),n.responseType="moz-chunked-arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onloadend=this._onLoadEnd.bind(this),n.onerror=this._onXhrError.bind(this),e.withCredentials&&(n.withCredentials=!0),"object"===typeof i.headers){var a=i.headers;for(var o in a)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o])}if("object"===typeof this._config.headers){a=this._config.headers;for(var o in a)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o])}this._status=s.LoaderStatus.kConnecting,n.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=s.LoaderStatus.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var r=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(r)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=s.LoaderStatus.kError,!this._onError)throw new n.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=s.LoaderStatus.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==s.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,r,this._receivedLength)}},t.prototype._onLoadEnd=function(e){!0!==this._requestAbort?this._status!==s.LoaderStatus.kError&&(this._status=s.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=s.LoaderStatus.kError;var t=0,r=null;if(this._contentLength&&e.loaded=this._contentLength&&(r=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:r},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var r=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?r=this._currentRedirectedURL:void 0!=e.redirectedURL&&(r=e.redirectedURL));var i=this._seekHandler.getConfig(r,t);this._currentRequestURL=i.url;var s=this._xhr=new XMLHttpRequest;if(s.open("GET",i.url,!0),s.responseType="arraybuffer",s.onreadystatechange=this._onReadyStateChange.bind(this),s.onprogress=this._onProgress.bind(this),s.onload=this._onLoad.bind(this),s.onerror=this._onXhrError.bind(this),e.withCredentials&&(s.withCredentials=!0),"object"===typeof i.headers){var n=i.headers;for(var a in n)n.hasOwnProperty(a)&&s.setRequestHeader(a,n[a])}if("object"===typeof this._config.headers){n=this._config.headers;for(var a in n)n.hasOwnProperty(a)&&s.setRequestHeader(a,n[a])}s.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=n.LoaderStatus.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){var r=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&r!==this._currentRedirectedURL&&(this._currentRedirectedURL=r,this._onURLRedirect&&this._onURLRedirect(r))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=n.LoaderStatus.kBuffering}else{if(this._status=n.LoaderStatus.kError,!this._onError)throw new a.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(n.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==n.LoaderStatus.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var r=e.total;this._internalAbort(),null!=r&0!==r&&(this._totalLength=r)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,r=t.length-1,i=0,s=0,n=r;if(e=t[i]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var r=this._normalizeSpeed(t);this._currentSpeedNormalized!==r&&(this._currentSpeedNormalized=r,this._currentChunkSizeKB=r)}var i=e.target.response,s=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new l.default(this._mediaDataSource,this._config),this._transmuxer.on(d.default.INIT_SEGMENT,(function(t,r){e._msectl.appendInitSegment(r)})),this._transmuxer.on(d.default.MEDIA_SEGMENT,(function(t,r){if(e._msectl.appendMediaSegment(r),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;r.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(n.default.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(d.default.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(o.default.LOADING_COMPLETE)})),this._transmuxer.on(d.default.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(o.default.RECOVERED_EARLY_EOF)})),this._transmuxer.on(d.default.IO_ERROR,(function(t,r){e._emitter.emit(o.default.ERROR,u.ErrorTypes.NETWORK_ERROR,t,r)})),this._transmuxer.on(d.default.DEMUX_ERROR,(function(t,r){e._emitter.emit(o.default.ERROR,u.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:r})})),this._transmuxer.on(d.default.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(o.default.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(d.default.METADATA_ARRIVED,(function(t){e._emitter.emit(o.default.METADATA_ARRIVED,t)})),this._transmuxer.on(d.default.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(o.default.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(d.default.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(o.default.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(d.default.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,r=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var s=this._mediaElement.getVideoPlaybackQuality();r=s.totalVideoFrames,i=s.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(r=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=r,e.droppedFrames=i),e},e.prototype._onmseUpdateEnd=function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,r=0,i=0;i=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(n.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){n.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,r=!1,i=0;i=s&&e=a-this._config.lazyLoadRecoverDuration&&(r=!0);break}}r&&(window.clearInterval(this._progressChecker),this._progressChecker=null,r&&(n.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t=this._mediaElement.buffered,r=0;r=i&&e0){var s=this._mediaElement.buffered.start(0);(s<1&&e0&&t.currentTime0){var i=r.start(0);if(i<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",t={mimeType:e+this._mediaDataSource.type};return this._mediaElement&&(t.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(t.width=this._mediaElement.videoWidth,t.height=this._mediaElement.videoHeight)),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,r=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var s=this._mediaElement.getVideoPlaybackQuality();r=s.totalVideoFrames,i=s.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(r=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=r,e.droppedFrames=i),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(n.default.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(n.default.STATISTICS_INFO,this.statisticsInfo)},e}();t["default"]=l},"./src/player/player-errors.js": +/*!*************************************!*\ + !*** ./src/player/player-errors.js ***! + \*************************************/function(e,t,r){"use strict";r.r(t),r.d(t,{ErrorTypes:function(){return n},ErrorDetails:function(){return a}});var i=r(/*! ../io/loader.js */"./src/io/loader.js"),s=r(/*! ../demux/demux-errors.js */"./src/demux/demux-errors.js"),n={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},a={NETWORK_EXCEPTION:i.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:i.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:i.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:i.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:s.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:s.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:s.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js": +/*!*************************************!*\ + !*** ./src/player/player-events.js ***! + \*************************************/function(e,t,r){"use strict";r.r(t);var i={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};t["default"]=i},"./src/remux/aac-silent.js": +/*!*********************************!*\ + !*** ./src/remux/aac-silent.js ***! + \*********************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();t["default"]=i},"./src/remux/mp4-generator.js": +/*!************************************!*\ + !*** ./src/remux/mp4-generator.js ***! + \************************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=e.constants={};r.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),r.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),r.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),r.STSC=r.STCO=r.STTS,r.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),r.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),r.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),r.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,r=null,i=Array.prototype.slice.call(arguments,1),s=i.length,n=0;n>>24&255,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r.set(e,4);var a=8;for(n=0;n>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var r=t.id,i=t.duration,s=t.presentWidth,n=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,s>>>8&255,255&s,0,0,n>>>8&255,255&n,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var r=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))},e.hdlr=function(t){var r=null;return r="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,r)},e.minf=function(t){var r=null;return r="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,r,e.dinf(),e.stbl(t))},e.dinf=function(){var t=e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF));return t},e.stbl=function(t){var r=e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO));return r},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var r=t.channelCount,i=t.audioSampleRate,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],s)},e.mp4a=function(t){var r=t.channelCount,i=t.audioSampleRate,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,s,e.esds(t))},e.esds=function(t){var r=t.config||[],i=r.length,s=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(r).concat([6,1,2]));return e.box(e.types.esds,s)},e.avc1=function(t){var r=t.avcc,i=t.codecWidth,s=t.codecHeight,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,s>>>8&255,255&s,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,n,e.box(e.types.avcC,r))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var r=t.id,i=new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)},e.moof=function(t,r){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,r))},e.mfhd=function(t){var r=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,r)},e.traf=function(t,r){var i=t.id,s=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),n=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),a=e.sdtp(t),o=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,s,n,o,a)},e.sdtp=function(t){for(var r=t.samples||[],i=r.length,s=new Uint8Array(4+i),n=0;n>>24&255,s>>>16&255,s>>>8&255,255&s,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var o=0;o>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.isNonSync,0,0,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*o)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();i.init(),t["default"]=i},"./src/remux/mp4-remuxer.js": +/*!**********************************!*\ + !*** ./src/remux/mp4-remuxer.js ***! + \**********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ./mp4-generator.js */"./src/remux/mp4-generator.js"),n=r(/*! ./aac-silent.js */"./src/remux/aac-silent.js"),a=r(/*! ../utils/browser.js */"./src/utils/browser.js"),o=r(/*! ../core/media-segment-info.js */"./src/core/media-segment-info.js"),l=r(/*! ../utils/exception.js */"./src/utils/exception.js"),d=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new o.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new o.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.default.chrome||!(a.default.version.major<50||50===a.default.version.major&&a.default.version.build<2661)),this._fillSilentAfterSeek=a.default.msedge||a.default.msie,this._mp3UseMpegAudio=!a.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new l.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var r=null,i="mp4",n=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(i="mpeg",n="",r=new Uint8Array):r=s.default.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,r=s.default.generateInitSegment(t)}if(!this._onInitSegment)throw new l.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:r.buffer,codec:n,container:e+"/"+i,mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,r={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(r.samples.push(e),r.length=e.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(i.samples.push(t),i.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(r,!0),this._remuxAudio(i,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var r=e,l=r.samples,d=void 0,h=-1,c=-1,u=this._audioMeta.refSampleDuration,f="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,p=this._dtsBaseInited&&void 0===this._audioNextDts,m=!1;if(l&&0!==l.length&&(1!==l.length||t)){var g=0,y=null,v=0;f?(g=0,v=r.length):(g=8,v=8+r.length);var _=null;if(l.length>1&&(_=l.pop(),v-=_.length),null!=this._audioStashedLastSample){var E=this._audioStashedLastSample;this._audioStashedLastSample=null,l.unshift(E),v+=E.length}null!=_&&(this._audioStashedLastSample=_);var b=l[0].dts-this._dtsBase;if(this._audioNextDts)d=b-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())d=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(m=!0);else{var T=this._audioSegmentInfoList.getLastSampleBefore(b);if(null!=T){var S=b-(T.originalDts+T.duration);S<=3&&(S=0);var L=T.dts+T.duration+S;d=b-L}else d=0}if(m){var A=b-d,w=this._videoSegmentInfoList.getLastSegmentBefore(b);if(null!=w&&w.beginDts=U*u&&this._fillAudioTimestampGap&&!a.default.safari){O=!0;var B=Math.floor(d/u);i.default.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: "+P+" ms, curRefDts: "+N+" ms, dtsCorrection: "+Math.round(d)+" ms, generate: "+B+" frames"),k=Math.floor(N),F=Math.floor(N+u)-k;R=n.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==R&&(i.default.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),R=C),M=[];for(var $=0;$=1?D[D.length-1].duration:Math.floor(u);this._audioNextDts=k+F}-1===h&&(h=k),D.push({dts:k,pts:k,cts:0,unit:E.unit,size:E.unit.byteLength,duration:F,originalDts:P,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),O&&D.push.apply(D,M)}}if(0===D.length)return r.samples=[],void(r.length=0);f?y=new Uint8Array(v):(y=new Uint8Array(v),y[0]=v>>>24&255,y[1]=v>>>16&255,y[2]=v>>>8&255,y[3]=255&v,y.set(s.default.types.mdat,4));for(x=0;x1&&(p=i.pop(),f-=p.length),null!=this._videoStashedLastSample){var m=this._videoStashedLastSample;this._videoStashedLastSample=null,i.unshift(m),f+=m.length}null!=p&&(this._videoStashedLastSample=p);var g=i[0].dts-this._dtsBase;if(this._videoNextDts)n=g-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var y=this._videoSegmentInfoList.getLastSampleBefore(g);if(null!=y){var v=g-(y.originalDts+y.duration);v<=3&&(v=0);var _=y.dts+y.duration+v;n=g-_}else n=0}for(var E=new o.MediaSegmentInfo,b=[],T=0;T=1?b[b.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(L){var D=new o.SampleInfo(A,R,k,m.dts,!0);D.fileposition=m.fileposition,E.appendSyncPoint(D)}b.push({dts:A,pts:R,cts:w,units:m.units,size:m.length,isKeyframe:L,duration:k,originalDts:S,flags:{isLeading:0,dependsOn:L?2:1,isDependedOn:L?1:0,hasRedundancy:0,isNonSync:L?0:1}})}u=new Uint8Array(f),u[0]=f>>>24&255,u[1]=f>>>16&255,u[2]=f>>>8&255,u[3]=255&f,u.set(s.default.types.mdat,4);for(T=0;T=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],r=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],s={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:r[0]||""},n={};if(s.browser){n[s.browser]=!0;var a=s.majorVersion.split(".");n.version={major:parseInt(s.majorVersion,10),string:s.version},a.length>1&&(n.version.minor=parseInt(a[1],10)),a.length>2&&(n.version.build=parseInt(a[2],10))}if(s.platform&&(n[s.platform]=!0),(n.chrome||n.opr||n.safari)&&(n.webkit=!0),n.rv||n.iemobile){n.rv&&delete n.rv;var o="msie";s.browser=o,n[o]=!0}if(n.edge){delete n.edge;var l="msedge";s.browser=l,n[l]=!0}if(n.opr){var d="opera";s.browser=d,n[d]=!0}if(n.safari&&n.android){var h="android";s.browser=h,n[h]=!0}for(var c in n.name=s.browser,n.platform=s.platform,i)i.hasOwnProperty(c)&&delete i[c];Object.assign(i,n)}s(),t["default"]=i},"./src/utils/exception.js": +/*!********************************!*\ + !*** ./src/utils/exception.js ***! + \********************************/function(e,t,r){"use strict";r.r(t),r.d(t,{RuntimeException:function(){return s},IllegalStateException:function(){return n},InvalidArgumentException:function(){return a},NotImplementedException:function(){return o}});var i=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),s=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),n=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(s),a=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(s),o=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(s)},"./src/utils/logger.js": +/*!*****************************!*\ + !*** ./src/utils/logger.js ***! + \*****************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=function(){function e(){}return e.e=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",i),e.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))},e.i=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))},e.w=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))},e.d=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",i),e.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))},e.v=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",i),e.ENABLE_VERBOSE&&console.log(i)},e}();n.GLOBAL_TAG="flv.js",n.FORCE_GLOBAL_TAG=!1,n.ENABLE_ERROR=!0,n.ENABLE_INFO=!0,n.ENABLE_WARN=!0,n.ENABLE_DEBUG=!0,n.ENABLE_VERBOSE=!0,n.ENABLE_CALLBACK=!1,n.emitter=new(s()),t["default"]=n},"./src/utils/logging-control.js": +/*!**************************************!*\ + !*** ./src/utils/logging-control.js ***! + \**************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! ./logger.js */"./src/utils/logger.js"),a=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return n.default.FORCE_GLOBAL_TAG},set:function(t){n.default.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return n.default.GLOBAL_TAG},set:function(t){n.default.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return n.default.ENABLE_VERBOSE&&n.default.ENABLE_DEBUG&&n.default.ENABLE_INFO&&n.default.ENABLE_WARN&&n.default.ENABLE_ERROR},set:function(t){n.default.ENABLE_VERBOSE=t,n.default.ENABLE_DEBUG=t,n.default.ENABLE_INFO=t,n.default.ENABLE_WARN=t,n.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return n.default.ENABLE_DEBUG},set:function(t){n.default.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return n.default.ENABLE_VERBOSE},set:function(t){n.default.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return n.default.ENABLE_INFO},set:function(t){n.default.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return n.default.ENABLE_WARN},set:function(t){n.default.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return n.default.ENABLE_ERROR},set:function(t){n.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:n.default.GLOBAL_TAG,forceGlobalTag:n.default.FORCE_GLOBAL_TAG,enableVerbose:n.default.ENABLE_VERBOSE,enableDebug:n.default.ENABLE_DEBUG,enableInfo:n.default.ENABLE_INFO,enableWarn:n.default.ENABLE_WARN,enableError:n.default.ENABLE_ERROR,enableCallback:n.default.ENABLE_CALLBACK}},e.applyConfig=function(e){n.default.GLOBAL_TAG=e.globalTag,n.default.FORCE_GLOBAL_TAG=e.forceGlobalTag,n.default.ENABLE_VERBOSE=e.enableVerbose,n.default.ENABLE_DEBUG=e.enableDebug,n.default.ENABLE_INFO=e.enableInfo,n.default.ENABLE_WARN=e.enableWarn,n.default.ENABLE_ERROR=e.enableError,n.default.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var r=e.getConfig();t.emit("change",r)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){n.default.emitter.addListener("log",t),n.default.emitter.listenerCount("log")>0&&(n.default.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){n.default.emitter.removeListener("log",t),0===n.default.emitter.listenerCount("log")&&(n.default.ENABLE_CALLBACK=!1,e._notifyChange())},e}();a.emitter=new(s()),t["default"]=a},"./src/utils/polyfill.js": +/*!*******************************!*\ + !*** ./src/utils/polyfill.js ***! + \*******************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r=128){t.push(String.fromCharCode(65535&a)),s+=2;continue}}}else if(r[s]<240){if(i(r,s,2)){a=(15&r[s])<<12|(63&r[s+1])<<6|63&r[s+2];if(a>=2048&&55296!==(63488&a)){t.push(String.fromCharCode(65535&a)),s+=3;continue}}}else if(r[s]<248&&i(r,s,3)){a=(7&r[s])<<18|(63&r[s+1])<<12|(63&r[s+2])<<6|63&r[s+3];if(a>65536&&a<1114112){a-=65536,t.push(String.fromCharCode(a>>>10|55296)),t.push(String.fromCharCode(1023&a|56320)),s+=4;continue}}t.push(String.fromCharCode(65533)),++s}return t.join("")}r.r(t),t["default"]=s}},r={};function i(t){var s=r[t];if(void 0!==s)return s.exports;var n=r[t]={exports:{}};return e[t].call(n.exports,n,n.exports,i),n.exports}i.m=e,function(){i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,{a:t}),t}}(),function(){i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}}(),function(){i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}();var s=i("./src/index.js");return s}()}))}).call(this,r("4362"))}}]); \ No newline at end of file diff --git a/dist/build/h5/static/js/pages-basics-profile-detail~pages-index-monitor.ed39a1f1.js b/dist/build/h5/static/js/pages-basics-profile-detail~pages-index-monitor.ed39a1f1.js deleted file mode 100644 index 8b807a5..0000000 --- a/dist/build/h5/static/js/pages-basics-profile-detail~pages-index-monitor.ed39a1f1.js +++ /dev/null @@ -1,141 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-basics-profile-detail~pages-index-monitor"],{"02b9":function(e,t,r){"use strict";var i;r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i}));var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-uni-view",{staticClass:"h-full w-full"},[r("div",{ref:"muiPlayer"})])},n=[]},2222:function(e,t,r){"use strict";r.r(t);var i=r("e2e5"),s=r.n(i);for(var n in i)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(n);t["default"]=s.a},2931:function(e,t,r){"use strict";r.r(t);var i=r("35b9"),s=r("e52e");for(var n in s)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return s[e]}))}(n);var a,o=r("f0c5"),l=Object(o["a"])(s["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],a);t["default"]=l.exports},"2cb3":function(e,t,r){"use strict";r.r(t);var i=r("02b9"),s=r("2222");for(var n in s)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return s[e]}))}(n);var a,o=r("f0c5"),l=Object(o["a"])(s["default"],i["b"],i["c"],!1,null,"400fd559",null,!1,i["a"],a);t["default"]=l.exports},3315:function(e,t,r){var i=r("ae74");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var s=r("4f06").default;s("89233f1a",i,!0,{sourceMap:!1,shadowMode:!1})},"35b9":function(e,t,r){"use strict";var i;r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i}));var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-uni-view",[e.address?r("LiveVideo",{key:e.address,attrs:{url:e.address,type:e.type}}):e._e()],1)},n=[]},"3c35":function(e,t){(function(t){e.exports=t}).call(this,{})},4362:function(e,t,r){t.nextTick=function(e){var t=Array.prototype.slice.call(arguments);t.shift(),setTimeout((function(){e.apply(null,t)}),0)},t.platform=t.arch=t.execPath=t.title="browser",t.pid=1,t.browser=!0,t.env={},t.argv=[],t.binding=function(e){throw new Error("No such module. (Possibly not yet loaded)")},function(){var e,i="/";t.cwd=function(){return i},t.chdir=function(t){e||(e=r("df7c")),i=e.resolve(t,i)}}(),t.exit=t.kill=t.umask=t.dlopen=t.uptime=t.memoryUsage=t.uvCounters=function(){},t.features={}},a567:function(e,t,r){"use strict";function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}r.r(t),r.d(t,"default",(function(){return Fa}));var s={exports:{}};(function(e,t){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),t=t.trim(),!t){if(!r.alwaysNormalize)return e;var s=a.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");return s.path=a.normalizePath(s.path),a.buildURLFromParts(s)}var n=a.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return r.alwaysNormalize?(n.path=a.normalizePath(n.path),a.buildURLFromParts(n)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=i.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var d={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(d.netLoc=o.netLoc,"/"!==n.path[0]))if(n.path){var h=o.path,c=h.substring(0,h.lastIndexOf("/")+1)+n.path;d.path=a.normalizePath(c)}else d.path=o.path,n.params||(d.params=o.params,n.query||(d.query=o.query));return null===d.path&&(d.path=r.alwaysNormalize?a.normalizePath(n.path):n.path),a.buildURLFromParts(d)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){e=e.split("").reverse().join("").replace(s,"");while(e.length!==(e=e.replace(n,"")).length);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=a})()})(s);var n=s.exports;function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function o(e){for(var t=1;t`):g}function E(e,...t){t.forEach((function(t){v[t]=e[t]?e[t].bind(e):_(t)}))}function b(e,t){if(self.console&&!0===e||"object"===typeof e){E(e,"debug","log","info","warn","error");try{v.log(`Debug logs enabled for "${t}" in hls.js version 1.4.12`)}catch(r){v=y}}else v=y}const T=v,S=/^(\d+)x(\d+)$/,L=/(.+?)=(".*?"|.*?)(?:,|$)/g;class A{constructor(e){"string"===typeof e&&(e=A.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&("X-"===t.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const r=new Uint8Array(t.length/2);for(let e=0;eNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=S.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const r={},i='"';L.lastIndex=0;while(null!==(t=L.exec(e))){let e=t[2];0===e.indexOf(i)&&e.lastIndexOf(i)===e.length-1&&(e=e.slice(1,-1));const s=t[1].trim();r[s]=e}return r}}function w(e){return"ID"!==e&&"CLASS"!==e&&"START-DATE"!==e&&"DURATION"!==e&&"END-DATE"!==e&&"END-ON-NEXT"!==e}function R(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class k{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const r=t.attr;for(const t in r)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==r[t]){T.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=d(new A({}),r,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);u(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(u(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&u(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class I{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var D={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class x{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[D.AUDIO]:null,[D.VIDEO]:null,[D.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const r=e.split("@",2),i=[];1===r.length?i[0]=t?t.byteRangeEndOffset:0:i[0]=parseInt(r[1]),i[1]=parseInt(r[0])+i[0],this._byteRange=i}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=n.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class C extends x{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new I,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!u(this.programDateTime))return null;const e=u(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,r,i,s,n=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,i),o.endDTS=Math.max(o.endDTS,s)):a[e]={startPTS:t,endPTS:r,startDTS:i,endDTS:s,partial:n}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[D.AUDIO]=null,e[D.VIDEO]=null,e[D.AUDIOVIDEO]=null}}class P extends x{constructor(e,t,r,i,s){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new I,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,s),s&&(this.fragOffset=s.fragOffset+s.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const O=10;class M{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&u(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||O}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){const t=this.driftEnd-this.driftStart;return 1e3*t/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function F(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function N(e){const t=$(e).subarray(0,16),r=new Uint8Array(16);return r.set(t,16-t.length),r}function U(e){const t=function(e,t,r){const i=e[t];e[t]=e[r],e[r]=i};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function B(e){const t=e.split(":");let r=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),i=e[e.length-1].split(",");if(2===i.length){const t="base64"===i[0],s=i[1];t?(e.splice(-1,1),r=F(s)):r=N(s)}}return r}function $(e){return Uint8Array.from(unescape(encodeURIComponent(e)),e=>e.charCodeAt(0))}var G={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},j={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function K(e){switch(e){case j.FAIRPLAY:return G.FAIRPLAY;case j.PLAYREADY:return G.PLAYREADY;case j.WIDEVINE:return G.WIDEVINE;case j.CLEARKEY:return G.CLEARKEY}}var V={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function H(e){if(e===V.WIDEVINE)return G.WIDEVINE}function Y(e){switch(e){case G.FAIRPLAY:return j.FAIRPLAY;case G.PLAYREADY:return j.PLAYREADY;case G.WIDEVINE:return j.WIDEVINE;case G.CLEARKEY:return j.CLEARKEY}}function z(e){const{drmSystems:t,widevineLicenseUrl:r}=e,i=t?[G.FAIRPLAY,G.WIDEVINE,G.PLAYREADY,G.CLEARKEY].filter(e=>!!t[e]):[];return!i[G.WIDEVINE]&&r&&i.push(G.WIDEVINE),i}const W=function(){return"undefined"!==typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function q(e,t,r,i){let s;switch(e){case G.FAIRPLAY:s=["cenc","sinf"];break;case G.WIDEVINE:case G.PLAYREADY:s=["cenc"];break;case G.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+e)}return X(s,t,r,i)}function X(e,t,r,i){const s={initDataTypes:e,persistentState:i.persistentState||"not-allowed",distinctiveIdentifier:i.distinctiveIdentifier||"not-allowed",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:t.map(e=>({contentType:`audio/mp4; codecs="${e}"`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:r.map(e=>({contentType:`video/mp4; codecs="${e}"`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))};return[s]}function Q(e,t,r){return Uint8Array.prototype.slice?e.slice(t,r):new Uint8Array(Array.prototype.slice.call(e,t,r))}const Z=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,J=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,ee=(e,t)=>{const r=t;let i=0;while(Z(e,t)){i+=10;const r=te(e,t+6);i+=r,J(e,t+10)&&(i+=10),t+=i}if(i>0)return e.subarray(r,r+i)},te=(e,t)=>{let r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3],r},re=(e,t)=>Z(e,t)&&te(e,t+6)+10<=e.length-t,ie=e=>{const t=ae(e);for(let r=0;re&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,ne=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=te(e,4),i=10;return{type:t,size:r,data:e.subarray(i,i+r)}},ae=e=>{let t=0;const r=[];while(Z(e,t)){const i=te(e,t+6);t+=10;const s=t+i;while(t+8"PRIV"===e.type?le(e):"W"===e.type[0]?he(e):de(e),le=e=>{if(e.size<2)return;const t=ue(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}},de=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const r=ue(e.data.subarray(t),!0);t+=r.length+1;const i=ue(e.data.subarray(t));return{key:e.type,info:r,data:i}}const t=ue(e.data.subarray(1));return{key:e.type,data:t}},he=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const r=ue(e.data.subarray(t),!0);t+=r.length+1;const i=ue(e.data.subarray(t));return{key:e.type,info:r,data:i}}const t=ue(e.data);return{key:e.type,data:t}},ce=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),r=1&t[3];let i=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},ue=(e,t=!1)=>{const r=pe();if(r){const i=r.decode(e);if(t){const e=i.indexOf("\0");return-1!==e?i.substring(0,e):i}return i.replace(/\0/g,"")}const i=e.length;let s,n,a,o="",l=0;while(l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(s);break;case 12:case 13:n=e[l++],o+=String.fromCharCode((31&s)<<6|63&n);break;case 14:n=e[l++],a=e[l++],o+=String.fromCharCode((15&s)<<12|(63&n)<<6|(63&a)<<0);break}}return o};let fe;function pe(){return fe||"undefined"===typeof self.TextDecoder||(fe=new self.TextDecoder("utf-8")),fe}const me={hexDump:function(e){let t="";for(let r=0;r>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function Le(e,t){const r=[];if(!t.length)return r;const i=e.byteLength;for(let s=0;s1?s+n:i;if(a===t[0])if(1===t.length)r.push(e.subarray(s+8,o));else{const i=Le(e.subarray(s+8,o),t.slice(1));i.length&&ye.apply(r,i)}s=o}return r}function Ae(e){const t=[],r=e[0];let i=8;const s=be(e,i);i+=4;const n=0,a=0;i+=0===r?8:16,i+=2;let o=e.length+a;const l=Ee(e,i);i+=2;for(let d=0;d>>31;if(1===l)return T.warn("SIDX has hierarchical references (not supported)"),null;const d=be(e,r);r+=4,t.push({referenceSize:a,subsegmentDuration:d,info:{duration:d/s,start:o,end:o+a-1}}),o+=a,r+=4,i=r}return{earliestPresentationTime:n,timescale:s,version:r,referencesCount:l,references:t}}function we(e){const t=[],r=Le(e,["moov","trak"]);for(let s=0;s{const r=be(e,4),i=t[r];i&&(i.default={duration:be(e,12),flags:be(e,20)})}),t}function Re(e,t){if(!e||!t)return e;const r=t.keyId;if(r&&t.isCommonEncryption){const t=Le(e,["moov","trak"]);t.forEach(e=>{const t=Le(e,["mdia","minf","stbl","stsd"])[0],i=t.subarray(8);let s=Le(i,["enca"]);const n=s.length>0;n||(s=Le(i,["encv"])),s.forEach(e=>{const t=n?e.subarray(28):e.subarray(78),i=Le(t,["sinf"]);i.forEach(e=>{const t=ke(e);if(t){const e=t.subarray(8,24);e.some(e=>0!==e)||(T.log(`[eme] Patching keyId in 'enc${n?"a":"v"}>sinf>>tenc' box: ${me.hexDump(e)} -> ${me.hexDump(r)}`),t.set(r,8))}})})})}return e}function ke(e){const t=Le(e,["schm"])[0];if(t){const r=_e(t.subarray(4,8));if("cbcs"===r||"cenc"===r)return Le(e,["schi","tenc"])[0]}return T.error("[eme] missing 'schm' box"),null}function Ie(e,t){return Le(t,["moof","traf"]).reduce((t,r)=>{const i=Le(r,["tfdt"])[0],s=i[0],n=Le(r,["tfhd"]).reduce((t,r)=>{const n=be(r,4),a=e[n];if(a){let e=be(i,4);if(1===s){if(e===ge)return T.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;e*=ge+1,e+=be(i,8)}const r=a.timescale||9e4,n=e/r;if(isFinite(n)&&(null===t||ne+t.info.duration||0,0))}return t}return i||s}function xe(e){const t=be(e,0);let r=8;1&t&&(r+=4),4&t&&(r+=4);let i=0;const s=be(e,4);for(let n=0;n{Le(t,["tfhd"]).forEach(i=>{const s=be(i,4),n=e[s];if(!n)return;const a=n.timescale||9e4;Le(t,["tfdt"]).forEach(e=>{const t=e[0];let i=be(e,4);if(0===t)i-=r*a,i=Math.max(i,0),Se(e,4,i);else{i*=Math.pow(2,32),i+=be(e,8),i-=r*a,i=Math.max(i,0);const t=Math.floor(i/(ge+1)),s=Math.floor(i%(ge+1));Se(e,4,t),Se(e,8,s)}})})})}function Pe(e){const t={valid:null,remainder:null},r=Le(e,["moof"]);if(!r)return t;if(r.length<2)return t.remainder=e,t;const i=r[r.length-1];return t.valid=Q(e,0,i.byteOffset-8),t.remainder=Q(e,i.byteOffset-8),t}function Oe(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Me(e,t){const r=[],i=t.samples,s=t.timescale,n=t.id;let a=!1;const o=Le(i,["moof"]);return o.map(o=>{const l=o.byteOffset-8,d=Le(o,["traf"]);d.map(o=>{const d=Le(o,["tfdt"]).map(e=>{const t=e[0];let r=be(e,4);return 1===t&&(r*=Math.pow(2,32),r+=be(e,8)),r/s})[0];return void 0!==d&&(e=d),Le(o,["tfhd"]).map(d=>{const h=be(d,4),c=16777215&be(d,0),u=0!==(1&c),f=0!==(2&c),p=0!==(8&c);let m=0;const g=0!==(16&c);let y=0;const v=0!==(32&c);let _=8;h===n&&(u&&(_+=8),f&&(_+=4),p&&(m=be(d,_),_+=4),g&&(y=be(d,_),_+=4),v&&(_+=4),"video"===t.type&&(a=Fe(t.codec)),Le(o,["trun"]).map(n=>{const o=n[0],d=16777215&be(n,0),h=0!==(1&d);let c=0;const u=0!==(4&d),f=0!==(256&d);let p=0;const g=0!==(512&d);let v=0;const _=0!==(1024&d),E=0!==(2048&d);let b=0;const T=be(n,4);let S=8;h&&(c=be(n,S),S+=4),u&&(S+=4);let L=c+l;for(let l=0;l>1&63;return 39===e||40===e}{const e=31&t;return 6===e}}function Ue(e,t,r,i){const s=Be(e);let n=0;n+=t;let a=0,o=0,l=!1,d=0;while(n=s.length)break;d=s[n++],a+=d}while(255===d);o=0;do{if(n>=s.length)break;d=s[n++],o+=d}while(255===d);const e=s.length-n;if(!l&&4===a&&n16){const e=[];for(let r=0;r<16;r++){const t=s[n++].toString(16);e.push(1==t.length?"0"+t:t),3!==r&&5!==r&&7!==r&&9!==r||e.push("-")}const t=o-16,l=new Uint8Array(t);for(let r=0;re)break}}function Be(e){const t=e.byteLength,r=[];let i=1;while(i>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=255&i,n.set(e,4),s=0,i=8;s0?(n=new Uint8Array(4),t.length>0&&new DataView(n.buffer).setUint32(0,t.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(a.buffer).setUint32(0,r.byteLength,!1),Ge([112,115,115,104],new Uint8Array([i,0,0,0]),e,n,s,a,r||new Uint8Array)}function Ke(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},r=new DataView(e),i=r.getUint32(0);if(e.byteLength!==i&&i>44)return null;const s=r.getUint32(4);if(1886614376!==s)return null;if(t.version=r.getUint32(8)>>>24,t.version>1)return null;t.systemId=me.hexDump(new Uint8Array(e,12,16));const n=r.getUint32(28);if(0===t.version){if(i-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case j.PLAYREADY:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=je(e,null,t);const r=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=String.fromCharCode.apply(null,Array.from(r)),s=i.substring(i.indexOf("<"),i.length),n=new DOMParser,a=n.parseFromString(s,"text/xml"),o=a.getElementsByTagName("KID")[0];if(o){const e=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(e){const t=F(e).subarray(0,16);U(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Ve[this.uri];if(!e){const t=Object.keys(Ve).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);const r=new DataView(e.buffer,12,4);r.setUint32(0,t),Ve[this.uri]=e}this.keyId=e}return this}}function Ye(e){const t=new Uint8Array(16);for(let r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t}const ze=/\{\$([a-zA-Z0-9-_]+)\}/g;function We(e){return ze.test(e)}function qe(e,t,r){if(null!==e.variableList||e.hasVariableRefs)for(let i=r.length;i--;){const s=r[i],n=t[s];n&&(t[s]=Xe(e,n))}}function Xe(e,t){if(null!==e.variableList||e.hasVariableRefs){const r=e.variableList;return t.replace(ze,t=>{const i=t.substring(2,t.length-1),s=null==r?void 0:r[i];return void 0===s?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),t):s})}return t}function Qe(e,t,r){let i,s,n=e.variableList;if(n||(e.variableList=n={}),"QUERYPARAM"in t){i=t.QUERYPARAM;try{const e=new self.URL(r).searchParams;if(!e.has(i))throw new Error(`"${i}" does not match any query parameter in URI: "${r}"`);s=e.get(i)}catch(a){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: "+a.message))}}else i=t.NAME,s=t.VALUE;i in n?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=s||""}function Ze(e,t,r){const i=t.IMPORT;if(r&&i in r){let t=e.variableList;t||(e.variableList=t={}),t[i]=r[i]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}function Je(){if("undefined"!==typeof self)return self.MediaSource||self.WebKitMediaSource}const et={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},tt=Je();function rt(e,t){const r=et[t];return!!r&&!0===r[e.slice(0,4)]}function it(e,t){var r;return null!=(r=null==tt?void 0:tt.isTypeSupported(`${t||"video"}/mp4;codecs="${e}"`))&&r}const st=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,nt=/#EXT-X-MEDIA:(.*)/g,at=/^#EXT(?:INF|-X-TARGETDURATION):/m,ot=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),lt=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class dt{static findGroup(e,t){for(let r=0;r2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}static resolve(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return at.test(e)}static parseMasterPlaylist(e,t){const r=We(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},s=[];let n;st.lastIndex=0;while(null!=(n=st.exec(e)))if(n[1]){var a;const e=new A(n[1]);qe(i,e,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const r=Xe(i,n[2]),o={attrs:e,bitrate:e.decimalInteger("AVERAGE-BANDWIDTH")||e.decimalInteger("BANDWIDTH"),name:e.NAME,url:dt.resolve(r,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),ut((e.CODECS||"").split(/[ ,]+/).filter(e=>e),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=dt.convertAVC1ToAVCOTI(o.videoCodec)),null!=(a=o.unknownCodecs)&&a.length||s.push(o),i.levels.push(o)}else if(n[3]){const e=n[3],r=n[4];switch(e){case"SESSION-DATA":{const e=new A(r);qe(i,e,["DATA-ID","LANGUAGE","VALUE","URI"]);const t=e["DATA-ID"];t&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[t]=e);break}case"SESSION-KEY":{const e=ht(r,t,i);e.encrypted&&e.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(e)):T.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":{const e=new A(r);qe(i,e,["NAME","VALUE","QUERYPARAM"]),Qe(i,e,t)}break;case"CONTENT-STEERING":{const e=new A(r);qe(i,e,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:dt.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=ct(r);break}}const o=s.length>0&&s.length({id:e.attrs.AUDIO,audioCodec:e.audioCodec})),SUBTITLES:n.map(e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec})),"CLOSED-CAPTIONS":[]};let o=0;nt.lastIndex=0;while(null!==(i=nt.exec(e))){const e=new A(i[1]),n=e.TYPE;if(n){const i=a[n],l=s[n]||[];s[n]=l,qe(r,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const d={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",instreamId:e["INSTREAM-ID"],name:e.NAME||e.LANGUAGE||"",type:n,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:e.LANGUAGE,url:e.URI?dt.resolve(e.URI,t):""};if(null!=i&&i.length){const e=dt.findGroup(i,d.groupId)||i[0];ft(d,e,"audioCodec"),ft(d,e,"textCodec")}l.push(d)}}return s}static parseLevelPlaylist(e,t,r,i,s,n){const a=new M(t),o=a.fragments;let l,h,c,f=null,p=0,m=0,g=0,y=0,v=null,_=new C(i,t),E=-1,b=!1;ot.lastIndex=0,a.m3u8=e,a.hasVariableRefs=We(e);while(null!==(l=ot.exec(e))){b&&(b=!1,_=new C(i,t),_.start=g,_.sn=p,_.cc=y,_.level=r,f&&(_.initSegment=f,_.rawProgramDateTime=f.rawProgramDateTime,f.rawProgramDateTime=null));const e=l[1];if(e){_.duration=parseFloat(e);const t=(" "+l[2]).slice(1);_.title=t||null,_.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(u(_.duration)){_.start=g,c&&yt(_,c,a),_.sn=p,_.level=r,_.cc=y,_.urlId=s,o.push(_);const e=(" "+l[3]).slice(1);_.relurl=Xe(a,e),mt(_,v),v=_,g+=_.duration,p++,m=0,b=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);v?_.setByteRange(e,v):_.setByteRange(e)}else if(l[5])_.rawProgramDateTime=(" "+l[5]).slice(1),_.tagList.push(["PROGRAM-DATE-TIME",_.rawProgramDateTime]),-1===E&&(E=o.length);else{if(l=l[0].match(lt),!l){T.warn("No matches on slow regex match for level playlist!");continue}for(h=1;h0&&e.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),a.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new A(s);a.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=a.partList;e||(e=a.partList=[]);const r=m>0?e[e.length-1]:void 0,i=m++,n=new A(s);qe(a,n,["BYTERANGE","URI"]);const o=new P(n,_,t,i,r);e.push(o),_.duration+=o.duration;break}case"PRELOAD-HINT":{const e=new A(s);qe(a,e,["URI"]),a.preloadHint=e;break}case"RENDITION-REPORT":{const e=new A(s);qe(a,e,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(e);break}default:T.warn("line parsed but not handled: "+l);break}}}v&&!v.relurl?(o.pop(),g-=v.duration,a.partList&&(a.fragmentHint=v)):a.partList&&(mt(_,v),_.cc=y,a.fragmentHint=_,c&&yt(_,c,a));const S=o.length,L=o[0],w=o[S-1];if(g+=a.skippedSegments*a.targetduration,g>0&&S&&w){a.averagetargetduration=g/S;const e=w.sn;a.endSN="initSegment"!==e?e:0,a.live||(w.endList=!0),L&&(a.startCC=L.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(g+=a.fragmentHint.duration),a.totalduration=g,a.endCC=y,E>0&&pt(o,E),a}}function ht(e,t,r){var i,s;const n=new A(e);qe(r,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const a=null!=(i=n.METHOD)?i:"",o=n.URI,l=n.hexadecimalInteger("IV"),d=n.KEYFORMATVERSIONS,h=null!=(s=n.KEYFORMAT)?s:"identity";o&&n.IV&&!l&&T.error("Invalid IV: "+n.IV);const c=o?dt.resolve(o,t):"",u=(d||"1").split("/").map(Number).filter(Number.isFinite);return new He(a,c,h,u,l)}function ct(e){const t=new A(e),r=t.decimalFloatingPoint("TIME-OFFSET");return u(r)?r:null}function ut(e,t){["video","audio","text"].forEach(r=>{const i=e.filter(e=>rt(e,r));if(i.length){const s=i.filter(e=>0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0));t[r+"Codec"]=s.length>0?s[0]:i[0],e=e.filter(e=>-1===i.indexOf(e))}}),t.unknownCodecs=e}function ft(e,t,r){const i=t[r];i&&(e[r]=i)}function pt(e,t){let r=e[t];for(let i=t;i--;){const t=e[i];if(!t)return;t.programDateTime=r.programDateTime-1e3*t.duration,r=t}}function mt(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),u(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function gt(e,t,r,i){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",i&&(e.levelkeys=i),e.initSegment=null}function yt(e,t,r){e.levelkeys=t;const{encryptedFragments:i}=r;i.length&&i[i.length-1].levelkeys===t||!Object.keys(t).some(e=>t[e].isCommonEncryption)||i.push(e)}var vt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},_t={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Et(e){const{type:t}=e;switch(t){case vt.AUDIO_TRACK:return _t.AUDIO;case vt.SUBTITLE_TRACK:return _t.SUBTITLE;default:return _t.MAIN}}function bt(e,t){let r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}class Tt{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(f.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(f.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,i=t.loader,s=r||i,n=new s(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:vt.MANIFEST,url:r,deliveryDirectives:null})}onLevelLoading(e,t){const{id:r,level:i,url:s,deliveryDirectives:n}=t;this.load({id:r,level:i,responseType:"text",type:vt.LEVEL,url:s,deliveryDirectives:n})}onAudioTrackLoading(e,t){const{id:r,groupId:i,url:s,deliveryDirectives:n}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:vt.AUDIO_TRACK,url:s,deliveryDirectives:n})}onSubtitleTrackLoading(e,t){const{id:r,groupId:i,url:s,deliveryDirectives:n}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:vt.SUBTITLE_TRACK,url:s,deliveryDirectives:n})}load(e){var t;const r=this.hls.config;let i,s=this.getInternalLoader(e);if(s){const t=s.context;if(t&&t.url===e.url)return void T.trace("[playlist-loader]: playlist request ongoing");T.log("[playlist-loader]: aborting previous loader for type: "+e.type),s.abort()}if(i=e.type===vt.MANIFEST?r.manifestLoadPolicy.default:d({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part){let t;if(e.type===vt.LEVEL&&null!==e.level?t=this.hls.levels[e.level].details:e.type===vt.AUDIO_TRACK&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===vt.SUBTITLE_TRACK&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,r=t.targetduration;if(e&&r){const t=1e3*Math.max(3*e,.8*r);i=d({},i,{maxTimeToFirstByteMs:Math.min(t,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,i.maxTimeToFirstByteMs)})}}}const n=i.errorRetry||i.timeoutRetry||{},a={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},o={onSuccess:(e,t,r,i)=>{const s=this.getInternalLoader(r);this.resetInternalLoader(r.type);const n=e.data;0===n.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),dt.isMediaPlaylist(n)?this.handleTrackOrLevelPlaylist(e,t,r,i||null,s):this.handleMasterPlaylist(e,t,r,i)):this.handleManifestParsingError(e,r,new Error("no EXTM3U delimiter"),i||null,t)},onError:(e,t,r,i)=>{this.handleNetworkError(t,r,!1,e,i)},onTimeout:(e,t,r)=>{this.handleNetworkError(t,r,!0,void 0,e)}};s.load(e,a,o)}handleMasterPlaylist(e,t,r,i){const s=this.hls,n=e.data,a=bt(e,r),o=dt.parseMasterPlaylist(n,a);if(o.playlistParsingError)return void this.handleManifestParsingError(e,r,o.playlistParsingError,i,t);const{contentSteering:l,levels:d,sessionData:h,sessionKeys:c,startTimeOffset:u,variableList:p}=o;this.variableList=p;const{AUDIO:m=[],SUBTITLES:g,"CLOSED-CAPTIONS":y}=dt.parseMasterPlaylistMedia(n,a,o);if(m.length){const e=m.some(e=>!e.url);e||!d[0].audioCodec||d[0].attrs.AUDIO||(T.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new A({}),bitrate:0,url:""}))}s.trigger(f.MANIFEST_LOADED,{levels:d,audioTracks:m,subtitles:g,captions:y,contentSteering:l,url:a,stats:t,networkDetails:i,sessionData:h,sessionKeys:c,startTimeOffset:u,variableList:p})}handleTrackOrLevelPlaylist(e,t,r,i,s){const n=this.hls,{id:a,level:o,type:l}=r,d=bt(e,r),h=u(a)?a:0,c=u(o)?o:h,p=Et(r),m=dt.parseLevelPlaylist(e.data,d,c,p,h,this.variableList);if(l===vt.MANIFEST){const e={attrs:new A({}),bitrate:0,details:m,name:"",url:d};n.trigger(f.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:d,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=m,this.handlePlaylistLoaded(m,e,t,r,i,s)}handleManifestParsingError(e,t,r,i,s){this.hls.trigger(f.ERROR,{type:p.NETWORK_ERROR,details:m.MANIFEST_PARSING_ERROR,fatal:t.type===vt.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:i,stats:s})}handleNetworkError(e,t,r=!1,i,s){let n=`A network ${r?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===vt.LEVEL?n+=`: ${e.level} id: ${e.id}`:e.type!==vt.AUDIO_TRACK&&e.type!==vt.SUBTITLE_TRACK||(n+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(n);T.warn("[playlist-loader]: "+n);let l=m.UNKNOWN,d=!1;const h=this.getInternalLoader(e);switch(e.type){case vt.MANIFEST:l=r?m.MANIFEST_LOAD_TIMEOUT:m.MANIFEST_LOAD_ERROR,d=!0;break;case vt.LEVEL:l=r?m.LEVEL_LOAD_TIMEOUT:m.LEVEL_LOAD_ERROR,d=!1;break;case vt.AUDIO_TRACK:l=r?m.AUDIO_TRACK_LOAD_TIMEOUT:m.AUDIO_TRACK_LOAD_ERROR,d=!1;break;case vt.SUBTITLE_TRACK:l=r?m.SUBTITLE_TRACK_LOAD_TIMEOUT:m.SUBTITLE_LOAD_ERROR,d=!1;break}h&&this.resetInternalLoader(e.type);const c={type:p.NETWORK_ERROR,details:l,fatal:d,url:e.url,loader:h,context:e,error:a,networkDetails:t,stats:s};if(i){const r=(null==t?void 0:t.url)||e.url;c.response=o({url:r,data:void 0},i)}this.hls.trigger(f.ERROR,c)}handlePlaylistLoaded(e,t,r,i,s,n){const a=this.hls,{type:o,level:l,id:d,groupId:h,deliveryDirectives:c}=i,u=bt(t,i),g=Et(i),y="number"===typeof i.level&&g===_t.MAIN?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void a.trigger(f.ERROR,{type:p.NETWORK_ERROR,details:m.LEVEL_EMPTY_ERROR,fatal:!1,url:u,error:e,reason:e.message,response:t,context:i,level:y,parent:g,networkDetails:s,stats:r})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const v=e.playlistParsingError;if(v)a.trigger(f.ERROR,{type:p.NETWORK_ERROR,details:m.LEVEL_PARSING_ERROR,fatal:!1,url:u,error:v,reason:v.message,response:t,context:i,level:y,parent:g,networkDetails:s,stats:r});else switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),n.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case vt.MANIFEST:case vt.LEVEL:a.trigger(f.LEVEL_LOADED,{details:e,level:y||0,id:d||0,stats:r,networkDetails:s,deliveryDirectives:c});break;case vt.AUDIO_TRACK:a.trigger(f.AUDIO_TRACK_LOADED,{details:e,id:d||0,groupId:h||"",stats:r,networkDetails:s,deliveryDirectives:c});break;case vt.SUBTITLE_TRACK:a.trigger(f.SUBTITLE_TRACK_LOADED,{details:e,id:d||0,groupId:h||"",stats:r,networkDetails:s,deliveryDirectives:c});break}}}function St(e,t){let r;try{r=new Event("addtrack")}catch(i){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function Lt(e,t){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(i){T.debug("[texttrack-utils]: "+i);try{const r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}catch(s){T.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+s)}}"disabled"===r&&(e.mode=r)}function At(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function wt(e,t,r,i){const s=e.mode;if("disabled"===s&&(e.mode="hidden"),e.cues&&e.cues.length>0){const s=kt(e.cues,t,r);for(let t=0;te[r].endTime)return-1;let i=0,s=r;while(i<=s){const n=Math.floor((s+i)/2);if(te[n].startTime&&i-1)for(let n=s,a=e.length;n=t&&s.endTime<=r)i.push(s);else if(s.startTime>r)return i}return i}var It={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Dt=.25;function xt(){if("undefined"!==typeof self)return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const Ct=(()=>{const e=xt();try{new e(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Pt(e,t){return e.getTime()/1e3-t}function Ot(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Mt{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(At(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tCt&&(i=Ct);const o=i-r;o<=0&&(i=r+Dt);for(let s=0;se.type===It.audioId3&&o:"video"===i?e=>e.type===It.emsg&&a:e=>e.type===It.audioId3&&o||e.type===It.emsg&&a,wt(s,t,r,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:r,id3Track:i}=this,{dateRanges:s}=t,n=Object.keys(s);if(i){const e=Object.keys(r).filter(e=>!n.includes(e));for(let t=e.length;t--;){const s=e[t];Object.keys(r[s].cues).forEach(e=>{i.removeCue(r[s].cues[e])}),delete r[s]}}const a=t.fragments[t.fragments.length-1];if(0===n.length||!u(null==a?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=a.programDateTime/1e3-a.start,l=xt();for(let d=0;d{const i=s[r];return i.class===t.class&&i.id!==r&&i.startDate>t.startDate&&e.push(i),e},[]).sort((e,t)=>e.startDate.getTime()-t.startDate.getTime())[0];e&&(u=Pt(e.startDate,o),h=!0)}const p=Object.keys(t.attr);for(let r=0;rthis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:r,targetduration:i}=e,{liveSyncDuration:s,liveSyncDurationCount:n,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&r||t;(o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==s?s:n*i);const d=i,h=1;return l+Math.min(this.stallCount*h,d)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;const i=r.edge,s=e-t-this.edgeStalled,n=i-r.totalduration,a=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(n,s),a)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(f.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(f.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var r;t.details===m.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(r=this.levelDetails)&&r.live&&T.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const r=this.computeLatency();if(null===r)return;this._latency=r;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||1===s)return;const n=this.targetLatency;if(null===n)return;const a=r-n,o=Math.min(this.maxLatency,n+t.targetduration),l=a.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,s)),r=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,r))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const Nt=["NONE","TYPE-0","TYPE-1",null];var Ut={No:"",Yes:"YES",v2:"v2"};function Bt(e,t){const{canSkipUntil:r,canSkipDateRanges:i,endSN:s}=e,n=void 0!==t?t-s:0;return r&&ne).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}get textGroupId(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function jt(e,t){const r=t.startPTS;if(u(r)){let i,s=0;t.sn>e.sn?(s=r-e.start,i=e):(s=e.start-r,i=t),i.duration!==s&&(i.duration=s)}else if(t.sn>e.sn){const r=e.cc===t.cc;r&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration}else t.start=Math.max(e.start-t.duration,0)}function Kt(e,t,r,i,s,n){const a=i-r;a<=0&&(T.warn("Fragment should have a positive duration",t),i=r+t.duration,n=s+t.duration);let o=r,l=i;const d=t.startPTS,h=t.endPTS;if(u(d)){const e=Math.abs(d-r);u(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,o=Math.max(r,d),r=Math.min(r,d),s=Math.min(s,t.startDTS),l=Math.min(i,h),i=Math.max(i,h),n=Math.max(n,t.endDTS)}const c=r-t.start;0!==t.start&&(t.start=r),t.duration=i-t.start,t.startPTS=r,t.maxStartPTS=o,t.startDTS=s,t.endPTS=i,t.minEndPTS=l,t.endDTS=n;const f=t.sn;if(!e||fe.endSN)return 0;let p;const m=f-e.startSN,g=e.fragments;for(g[m]=t,p=m;p>0;p--)jt(g[p],g[p-1]);for(p=m;p=0;l--){const e=i[l].initSegment;if(e){r=e;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let s,n=0;if(zt(e,t,(e,i)=>{e.relurl&&(n=e.cc-i.cc),u(e.startPTS)&&u(e.endPTS)&&(i.start=i.startPTS=e.startPTS,i.startDTS=e.startDTS,i.maxStartPTS=e.maxStartPTS,i.endPTS=e.endPTS,i.endDTS=e.endDTS,i.minEndPTS=e.minEndPTS,i.duration=e.endPTS-e.startPTS,i.duration&&(s=i),t.PTSKnown=t.alignedSliding=!0),i.elementaryStreams=e.elementaryStreams,i.loader=e.loader,i.stats=e.stats,i.urlId=e.urlId,e.initSegment&&(i.initSegment=e.initSegment,r=e.initSegment)}),r){const e=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;e.forEach(e=>{var t;e.initSegment&&e.initSegment.relurl!==(null==(t=r)?void 0:t.relurl)||(e.initSegment=r)})}if(t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some(e=>!e),t.deltaUpdateFailed){T.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=Ht(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const a=t.fragments;if(n){T.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats}),s?Kt(t,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):Wt(e,t),a.length&&(t.totalduration=t.edge-a[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const e=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=e),t.driftEndTime=o,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function Ht(e,t,r){const i=d({},e);return r&&r.forEach(e=>{delete i[e]}),Object.keys(t).forEach(e=>{const r=new k(t[e].attr,i[e]);r.isValid?i[e]=r:T.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)}),i}function Yt(e,t,r){if(e&&t){let i=0;for(let s=0,n=e.length;s<=n;s++){const n=e[s],a=t[s+i];n&&a&&n.index===a.index&&n.fragment.sn===a.fragment.sn?r(n,a):i--}}}function zt(e,t,r){const i=t.skippedSegments,s=Math.max(e.startSN,t.startSN)-t.startSN,n=(e.fragmentHint?1:0)+(i?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let d=s;d<=n;d++){const e=l[a+d];let s=o[d];i&&!s&&d=i.length||qt(t,i[r].start)}function qt(e,t){if(t){const r=e.fragments;for(let i=e.skippedSegments;it){const e=1e3*i[i.length-1].duration;e499)}const ar={search:function(e,t){let r=0,i=e.length-1,s=null,n=null;while(r<=i){s=(r+i)/2|0,n=e[s];const a=t(n);if(a>0)r=s+1;else{if(!(a<0))return n;i=s-1}}return null}};function or(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!u(t))return null;const i=e[0].programDateTime;if(t<(i||0))return null;const s=e[e.length-1].endProgramDateTime;if(t>=(s||0))return null;r=r||0;for(let n=0;ne)return 0;const i=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=e?1:r.start-i>e&&r.start?-1:0}function hr(e,t,r){const i=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0)),s=r.endProgramDateTime||0;return s-i>e}function cr(e,t){return ar.search(e,e=>e.cct?-1:0)}const ur=3e5;var fr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},pr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class mr{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=T.log.bind(T,"[info]:"),this.warn=T.warn.bind(T,"[warning]:"),this.error=T.error.bind(T,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(f.ERROR,this.onError,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(f.ERROR,this.onError,this),e.off(f.ERROR,this.onErrorOut,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(null==e?void 0:e.type)===_t.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var r,i;if(t.fatal)return;const s=this.hls,n=t.context;switch(t.details){case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case m.FRAG_PARSING_ERROR:if(null!=(r=t.frag)&&r.gap)return void(t.errorAction={action:fr.DoNothing,flags:pr.None});case m.FRAG_GAP:case m.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=fr.SendAlternateToPenaltyBox);case m.LEVEL_EMPTY_ERROR:case m.LEVEL_PARSING_ERROR:{var a,o;const e=t.parent===_t.MAIN?t.level:s.loadLevel;t.details===m.LEVEL_EMPTY_ERROR&&null!=(a=t.context)&&null!=(o=a.levelDetails)&&o.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:return void("number"===typeof(null==n?void 0:n.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level)));case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.SUBTITLE_LOAD_ERROR:case m.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const e=s.levels[s.loadLevel];if(e&&(n.type===vt.AUDIO_TRACK&&n.groupId===e.audioGroupId||n.type===vt.SUBTITLE_TRACK&&n.groupId===e.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=fr.SendAlternateToPenaltyBox,void(t.errorAction.flags=pr.MoveAllAlternatesMatchingHost)}return;case m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=s.levels[s.loadLevel],r=null==e?void 0:e.attrs["HDCP-LEVEL"];r&&(t.errorAction={action:fr.SendAlternateToPenaltyBox,flags:pr.MoveAllAlternatesMatchingHDCP,hdcpLevel:r})}return;case m.BUFFER_ADD_CODEC_ERROR:case m.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(i=t.level)?i:s.loadLevel));case m.INTERNAL_EXCEPTION:case m.BUFFER_APPENDING_ERROR:case m.BUFFER_APPEND_ERROR:case m.BUFFER_FULL_ERROR:case m.LEVEL_SWITCH_ERROR:case m.BUFFER_STALLED_ERROR:case m.BUFFER_SEEK_OVER_HOLE:case m.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:fr.DoNothing,flags:pr.None})}if(t.type===p.KEY_SYSTEM_ERROR){const e=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,e))}}getPlaylistRetryOrSwitchAction(e,t){var r;const i=this.hls,s=tr(i.config.playlistLoadPolicy,e),n=this.playlistError++,a=null==(r=e.response)?void 0:r.code,o=sr(s,n,er(e),a);if(o)return{action:fr.RetryRequest,flags:pr.None,retryConfig:s,retryCount:n};const l=this.getLevelSwitchAction(e,t);return s&&(l.retryConfig=s,l.retryCount=n),l}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),i=t.levels[r],{fragLoadPolicy:s,keyLoadPolicy:n}=t.config,a=tr(e.details.startsWith("key")?n:s,e),o=t.levels.reduce((e,t)=>e+t.fragmentError,0);if(i){var l;e.details!==m.FRAG_GAP&&i.fragmentError++;const t=null==(l=e.response)?void 0:l.code,r=sr(a,o,er(e),t);if(r)return{action:fr.RetryRequest,flags:pr.None,retryConfig:a,retryCount:o}}const d=this.getLevelSwitchAction(e,r);return a&&(d.retryConfig=a,d.retryCount=o),d}getLevelSwitchAction(e,t){const r=this.hls;null!==t&&void 0!==t||(t=r.loadLevel);const i=this.hls.levels[t];if(i&&(i.loadError++,r.autoLevelEnabled)){var s,n;let t=-1;const{levels:a,loadLevel:o,minAutoLevel:l,maxAutoLevel:d}=r,h=null==(s=e.frag)?void 0:s.type,{type:c,groupId:u}=null!=(n=e.context)?n:{};for(let r=a.length;r--;){const s=(r+o)%a.length;if(s!==o&&s>=l&&s<=d&&0===a[s].loadError){const r=a[s];if(e.details===m.FRAG_GAP&&e.frag){const t=a[s].details;if(t){const r=lr(e.frag,t.fragments,e.frag.start);if(null!=r&&r.gap)continue}}else{if(c===vt.AUDIO_TRACK&&u===r.audioGroupId||c===vt.SUBTITLE_TRACK&&u===r.textGroupId)continue;if(h===_t.AUDIO&&i.audioGroupId===r.audioGroupId||h===_t.SUBTITLE&&i.textGroupId===r.textGroupId)continue}t=s;break}}if(t>-1&&r.loadLevel!==t)return e.levelRetry=!0,this.playlistError=0,{action:fr.SendAlternateToPenaltyBox,flags:pr.None,nextAutoLevel:t}}return{action:fr.SendAlternateToPenaltyBox,flags:pr.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch(null==(r=t.errorAction)?void 0:r.action){case fr.DoNothing:break;case fr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===m.FRAG_GAP||(t.fatal=!0);break}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:i,hdcpLevel:s,nextAutoLevel:n}=r;switch(i){case pr.None:this.switchLevel(e,n);break;case pr.MoveAllAlternatesMatchingHost:r.resolved||(r.resolved=this.redundantFailover(e));break;case pr.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=Nt[Nt.indexOf(s)-1],r.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}r.resolved||this.switchLevel(e,n)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:r}=this,i=e.parent===_t.MAIN?e.level:t.loadLevel,s=t.levels[i],n=s.url.length,a=e.frag?e.frag.urlId:s.urlId;s.urlId!==a||e.frag&&!s.details||this.penalizeRendition(s,e);for(let o=1;o{e.urlId=l}),t.nextLoadLevel=i,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:r}=this,i=r[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};i.lastErrorPerfMs=performance.now(),i.errors.push(t),i.details=e.details,r[e.urlId]=i}}function gr(e,t,r){if(performance.now()-e.lastErrorPerfMs>ur)return!0;const i=e.details;if(t.details===m.FRAG_GAP&&i&&t.frag){const e=t.frag.start,r=lr(null,i.fragments,e);if(r&&!r.gap)return!0}if(r&&e.errors.length3*i.targetduration)return!0}return!1}class yr{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=T.log.bind(T,t+":"),this.warn=T.warn.bind(T,t+":"),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const r=null==t?void 0:t.renditionReports;if(r){let s=-1;for(let n=0;n=0&&e>t.partTarget&&(n+=1)}return new $t(i,n>=0?n:void 0,Ut.No)}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,r){const{details:i,stats:s}=t,n=self.performance.now(),a=s.loading.first?Math.max(0,n-s.loading.first):0;if(i.advancedDateTime=Date.now()-a,i.live||null!=r&&r.live){if(i.reloaded(r),r&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),r&&i.fragments.length>0&&Vt(r,i),!this.canLoad||!i.live)return;let a,o=void 0,l=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){const e=this.hls.config.lowLatencyMode,s=i.lastPartSn,n=i.endSN,d=i.lastPartIndex,h=-1!==d,c=s===n,u=e?0:d;h?(o=c?n+1:s,l=c?u:d+1):o=n+1;const f=i.age,p=f+i.ageHeader;let m=Math.min(p-i.partTarget,1.5*i.targetduration);if(m>0){if(r&&m>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${m} with playlist age: ${i.age}`),m=0;else{const e=Math.floor(m/i.targetduration);if(o+=e,void 0!==l){const e=Math.round(m%i.targetduration/i.partTarget);l+=e}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${f.toFixed(2)}s goal: ${m} skip sn ${e} to part ${l}`)}i.tuneInGoal=m}if(a=this.getDeliveryDirectives(i,t.deliveryDirectives,o,l),e||!c)return void this.loadPlaylist(a)}else(i.canBlockReload||i.canSkipUntil)&&(a=this.getDeliveryDirectives(i,t.deliveryDirectives,o,l));const d=this.hls.mainForwardBufferInfo,h=d?d.end-d.len:0,c=1e3*(i.edge-h),u=Xt(i,c);i.updated&&n>this.requestScheduled+u&&(this.requestScheduled=s.loading.start),void 0!==o&&i.canBlockReload?this.requestScheduled=s.loading.first+u-(1e3*i.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+uthis.loadPlaylist(a),f)}else this.clearTimer()}getDeliveryDirectives(e,t,r,i){let s=Bt(e,r);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,i=t.part,s=Ut.No),new $t(r,i,s)}checkRetry(e){const t=e.details,r=er(e),i=e.errorAction,{action:s,retryCount:n=0,retryConfig:a}=i||{},o=!!i&&!!a&&(s===fr.RetryRequest||!i.resolved&&s===fr.SendAlternateToPenaltyBox);if(o){var l;if(this.requestScheduled=-1,n>=a.maxNumRetry)return!1;if(r&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=rr(a,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),e),this.warn(`Retrying playlist loading ${n+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,i.resolved=!0}return o}}let vr;class _r extends yr{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(f.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(f.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){const e=this._levels;e.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const r=[],i={};let s;t.levels.forEach(e=>{var t;const n=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(vr||(vr=/chrome|firefox/i.test(navigator.userAgent)),vr&&(e.audioCodec=void 0));const{AUDIO:a,CODECS:o,"FRAME-RATE":l,"PATHWAY-ID":d,RESOLUTION:h,SUBTITLES:c}=n,u=(d||".")+"-",f=`${u}${e.bitrate}-${h}-${l}-${o}`;s=i[f],s?s.addFallback(e):(s=new Gt(e),i[f]=s,r.push(s)),Er(s,"audio",a),Er(s,"text",c)}),this.filterAndSortMediaOptions(r,t)}filterAndSortMediaOptions(e,t){let r=[],i=[],s=!1,n=!1,a=!1,o=e.filter(({audioCodec:e,videoCodec:t,width:r,height:i,unknownCodecs:o})=>(s||(s=!(!r||!i)),n||(n=!!t),a||(a=!!e),!(null!=o&&o.length)&&(!e||it(e,"audio"))&&(!t||it(t,"video"))));if((s||n)&&a&&(o=o.filter(({videoCodec:e,width:t,height:r})=>!!e||!(!t||!r))),0===o.length)return void Promise.resolve().then(()=>{if(this.hls){const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}});t.audioTracks&&(r=t.audioTracks.filter(e=>!e.audioCodec||it(e.audioCodec,"audio")),br(r)),t.subtitles&&(i=t.subtitles,br(i));const l=o.slice(0);o.sort((e,t)=>e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):s&&e.height!==t.height?e.height-t.height:0);let d=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let u=0;u!!e.url)};this.hls.trigger(f.MANIFEST_PARSED,c),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const r=new Error("invalid level idx"),i=e<0;if(this.hls.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.LEVEL_SWITCH_ERROR,level:e,fatal:i,error:r,reason:r.message}),i)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,i=this.currentLevel,s=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],a=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,r===e&&n.details&&i&&s===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${r}${s?" with Pathway "+s:""}`);const o=d({},n,{level:e,maxBitrate:n.maxBitrate,attrs:n.attrs,uri:n.uri,urlId:n.urlId});delete o._attrs,delete o._urlId,this.hls.trigger(f.LEVEL_SWITCHING,o);const l=n.details;if(!l||l.live){const e=this.switchParams(n.uri,null==i?void 0:i.details);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===vt.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(void 0!==t&&t.type===_t.MAIN){const e=this._levels[t.level];void 0!==e&&(e.loadError=0)}}onLevelLoaded(e,t){var r;const{level:i,details:s}=t,n=this._levels[i];var a;if(!n)return this.warn("Invalid level index "+i),void(null!=(a=t.deliveryDirectives)&&a.skip&&(s.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===n.fragmentError&&(n.loadError=0),this.playlistLoaded(i,t,n.details)):null!=(r=t.deliveryDirectives)&&r.skip&&(s.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const r=this.currentLevel;if(!r)return;const i=this.hls.audioTracks[t.id].groupId;if(r.audioGroupIds&&r.audioGroupId!==i){let e=-1;for(let t=0;tr!==t,i=this._levels.filter((i,s)=>s!==e||(i.url.length>1&&void 0!==t?(i.url=i.url.filter(r),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(r)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(r)),i.urlId=0,!0):(this.steering&&this.steering.removeLevel(i),!1)));this.hls.trigger(f.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){t.forEach((e,t)=>{const{details:r}=e;null!=r&&r.fragments&&r.fragments.forEach(e=>{e.level=t})}),this._levels=t}}function Er(e,t,r){r&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=r):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=r))}function br(e){const t={};e.forEach(e=>{const r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++})}var Tr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Sr{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(f.BUFFER_APPENDED,this.onBufferAppended,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.BUFFER_APPENDED,this.onBufferAppended,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let i=r.length;i--;){const t=r[i];if(!t)break;const s=t.end;if(t.start<=e&&null!==s&&e<=s)return t}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:r}=this,i=Object.keys(r);for(let s=i.length;s--;){const n=r[i[s]];if((null==n?void 0:n.body.type)===t&&n.buffered){const t=n.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,r,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(null==i?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(i=>{const n=this.fragments[i];if(!n)return;if(s>=n.body.sn)return;if(!n.buffered&&!n.loaded)return void(n.body.type===r&&this.removeFragment(n.body));const a=n.range[e];a&&a.time.some(e=>{const r=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&this.removeFragment(n.body),r})})}detectPartialFragments(e){const t=this.timeRanges,{frag:r,part:i}=e;if(!t||"initSegment"===r.sn)return;const s=Ar(r),n=this.fragments[s];if(!n||n.buffered&&r.gap)return;const a=!r.relurl;if(Object.keys(t).forEach(e=>{const s=r.elementaryStreams[e];if(!s)return;const o=t[e],l=a||!0===s.partial;n.range[e]=this.getBufferedTimes(r,i,l,o)}),n.loaded=null,Object.keys(n.range).length){n.buffered=!0;const e=n.body.endList=r.endList||n.body.endList;e&&(this.endListFragments[n.body.type]=n),Lr(n)||this.removeParts(r.sn-1,r.type)}else this.removeFragment(n.body)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=r.filter(t=>t.fragment.sn>=e))}fragBuffered(e,t){const r=Ar(e);let i=this.fragments[r];!i&&t&&(i=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,r,i){const s={time:[],partial:r},n=e.start,a=e.end,o=e.minEndPTS||a,l=e.maxStartPTS||n;for(let d=0;d=e&&o<=t){s.time.push({startPTS:Math.max(n,i.start(d)),endPTS:Math.min(a,i.end(d))});break}if(ne)s.partial=!0,s.time.push({startPTS:Math.max(n,i.start(d)),endPTS:Math.min(a,i.end(d))});else if(a<=e)break}return s}getPartialFragment(e){let t,r,i,s=null,n=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach(l=>{const d=o[l];d&&Lr(d)&&(r=d.body.start-a,i=d.body.end+a,e>=r&&e<=i&&(t=Math.min(e-r,i-e),n<=t&&(s=d.body,n=t)))}),s}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||Lr(t))}getState(e){const t=Ar(e),r=this.fragments[t];return r?r.buffered?Lr(r)?Tr.PARTIAL:Tr.OK:Tr.APPENDING:Tr.NOT_LOADED}isTimeBuffered(e,t,r){let i,s;for(let n=0;n=i&&t<=s)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:r,part:i}=t;if("initSegment"===r.sn||r.bitrateTest)return;const s=i?null:t,n=Ar(r);this.fragments[n]={body:r,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:i,timeRanges:s}=t;if("initSegment"===r.sn)return;const n=r.type;if(i){let e=this.activePartLists[n];e||(this.activePartLists[n]=e=[]),e.push(i)}this.timeRanges=s,Object.keys(s).forEach(e=>{const t=s[e];this.detectEvictedFragments(e,t,n,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ar(e);return!!this.fragments[t]}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,r,i,s){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const a=this.fragments[n];if(!a)return;const o=a.body;o.type!==r||i&&!o.gap||o.starte&&(a.buffered||s)&&this.removeFragment(o)})}removeFragment(e){const t=Ar(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const t=e.sn;this.activePartLists[e.type]=r.filter(e=>e.fragment.sn!==t)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function Lr(e){var t,r,i;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(r=e.range.audio)?void 0:r.partial)||(null==(i=e.range.audiovideo)?void 0:i.partial))}function Ar(e){return`${e.type}_${e.level}_${e.urlId}_${e.sn}`}const wr=Math.pow(2,17);class Rr{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const r=e.url;if(!r)return Promise.reject(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(r?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,s=i.fLoader,n=i.loader;return new Promise((a,l)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some(e=>"GAP"===e[0]))return void l(Ir(e));e.gap=!1}const d=this.loader=e.loader=s?new s(i):new n(i),h=kr(e),c=ir(i.fragLoadPolicy.default),u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:wr};e.stats=d.stats,d.load(h,u,{onSuccess:(t,r,i,s)=>{this.resetLoader(e,d);let n=t.data;i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(n.slice(0,16)),n=n.slice(16)),a({frag:e,part:null,payload:n,networkDetails:s})},onError:(t,i,s,n)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:o({url:r,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:s,stats:n}))},onAbort:(t,r,i)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:(t,r,i)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:i,stats:t}))},onProgress:(r,i,s,n)=>{t&&t({frag:e,part:null,payload:s,networkDetails:n})}})})}loadPart(e,t,r){this.abort();const i=this.config,s=i.fLoader,n=i.loader;return new Promise((a,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void l(Ir(e,t));const d=this.loader=e.loader=s?new s(i):new n(i),h=kr(e,t),c=ir(i.fragLoadPolicy.default),u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:wr};t.stats=d.stats,d.load(h,u,{onSuccess:(i,s,n,o)=>{this.resetLoader(e,d),this.updateStatsFromPart(e,t);const l={frag:e,part:t,payload:i.data,networkDetails:o};r(l),a(l)},onError:(r,i,s,n)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:o({url:h.url,data:void 0},r),error:new Error(`HTTP Error ${r.code} ${r.text}`),networkDetails:s,stats:n}))},onAbort:(r,i,s)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:s,stats:r}))},onTimeout:(r,i,s)=>{this.resetLoader(e,d),l(new Dr({type:p.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:s,stats:r}))}})})}updateStatsFromPart(e,t){const r=e.stats,i=t.stats,s=i.total;if(r.loaded+=i.loaded,s){const i=Math.round(e.duration/t.duration),n=Math.min(Math.round(r.loaded/s),i),a=i-n,o=a*Math.round(r.loaded/n);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);const n=r.loading,a=i.loading;n.start?n.first+=a.first-a.start:(n.start=a.start,n.first=a.first),n.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function kr(e,t=null){const r=t||e,i={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},s=r.byteRangeStartOffset,n=r.byteRangeEndOffset;if(u(s)&&u(n)){var a;let t=s,r=n;if("initSegment"===e.sn&&"AES-128"===(null==(a=e.decryptdata)?void 0:a.method)){const e=n-s;e%16&&(r=n+(16-e%16)),0!==s&&(i.resetIV=!0,t=s-16)}i.rangeStart=t,i.rangeEnd=r}return i}function Ir(e,t){const r=new Error(`GAP ${e.gap?"tag":"attribute"} found`),i={type:p.MEDIA_ERROR,details:m.FRAG_GAP,fatal:!1,frag:e,error:r,networkDetails:null};return t&&(i.part=t),(t||e).stats.aborted=!0,new Dr(i)}class Dr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class xr{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const t in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[t].loader;if(r){if(e&&e!==r.context.frag.type)return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=m.KEY_LOAD_ERROR,r,i,s){return new Dr({type:p.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:r,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:r,cc:i}=e;for(let e=0;e{s.setKeyFormat(e)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,i;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const r=new Error(t?"Expected frag.decryptdata to be defined after setting format "+t:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,r))}const n=s.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));let a=this.keyUriToKeyInfo[n];if(null!=(r=a)&&r.decryptdata.key)return s.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});var o;if(null!=(i=a)&&i.keyLoadPromise)switch(null==(o=a.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(t=>(s.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}switch(a=this.keyUriToKeyInfo[n]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===s.keyFormat?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(r);if(t)return(e.keyLoadPromise=t.then(t=>(e.mediaKeySessionContext=t,r))).catch(t=>{throw e.keyLoadPromise=null,t})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,i=r.loader,s=new i(r);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((i,n)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=r.keyLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(e,t,r,s)=>{const{frag:a,keyInfo:o,url:l}=r;if(!a.decryptdata||o!==this.keyUriToKeyInfo[l])return n(this.createKeyLoadError(a,m.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),s));o.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,o.loader=null,i({frag:a,keyInfo:o})},onError:(e,r,i,s)=>{this.resetLoader(r),n(this.createKeyLoadError(t,m.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),i,o({url:a.url,data:void 0},e)))},onTimeout:(e,r,i)=>{this.resetLoader(r),n(this.createKeyLoadError(t,m.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),i))},onAbort:(e,r,i)=>{this.resetLoader(r),n(this.createKeyLoadError(t,m.INTERNAL_ABORTED,new Error("key loading aborted"),i))}};s.load(a,d,h)})}resetLoader(e){const{frag:t,keyInfo:r,url:i}=e,s=r.loader;t.keyLoader===s&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[i],s&&s.destroy()}}class Cr{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const Pr={length:0,start:()=>0,end:()=>0};class Or{static isBuffered(e,t){try{if(e){const r=Or.getBuffered(e);for(let e=0;e=r.start(e)&&t<=r.end(e))return!0}}catch(r){}return!1}static bufferInfo(e,t,r){try{if(e){const i=Or.getBuffered(e),s=[];let n;for(n=0;ns&&(i[t-1].end=e[l].end):i.push(e[l])}else i.push(e[l])}else i=e;let s,n=0,a=t,o=t;for(let l=0;l=e&&tr.startCC||e&&e.cc>>8^255&r^99,e[f]=r,t[r]=f;const o=u[f],m=u[o],g=u[m];let y=257*u[r]^16843008*r;i[f]=y<<24|y>>>8,s[f]=y<<16|y>>>16,n[f]=y<<8|y>>>24,a[f]=y,y=16843009*g^65537*m^257*o^16843008*f,l[r]=y<<24|y>>>8,d[r]=y<<16|y>>>16,h[r]=y<<8|y>>>24,c[r]=y,f?(f=o^u[u[u[g^o]]],p^=u[u[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,i=0;while(i{if(!i)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");const s=new Yr(i,new Uint8Array(r));return s.decrypt(e.buffer,t)}).catch(i=>(T.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,r)))}onWebCryptoError(e,t,r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%Xr;return r!==e.length&&(t=Q(e,0,r),this.remainderData=Q(e,r)),t}logOnce(e){this.logEnabled&&(T.log("[decrypter]: "+e),this.logEnabled=!1)}}const Zr={toString:function(e){let t="";const r=e.length;for(let i=0;ia.end){const e=n>s;(n{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)};this._doFragLoad(e,t,r,i).then(t=>{if(!t)return;const r=this.state;this.fragContextChanged(e)?(r===Jr.FRAG_LOADING||!this.fragCurrent&&r===Jr.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=Jr.IDLE):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(f.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))}).catch(t=>{this.state!==Jr.STOPPED&&this.state!==Jr.ERROR&&(this.warn(t),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this,i=r.getState(e);if(i===Tr.APPENDING){const t=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,t),s=Math.max(e.duration,i?i.len:this.config.maxBufferLength);this.reduceMaxBufferLength(s)&&r.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===Tr.PARTIAL&&r.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,r=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:r};this.hls.trigger(f.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t}).then(t=>{const{hls:r}=this,{payload:i}=t,s=e.decryptdata;if(i&&i.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){const n=self.performance.now();return this.decrypter.decrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer).catch(t=>{throw r.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t}).then(i=>{const s=self.performance.now();return r.trigger(f.FRAG_DECRYPTED,{frag:e,payload:i,stats:{tstart:n,tdecrypt:s}}),t.payload=i,t})}return t}).then(r=>{const{fragCurrent:i,hls:s,levels:n}=this;if(!n)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=Jr.IDLE,t.fragmentError=0,e.data=new Uint8Array(r.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),r.frag===i&&s.trigger(f.FRAG_BUFFERED,{stats:a,frag:i,part:null,id:e.type}),this.tick()}).catch(t=>{this.state!==Jr.STOPPED&&this.state!==Jr.ERROR&&(this.warn(t),this.resetFragmentLoading(e))})}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var r,i,s,n;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===_t.MAIN?"level":"track"} ${e.level} (frag:[${(null!=(r=e.startPTS)?r:NaN).toFixed(3)}-${(null!=(i=e.endPTS)?i:NaN).toFixed(3)}] > buffer:${a?Zr.toString(Or.getBuffered(a)):"(detached)"})`),this.state=Jr.IDLE,a&&(!this.loadedmetadata&&e.type==_t.MAIN&&a.buffered.length&&(null==(s=this.fragCurrent)?void 0:s.sn)===(null==(n=this.fragPrevious)?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:i,partsLoaded:s}=e,n=!s||0===s.length||s.some(e=>!e),a=new Mr(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,i){var s;const n=null==t?void 0:t.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let a=null;if(!e.encrypted||null!=(s=e.decryptdata)&&s.key?!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=Jr.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(f.KEY_LOADED,e),this.state===Jr.KEY_LOADING&&(this.state=Jr.IDLE),e}),this.hls.trigger(f.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),r=Math.max(e.start,r||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){const s=n.partList;if(s&&i){r>e.end&&n.fragmentHint&&(e=n.fragmentHint);const o=this.getNextPart(s,e,r);if(o>-1){const l=s[o];let d;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${n.startSN}-${n.endSN}] parts [0-${o}-${s.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Jr.FRAG_LOADING,d=a?a.then(r=>!r||this.fragContextChanged(r.frag)?null:this.doFragPartsLoad(e,l,t,i)).catch(e=>this.handleFragLoadError(e)):this.doFragPartsLoad(e,l,t,i).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(f.FRAG_LOADING,{frag:e,part:l,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}if(!e.url||this.loadedEndOfParts(s,r))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${n?"of ["+n.startSN+"-"+n.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(r.toFixed(3))}`),u(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Jr.FRAG_LOADING;const o=this.config.progressive;let l;return l=o&&a?a.then(t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,i)).catch(e=>this.handleFragLoadError(e)):Promise.all([this.fragmentLoader.load(e,o?i:void 0),a]).then(([e])=>(!o&&e&&i&&i(e),e)).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(f.FRAG_LOADING,{frag:e,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,r,i){return new Promise((s,n)=>{var a;const o=[],l=null==(a=r.details)?void 0:a.partList,d=t=>{this.fragmentLoader.loadPart(e,t,i).then(i=>{o[t.index]=i;const n=i.part;this.hls.trigger(f.FRAG_LOADED,i);const a=Zt(r,e.sn,t.index+1)||Jt(l,e.sn,t.index+1);if(!a)return s({frag:e,part:n,partsLoaded:o});d(a)}).catch(n)};d(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===m.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(f.ERROR,t)}else this.hls.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Jr.PARSING)return void(this.fragCurrent||this.state===Jr.STOPPED||this.state===Jr.ERROR||(this.state=Jr.IDLE));const{frag:r,part:i,level:s}=t,n=self.performance.now();r.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(r,i,s,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:i,sn:s,part:n}=e;if(null==t||!t[i])return this.warn(`Levels object was unset while buffering fragment ${s} of level ${i}. The current chunk will not be buffered.`),null;const a=t[i],o=n>-1?Zt(a,s,n):null,l=o?o.fragment:Qt(a,s,r);return l?(r&&r!==l&&(l.stats=r.stats),{frag:l,part:o,level:a}):null}bufferFragmentData(e,t,r,i,s){var n;if(!e||this.state!==Jr.PARSING)return;const{data1:a,data2:o}=e;let l=a;if(a&&o&&(l=Oe(a,o)),null==(n=l)||!n.length)return;const d={type:e.type,frag:t,part:r,chunkMeta:i,parent:t.type,data:l};if(this.hls.trigger(f.BUFFER_APPENDING,d),e.dropped&&e.independent&&!r){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Or.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const r=t.currentTime,i=Or.bufferInfo(t,r,0),s=e.duration,n=Math.min(2*this.config.maxFragLookUpTolerance,.25*s),a=Math.max(Math.min(e.start-n,i.end-n),r+n);e.start-a>n&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const r=this.getLoadPosition();return u(r)?this.getFwdBufferInfoAtPos(e,r,t):null}getFwdBufferInfoAtPos(e,t,r){const{config:{maxBufferHole:i}}=this,s=Or.bufferInfo(e,t,i);if(0===s.len&&void 0!==s.nextStart){const n=this.fragmentTracker.getBufferedFrag(t,r);if(n&&s.nextStart=r&&(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0)}getAppendedFrag(e,t=_t.MAIN){const r=this.fragmentTracker.getAppendedFrag(e,_t.MAIN);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,i=r.length;if(!i)return null;const{config:s}=this,n=r[0].start;let a;if(t.live){const n=s.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,r,i,s){const n=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(null===a)return a;if(e=a,n&&e&&!e.gap&&r.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,i);if(null!==t&&r.len+t.len>=s)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,r){let i=-1,s=!1,n=!0;for(let a=0,o=e.length;a-1&&rr.start&&r.loaded}getInitialLiveFragment(e,t){const r=this.fragPrevious;let i=null;if(r){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),i=or(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const s=r.sn+1;if(s>=e.startSN&&s<=e.endSN){const n=t[s-e.startSN];r.cc===n.cc&&(i=n,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=cr(t,r.cc),i&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn))}}else{const t=this.hls.liveSyncPosition;null!==t&&(i=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,r){const{config:i}=this;let{fragPrevious:s}=this,{fragments:n,endSN:a}=r;const{fragmentHint:o}=r,l=i.maxFragLookUpTolerance,d=r.partList,h=!!(i.lowLatencyMode&&null!=d&&d.length&&o);let c;if(h&&o&&!this.bitrateTest&&(n=n.concat(o),a=o.sn),et-l?0:l;c=lr(s,n,e,r)}else c=n[n.length-1];if(c){const e=c.sn-r.startSN,t=this.fragmentTracker.getState(c);if((t===Tr.OK||t===Tr.PARTIAL&&c.gap)&&(s=c),s&&c.sn===s.sn&&(!h||d[0].fragment.sn>c.sn)){const t=s&&c.level===s.level;if(t){const t=n[e+1];c=c.sn=n-t.maxFragLookUpTolerance&&s<=a;if(null!==i&&r.duration>i&&(s${e.startSN} prev-sn: ${s?s.sn:"na"} fragments: ${a}`),r}return o}waitForCdnTuneIn(e){const t=3;return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*t)}setStartPosition(e,t){let r=this.startPosition;if(r ${null==(i=this.fragCurrent)?void 0:i.url}`);const s=t.details===m.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(r,!0);const n=t.errorAction,{action:a,retryCount:o=0,retryConfig:l}=n||{};if(n&&a===fr.RetryRequest&&l){var d;this.resetStartWhenNotLoaded(null!=(d=this.levelLastLoaded)?d:r.level);const i=rr(l,o);this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${o+1}/${l.maxNumRetry} in ${i}ms`),n.resolved=!0,this.retryDate=self.performance.now()+i,this.state=Jr.FRAG_LOADING_WAITING_RETRY}else l&&n?(this.resetFragmentErrors(e),o.5;i&&this.reduceMaxBufferLength(r.len);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===_t.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Jr.STOPPED&&(this.state=Jr.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const i=Or.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,r),this.state===Jr.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Jr.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){var t;this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(null!=(t=this.levelLastLoaded)?t:e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,i){var s;const n=r.details;if(!n)return void this.warn("level.details undefined");const a=Object.keys(e.elementaryStreams).reduce((t,s)=>{const a=e.elementaryStreams[s];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${s} duration reliably (${o})`),t||!1;const l=i?0:Kt(n,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return this.hls.trigger(f.LEVEL_PTS_UPDATED,{details:n,level:r,drift:l,type:s,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t},!1);if(a)r.fragmentError=0;else if(null===(null==(s=this.transmuxer)?void 0:s.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(0===r.fragmentError&&(r.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(t.message),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Jr.PARSED,this.hls.trigger(f.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){var t,r,i;"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(null!=(t=null!=(r=this.levelLastLoaded)?r:null==(i=this.fragCurrent)?void 0:i.level)?t:0),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function ti(){return self.SourceBuffer||self.WebKitSourceBuffer}function ri(){const e=Je();if(!e)return!1;const t=ti(),r=e&&"function"===typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!t||t.prototype&&"function"===typeof t.prototype.appendBuffer&&"function"===typeof t.prototype.remove;return!!r&&!!i}function ii(){var e;const t=ti();return"function"===typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}function si(){return"function"===typeof __HLS_WORKER_BUNDLE__}function ni(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),r=new self.Worker(t);return{worker:r,objectURL:t}}function ai(e){const t=new self.URL(e,self.location.href).href,r=new self.Worker(t);return{worker:r,scriptURL:t}}function oi(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class li{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,r,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=Oe(this.cachedData,e),this.cachedData=null);let r,i=ee(e,0),s=i?i.length:0;const n=this._audioTrack,a=this._id3Track,o=i?ie(i):void 0,l=e.length;(null===this.basePTS||0===this.frameIndex&&u(o))&&(this.basePTS=di(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),i&&i.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:It.audioId3,duration:Number.POSITIVE_INFINITY});while(s{if(u(e))return 90*e;const i=r?9e4*r.baseTime/r.timescale:0;return 9e4*t+i};function hi(e,t,r,i){let s,n,a,o;const l=navigator.userAgent.toLowerCase(),d=i,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&t[r+2])>>>6);const c=(60&t[r+2])>>>2;if(!(c>h.length-1))return a=(1&t[r+2])<<2,a|=(192&t[r+3])>>>6,T.log(`manifest codec:${i}, ADTS type:${s}, samplingIndex:${c}`),/firefox/i.test(l)?c>=6?(s=5,o=new Array(4),n=c-3):(s=2,o=new Array(2),n=c):-1!==l.indexOf("android")?(s=2,o=new Array(2),n=c):(s=5,o=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&c>=6?n=c-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(c>=6&&1===a||/vivaldi/i.test(l))||!i&&1===a)&&(s=2,o=new Array(2)),n=c)),o[0]=s<<3,o[0]|=(14&c)>>1,o[1]|=(1&c)<<7,o[1]|=a<<3,5===s&&(o[1]|=(14&n)>>1,o[2]=(1&n)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[c],channelCount:a,codec:"mp4a.40."+s,manifestCodec:d};e.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+c})}function ci(e,t){return 255===e[t]&&240===(246&e[t+1])}function ui(e,t){return 1&e[t+1]?7:9}function fi(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function pi(e,t){return t+5=e.length)return!1;const i=fi(e,t);if(i<=r)return!1;const s=t+i;return s===e.length||mi(e,s)}return!1}function vi(e,t,r,i,s){if(!e.samplerate){const n=hi(t,r,i,s);if(!n)return;e.config=n.config,e.samplerate=n.samplerate,e.channelCount=n.channelCount,e.codec=n.codec,e.manifestCodec=n.manifestCodec,T.log(`parsed codec:${e.codec}, rate:${n.samplerate}, channels:${n.channelCount}`)}}function _i(e){return 9216e4/e}function Ei(e,t){const r=ui(e,t);if(t+r<=e.length){const i=fi(e,t)-r;if(i>0)return{headerLength:r,frameLength:i}}}function bi(e,t,r,i,s){const n=_i(e.samplerate),a=i+s*n,o=Ei(t,r);let l;if(o){const{frameLength:i,headerLength:s}=o,n=s+i,d=Math.max(0,r+n-t.length);d?(l=new Uint8Array(n-s),l.set(t.subarray(r+s,t.length),0)):l=t.subarray(r+s,r+n);const h={unit:l,pts:a};return d||e.samples.push(h),{sample:h,length:n,missing:d}}const d=t.length-r;l=new Uint8Array(d),l.set(t.subarray(r,t.length),0);const h={unit:l,pts:a};return{sample:h,length:d,missing:-1}}class Ti extends li{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ee(e,0)||[];let r=t.length;for(let i=e.length;r16384?e.subarray(0,16384):e,Le(e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let r=e;const i=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Oe(this.remainderData,e));const t=Pe(r);this.remainderData=t.remainder,i.samples=t.valid||new Uint8Array}else i.samples=r;const n=this.extractID3Track(i,t);return s.samples=Me(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:n,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return r.samples=Me(e,t),{videoTrack:t,audioTrack:oi(),id3Track:i,textTrack:oi()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const i=Le(e.samples,["emsg"]);i&&i.forEach(e=>{const i=$e(e);if(Si.test(i.schemeIdUri)){const e=u(i.presentationTime)?i.presentationTime/i.timeScale:t+i.presentationTimeDelta/i.timeScale;let s=4294967295===i.eventDuration?Number.POSITIVE_INFINITY:i.eventDuration/i.timeScale;s<=.001&&(s=Number.POSITIVE_INFINITY);const n=i.payload;r.samples.push({data:n,len:n.byteLength,dts:e,pts:e,type:It.emsg,duration:s})}})}return r}demuxSampleAes(e,t,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let Ai=null;const wi=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ri=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ki=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ii=[0,1,1,4];function Di(e,t,r,i,s){if(r+24>t.length)return;const n=xi(t,r);if(n&&r+n.frameLength<=t.length){const a=9e4*n.samplesPerFrame/n.sampleRate,o=i+s*a,l={unit:t.subarray(r,r+n.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=n.channelCount,e.samplerate=n.sampleRate,e.samples.push(l),{sample:l,length:n.frameLength,missing:0}}}function xi(e,t){const r=e[t+1]>>3&3,i=e[t+1]>>1&3,s=e[t+2]>>4&15,n=e[t+2]>>2&3;if(1!==r&&0!==s&&15!==s&&3!==n){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=3===r?3-i:3===i?3:4,d=1e3*wi[14*l+s-1],h=3===r?0:2===r?1:2,c=Ri[3*h+n],u=3===o?1:2,f=ki[r][i],p=Ii[i],m=8*f*p,g=Math.floor(f*d/c+a)*p;if(null===Ai){const e=navigator.userAgent||"",t=e.match(/Chrome\/(\d+)/i);Ai=t?parseInt(t[1]):0}const y=!!Ai&&Ai<=87;return y&&2===i&&d>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:g,samplesPerFrame:m}}}function Ci(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])}function Pi(e,t){return t+1e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const r=this.word>>>32-t;if(e>32&&T.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,r=8,i=8;for(let s=0;s{const n=new Uint8Array(s);i.set(n,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)})}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t);let i=0;for(let s=32;s{s.data=this.getAvcDecryptedUnit(n,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,i)})}decryptAvcSamples(e,t,r,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length)return void i();const s=e[t].units;for(;;r++){if(r>=s.length)break;const n=s[r];if(!(n.data.length<=48||1!==n.type&&5!==n.type)&&(this.decryptAvcSample(e,t,r,i,n),!this.decrypter.isSync()))return}}}}const Ui=188;class Bi{constructor(e,t,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=r}static probe(e){const t=Bi.syncOffset(e);return t>0&&T.warn("MPEG2-TS detected but first sync word found @ offset "+t),-1!==t}static syncOffset(e){const t=e.length;let r=Math.min(5*Ui,e.length-Ui)+1,i=0;while(i1&&(0===n&&a>2||o+Ui>r))return n}i++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:ve[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,r,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=Bi.createTrack("video"),this._audioTrack=Bi.createTrack("audio",i),this._id3Track=Bi.createTrack("id3"),this._txtTrack=Bi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,r=!1,i=!1){let s;r||(this.sampleAes=null);const n=this._avcTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let d=n.pid,h=n.pesData,c=a.pid,u=o.pid,g=a.pesData,y=o.pesData,v=null,_=this.pmtParsed,E=this._pmtId,b=e.length;if(this.remainderData&&(e=Oe(this.remainderData,e),b=e.length,this.remainderData=null),b>4;let m;if(p>1){if(m=f+5+e[f+4],m===f+Ui)continue}else m=f+4;switch(i){case d:t&&(h&&(s=Vi(h))&&this.parseAVCPES(n,l,s,!1),h={data:[],size:0}),h&&(h.data.push(e.subarray(m,f+Ui)),h.size+=f+Ui-m);break;case c:if(t){if(g&&(s=Vi(g)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,s);break;case"mp3":this.parseMPEGPES(a,s);break}g={data:[],size:0}}g&&(g.data.push(e.subarray(m,f+Ui)),g.size+=f+Ui-m);break;case u:t&&(y&&(s=Vi(y))&&this.parseID3PES(o,s),y={data:[],size:0}),y&&(y.data.push(e.subarray(m,f+Ui)),y.size+=f+Ui-m);break;case 0:t&&(m+=e[m]+1),E=this._pmtId=ji(e,m);break;case E:{t&&(m+=e[m]+1);const i=Ki(e,m,this.typeSupported,r);d=i.avc,d>0&&(n.pid=d),c=i.audio,c>0&&(a.pid=c,a.segmentCodec=i.segmentCodec),u=i.id3,u>0&&(o.pid=u),null===v||_||(T.warn(`MPEG-TS PMT found at ${f} after unknown PID '${v}'. Backtracking to sync byte @${S} to parse all TS packets.`),v=null,f=S-188),_=this.pmtParsed=!0;break}case 17:case 8191:break;default:v=i;break}}else L++;if(L>0){const e=new Error(`Found ${L} TS packet/s that do not start with 0x47`);this.observer.emit(f.ERROR,f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message})}n.pesData=h,a.pesData=g,o.pesData=y;const A={audioTrack:a,videoTrack:n,id3Track:o,textTrack:l};return i&&this.extractRemainingSamples(A),A}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:i,textTrack:s}=e,n=r.pesData,a=t.pesData,o=i.pesData;let l;if(n&&(l=Vi(n))?(this.parseAVCPES(r,s,l,!0),r.pesData=null):r.pesData=n,a&&(l=Vi(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break}t.pesData=null}else null!=a&&a.size&&T.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=Vi(o))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=o}demuxSampleAes(e,t,r){const i=this.demux(e,r,!0,!this.config.progressive),s=this.sampleAes=new Ni(this.observer,this.config,t);return this.decrypt(i,s)}decrypt(e,t){return new Promise(r=>{const{audioTrack:i,videoTrack:s}=e;i.samples&&"aac"===i.segmentCodec?t.decryptAacSamples(i.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{r(e)}):r(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{r(e)})})}destroy(){this._duration=0}parseAVCPES(e,t,r,i){const s=this.parseAVCNALu(e,r.data);let n,a=this.avcSample,o=!1;r.data=null,a&&s.length&&!e.audFound&&(Hi(a,e),a=this.avcSample=$i(!1,r.pts,r.dts,"")),s.forEach(i=>{var s;switch(i.type){case 1:{let t=!1;n=!0;const s=i.data;if(o&&s.length>4){const e=new Fi(s).readSliceType();2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var l;if(t)null!=(l=a)&&l.frame&&!a.key&&(Hi(a,e),a=this.avcSample=null);a||(a=this.avcSample=$i(!0,r.pts,r.dts,"")),a.frame=!0,a.key=t;break}case 5:n=!0,null!=(s=a)&&s.frame&&!a.key&&(Hi(a,e),a=this.avcSample=null),a||(a=this.avcSample=$i(!0,r.pts,r.dts,"")),a.key=!0,a.frame=!0;break;case 6:n=!0,Ue(i.data,1,r.pts,t.samples);break;case 7:if(n=!0,o=!0,!e.sps){const t=i.data,r=new Fi(t),s=r.readSPS();e.width=s.width,e.height=s.height,e.pixelRatio=s.pixelRatio,e.sps=[t],e.duration=this._duration;const n=t.subarray(1,4);let a="avc1.";for(let e=0;e<3;e++){let t=n[e].toString(16);t.length<2&&(t="0"+t),a+=t}e.codec=a}break;case 8:n=!0,e.pps||(e.pps=[i.data]);break;case 9:n=!1,e.audFound=!0,a&&Hi(a,e),a=this.avcSample=$i(!1,r.pts,r.dts,"");break;case 12:n=!0;break;default:n=!1,a&&(a.debug+="unknown NAL "+i.type+" ");break}if(a&&n){const e=a.units;e.push(i)}}),i&&a&&(Hi(a,e),this.avcSample=null)}getLastNalUnit(e){var t;let r,i=this.avcSample;if(i&&0!==i.units.length||(i=e[e.length-1]),null!=(t=i)&&t.units){const e=i.units;r=e[e.length-1]}return r}parseAVCNALu(e,t){const r=t.byteLength;let i=e.naluState||0;const s=i,n=[];let a,o,l,d=0,h=-1,c=0;-1===i&&(h=0,c=31&t[0],i=0,d=1);while(d=0){const e={data:t.subarray(h,d-i-1),type:c};n.push(e)}else{const r=this.getLastNalUnit(e.samples);if(r&&(s&&d<=4-s&&r.state&&(r.data=r.data.subarray(0,r.data.byteLength-s)),o=d-i-1,o>0)){const e=new Uint8Array(r.data.byteLength+o);e.set(r.data,0),e.set(t.subarray(0,o),r.data.byteLength),r.data=e,r.state=0}}d=0&&i>=0){const e={data:t.subarray(h,r),type:c,state:i};n.push(e)}if(0===n.length){const r=this.getLastNalUnit(e.samples);if(r){const e=new Uint8Array(r.data.byteLength+t.byteLength);e.set(r.data,0),e.set(t,r.data.byteLength),r.data=e}}return e.naluState=i,n}parseAACPES(e,t){let r=0;const i=this.aacOverFlow;let s,n,a,o=t.data;if(i){this.aacOverFlow=null;const t=i.missing,s=i.sample.unit.byteLength;if(-1===t){const e=new Uint8Array(s+o.byteLength);e.set(i.sample.unit,0),e.set(o,s),o=e}else{const n=s-t;i.sample.unit.set(o.subarray(0,t),n),e.samples.push(i.sample),r=i.missing}}for(s=r,n=o.length;s1){const e=new Uint8Array(o[0].length+o[1].length);e.set(o[0]),e.set(o[1],o[0].length),o[0]=e,o.splice(1,1)}t=o[0];const l=(t[0]<<16)+(t[1]<<8)+t[2];if(1===l){if(r=(t[4]<<8)+t[5],r&&r>e.size-6)return null;const l=t[7];192&l&&(s=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(n=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,s-n>54e5&&(T.warn(Math.round((s-n)/9e4)+"s delta between PTS and DTS, align them"),s=n)):n=s),i=t[8];let d=i+9;if(e.size<=d)return null;e.size-=d;const h=new Uint8Array(e.size);for(let e=0,r=o.length;er){d-=r;continue}t=t.subarray(d),r-=d,d=0}h.set(t,a),a+=r}return r&&(r-=i+3),{data:h,pts:s,dts:n,len:r}}return null}function Hi(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const r=t.samples,i=r.length;if(!i)return void t.dropped++;{const t=r[i-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&T.log(e.pts+"/"+e.dts+":"+e.debug)}class Yi extends li{resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ee(e,0)||[];let r=t.length;for(let i=e.length;r>24&255,n[1]=r>>16&255,n[2]=r>>8&255,n[3]=255&r,n.set(e,4),i=0,r=8;i>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}static mdia(e){return qi.box(qi.types.mdia,qi.mdhd(e.timescale,e.duration),qi.hdlr(e.type),qi.minf(e))}static mfhd(e){return qi.box(qi.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?qi.box(qi.types.minf,qi.box(qi.types.smhd,qi.SMHD),qi.DINF,qi.stbl(e)):qi.box(qi.types.minf,qi.box(qi.types.vmhd,qi.VMHD),qi.DINF,qi.stbl(e))}static moof(e,t,r){return qi.box(qi.types.moof,qi.mfhd(e),qi.traf(r,t))}static moov(e){let t=e.length;const r=[];while(t--)r[t]=qi.trak(e[t]);return qi.box.apply(null,[qi.types.moov,qi.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(qi.mvex(e)))}static mvex(e){let t=e.length;const r=[];while(t--)r[t]=qi.trex(e[t]);return qi.box.apply(null,[qi.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(Wi+1)),i=Math.floor(t%(Wi+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return qi.box(qi.types.mvhd,s)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let i,s;for(i=0;i>>8&255),s.push(255&i),s=s.concat(Array.prototype.slice.call(r));for(t=0;t>>8&255),n.push(255&i),n=n.concat(Array.prototype.slice.call(r));const a=qi.box(qi.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(n))),o=e.width,l=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return qi.box(qi.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,qi.box(qi.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),qi.box(qi.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,h>>24,h>>16&255,h>>8&255,255&h])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return qi.box(qi.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),qi.box(qi.types.esds,qi.esds(e)))}static mp3(e){const t=e.samplerate;return qi.box(qi.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?qi.box(qi.types.stsd,qi.STSD,qi.mp3(e)):qi.box(qi.types.stsd,qi.STSD,qi.mp4a(e)):qi.box(qi.types.stsd,qi.STSD,qi.avc1(e))}static tkhd(e){const t=e.id,r=e.duration*e.timescale,i=e.width,s=e.height,n=Math.floor(r/(Wi+1)),a=Math.floor(r%(Wi+1));return qi.box(qi.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,s>>8&255,255&s,0,0]))}static traf(e,t){const r=qi.sdtp(e),i=e.id,s=Math.floor(t/(Wi+1)),n=Math.floor(t%(Wi+1));return qi.box(qi.types.traf,qi.box(qi.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),qi.box(qi.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,n>>24,n>>16&255,n>>8&255,255&n])),qi.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,qi.box(qi.types.trak,qi.tkhd(e),qi.mdia(e))}static trex(e){const t=e.id;return qi.box(qi.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const r=e.samples||[],i=r.length,s=12+16*i,n=new Uint8Array(s);let a,o,l,d,h,c;for(t+=8+s,n.set(["video"===e.type?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,61440&h.degradPrio,15&h.degradPrio,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*a);return qi.box(qi.types.trun,n)}static initSegment(e){qi.types||qi.init();const t=qi.moov(e),r=new Uint8Array(qi.FTYP.byteLength+t.byteLength);return r.set(qi.FTYP),r.set(t,qi.FTYP.byteLength),r}}qi.types=void 0,qi.HDLR_TYPES=void 0,qi.STTS=void 0,qi.STSC=void 0,qi.STCO=void 0,qi.STSZ=void 0,qi.VMHD=void 0,qi.SMHD=void 0,qi.STSD=void 0,qi.FTYP=void 0,qi.DINF=void 0;const Xi=9e4;function Qi(e,t,r=1,i=!1){const s=e*t*r;return i?Math.round(s):s}function Zi(e,t,r=1,i=!1){return Qi(e,t,1/r,i)}function Ji(e,t=!1){return Qi(e,1e3,1/Xi,t)}function es(e,t=1){return Qi(e,Xi,1/t)}const ts=1e4,rs=1024,is=1152;let ss,ns=null,as=null;class os{constructor(e,t,r,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===ns){const e=navigator.userAgent||"",t=e.match(/Chrome\/(\d+)/i);ns=t?parseInt(t[1]):0}if(null===as){const e=navigator.userAgent.match(/Safari\/(\d+)/i);as=e?parseInt(e[1]):0}}destroy(){}resetTimeStamp(e){T.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){T.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){T.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const r=e.reduce((e,r)=>{const i=r.pts-e;return i<-4294967296?(t=!0,ls(e,r.pts)):i>0?e:r.pts},e[0].pts);return t&&T.debug("PTS rollover detected"),r}remux(e,t,r,i,s,n,a,o){let l,d,h,c,u,f,p=s,m=s;const g=e.pid>-1,y=t.pid>-1,v=t.samples.length,_=e.samples.length>0,E=a&&v>0||v>1,b=(!g||_)&&(!y||E)||this.ISGenerated||a;if(b){this.ISGenerated||(h=this.generateIS(e,t,s,n));const r=this.isVideoContiguous;let i,a=-1;if(E&&(a=ds(t.samples),!r&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,a>0){T.warn(`[mp4-remuxer]: Dropped ${a} out of ${v} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,m+=(t.samples[0].pts-e)/t.inputTimeScale,i=m}else-1===a&&(T.warn(`[mp4-remuxer]: No keyframe found out of ${v} video samples`),f=!1);if(this.ISGenerated){if(_&&E){const r=this.getVideoStartPts(t.samples),i=ls(e.samples[0].pts,r)-r,s=i/t.inputTimeScale;p+=Math.max(0,s),m+=Math.max(0,-s)}if(_){if(e.samplerate||(T.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(e,t,s,n)),d=this.remuxAudio(e,p,this.isAudioContiguous,n,y||E||o===_t.AUDIO?m:void 0),E){const i=d?d.endPTS-d.startPTS:0;t.inputTimeScale||(T.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(e,t,s,n)),l=this.remuxVideo(t,m,r,i)}}else E&&(l=this.remuxVideo(t,m,r,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=i)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(u=hs(r,s,this._initPTS,this._initDTS)),i.samples.length&&(c=cs(i,s,this._initPTS))),{audio:d,video:l,initSegment:h,independent:f,text:c,id3:u}}generateIS(e,t,r,i){const s=e.samples,n=t.samples,a=this.typeSupported,o={},l=this._initPTS;let d,h,c,u=!l||i,f="audio/mp4";if(u&&(d=h=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(f="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):qi.initSegment([e]),metadata:{channelCount:e.channelCount}},u&&(c=e.inputTimeScale,l&&c===l.timescale?u=!1:d=h=s[0].pts-Math.round(c*r))}if(t.sps&&t.pps&&n.length&&(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:qi.initSegment([t]),metadata:{width:t.width,height:t.height}},u))if(c=t.inputTimeScale,l&&c===l.timescale)u=!1;else{const e=this.getVideoStartPts(n),t=Math.round(c*r);h=Math.min(h,ls(n[0].dts,e)-t),d=Math.min(d,e-t)}if(Object.keys(o).length)return this.ISGenerated=!0,u?(this._initPTS={baseTime:d,timescale:c},this._initDTS={baseTime:h,timescale:c}):d=c=void 0,{tracks:o,initPTS:d,timescale:c}}remuxVideo(e,t,r,i){const s=e.inputTimeScale,n=e.samples,a=[],o=n.length,l=this._initPTS;let h,c,u=this.nextAvcDts,g=8,y=this.videoSampleDuration,v=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,E=!1;if(!r||null===u){const e=t*s,r=n[0].pts-ls(n[0].dts,n[0].pts);u=e-r}const b=l.baseTime*s/l.timescale;for(let d=0;d0?d-1:d].dts&&(E=!0)}E&&n.sort((function(e,t){const r=e.dts-t.dts,i=e.pts-t.pts;return r||i})),h=n[0].dts,c=n[n.length-1].dts;const S=c-h,L=S?Math.round(S/(o-1)):y||e.inputTimeScale/30;if(r){const e=h-u,t=e>L,r=e<-1;if((t||r)&&(t?T.warn(`AVC: ${Ji(e,!0)} ms (${e}dts) hole between fragments detected, filling it`):T.warn(`AVC: ${Ji(-e,!0)} ms (${e}dts) overlapping between fragments detected`),!r||u>=n[0].pts)){h=u;const t=n[0].pts-e;n[0].dts=h,n[0].pts=t,T.log(`Video: First PTS/DTS adjusted: ${Ji(t,!0)}/${Ji(h,!0)}, delta: ${Ji(e,!0)} ms`)}}h=Math.max(0,h);let A=0,w=0;for(let d=0;d0?e.dts-n[d-1].dts:L;if(r=d>0?e.pts-n[d-1].pts:L,t.stretchShortVideoTrack&&null!==this.nextAudioPts){const r=Math.floor(t.maxBufferHole*s),n=(i?v+i*s:this.nextAudioPts)-e.pts;n>r?(y=n-a,y<0?y=a:D=!0,T.log(`[mp4-remuxer]: It is approximately ${n/90} ms to the next segment; using duration ${y/90} ms for the last video frame.`)):y=a}else y=a}const h=Math.round(e.pts-e.dts);x=Math.min(x,y),P=Math.max(P,y),C=Math.min(C,r),O=Math.max(O,r),a.push(new us(e.key,y,l,h))}if(a.length)if(ns){if(ns<70){const e=a[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(as&&O-C0&&(i&&Math.abs(b-E)<9e3||Math.abs(ls(v[0].pts-S,b)-E)<20*h),v.forEach((function(e){e.pts=ls(e.pts-S,b)})),!r||E<0){if(v=v.filter(e=>e.pts>=0),!v.length)return;E=0===s?0:i&&!y?Math.max(0,b):v[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let r=0,i=E;r=t*h&&l0))return;R+=_;try{L=new Uint8Array(R)}catch(F){return void this.observer.emit(f.ERROR,f.ERROR,{type:p.MUX_ERROR,details:m.REMUX_ALLOC_ERROR,fatal:!1,error:F,bytes:R,reason:"fail allocating audio mdat "+R})}if(!u){const e=new DataView(L.buffer);e.setUint32(0,R),L.set(qi.types.mdat,4)}}L.set(i,_);const n=i.byteLength;_+=n,g.push(new us(!0,l,n,0)),w=s}const I=g.length;if(!I)return;const D=g[g.length-1];this.nextAudioPts=E=w+o*D.duration;const x=u?new Uint8Array(0):qi.moof(e.sequenceNumber++,A/o,d({},e,{samples:g}));e.samples=[];const C=A/n,P=E/n,O="audio",M={data1:x,data2:L,startPTS:C,endPTS:P,startDTS:C,endDTS:P,type:O,hasAudio:!0,hasVideo:!1,nb:I};return this.isAudioContiguous=!0,M}remuxEmptyAudio(e,t,r,i){const s=e.inputTimeScale,n=e.samplerate?e.samplerate:s,a=s/n,o=this.nextAudioPts,l=this._initDTS,d=9e4*l.baseTime/l.timescale,h=(null!==o?o:i.startDTS*s)+d,c=i.endDTS*s+d,u=a*rs,f=Math.ceil((c-h)/u),p=zi.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(T.warn("[mp4-remuxer]: remux empty Audio"),!p)return void T.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const m=[];for(let g=0;g4294967296)e+=r;return e}function ds(e){for(let t=0;te.pts-t.pts);const n=e.samples;return e.samples=[],{samples:n}}class us{constructor(e,t,r,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=r,this.cts=i,this.flags=new fs(e)}}class fs{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}class ps{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,r,i){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(Re(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:r}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const i=this.initData=we(e);t||(t=gs(i.audio,D.AUDIO)),r||(r=gs(i.video,D.VIDEO));const s={};i.audio&&i.video?s.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:i.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?s.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:T.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,r,i,s,n){var a,o;let{initPTS:l,lastEndTime:d}=this;const h={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};u(d)||(d=this.lastEndTime=s||0);const c=t.samples;if(null==c||!c.length)return h;const f={initPTS:void 0,timescale:1};let p=this.initData;if(null!=(a=p)&&a.length||(this.generateInitSegment(c),p=this.initData),null==(o=p)||!o.length)return T.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const m=De(c,p),g=Ie(p,c),y=null===g?s:g;(ms(l,y,s,m)||f.timescale!==l.timescale&&n)&&(f.initPTS=y-s,l&&1===l.timescale&&T.warn("Adjusting initPTS by "+(f.initPTS-l.baseTime)),this.initPTS=l={baseTime:f.initPTS,timescale:1});const v=e?y-l.baseTime/l.timescale:d,_=v+m;Ce(p,c,l.baseTime/l.timescale),m>0?this.lastEndTime=_:(T.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const E=!!p.audio,b=!!p.video;let S="";E&&(S+="audio"),b&&(S+="video");const L={data1:c,startPTS:v,startDTS:v,endPTS:_,endDTS:_,type:S,hasAudio:E,hasVideo:b,nb:1,dropped:0};return h.audio="audio"===L.type?L:void 0,h.video="audio"!==L.type?L:void 0,h.initSegment=f,h.id3=hs(r,s,l,l),i.samples.length&&(h.text=cs(i,s,l)),h}}function ms(e,t,r,i){if(null===e)return!0;const s=Math.max(i,1),n=t-e.baseTime/e.timescale;return Math.abs(n-r)>s}function gs(e,t){const r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r||"hev1"===r?"hvc1.1.6.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===D.VIDEO?"avc1.42e01e":"mp4a.40.5"}try{ss=self.performance.now.bind(self.performance)}catch(Na){T.debug("Unable to use Performance API on this environment"),ss="undefined"!==typeof self&&self.Date.now}const ys=[{demux:Li,remux:ps},{demux:Bi,remux:os},{demux:Ti,remux:os},{demux:Yi,remux:os}];class vs{constructor(e,t,r,i,s){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=i,this.id=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,i){const s=r.transmuxing;s.executeStart=ss();let n=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:o}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:d,trackSwitch:h,accurateTimeOffset:c,timeOffset:u,initSegmentChange:g}=i||a,{audioCodec:y,videoCodec:v,defaultInitPts:_,duration:E,initSegmentData:b}=o,S=_s(n,t);if(S&&"AES-128"===S.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(n,S.key.buffer,S.iv.buffer).then(e=>{const t=this.push(e,null,r);return this.decryptionPromise=null,t}),this.decryptionPromise;{let t=e.softwareDecrypt(n,S.key.buffer,S.iv.buffer);const i=r.part>-1;if(i&&(t=e.flush()),!t)return s.executeEnd=ss(),Es(r);n=new Uint8Array(t)}}const L=this.needsProbing(d,h);if(L){const e=this.configureTransmuxer(n);if(e)return T.warn("[transmuxer] "+e.message),this.observer.emit(f.ERROR,f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),s.executeEnd=ss(),Es(r)}(d||h||g||L)&&this.resetInitSegment(b,y,v,E,t),(d||g||L)&&this.resetInitialTimestamp(_),l||this.resetContiguity();const A=this.transmux(n,S,u,c,r),w=this.currentTransmuxState;return w.contiguous=!0,w.discontinuity=!1,w.trackSwitch=!1,s.executeEnd=ss(),A}flush(e){const t=e.transmuxing;t.executeStart=ss();const{decrypter:r,currentTransmuxState:i,decryptionPromise:s}=this;if(s)return s.then(()=>this.flush(e));const n=[],{timeOffset:a}=i;if(r){const t=r.flush();t&&n.push(this.push(t,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l)return t.executeEnd=ss(),[Es(e)];const d=o.flush(a);return bs(d)?d.then(t=>(this.flushRemux(n,t,e),n)):(this.flushRemux(n,d,e),n)}flushRemux(e,t,r){const{audioTrack:i,videoTrack:s,id3Track:n,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;T.log(`[transmuxer.ts]: Flushed fragment ${r.sn}${r.part>-1?" p: "+r.part:""} of level ${r.level}`);const d=this.remuxer.remux(i,s,n,a,l,o,!0,this.id);e.push({remuxResult:d,chunkMeta:r}),r.transmuxing.executeEnd=ss()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,i,s){const{demuxer:n,remuxer:a}=this;n&&a&&(n.resetInitSegment(e,t,r,i),a.resetInitSegment(e,t,r,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,i,s){let n;return n=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,i,s):this.transmuxUnencrypted(e,r,i,s),n}transmuxUnencrypted(e,t,r,i){const{audioTrack:s,videoTrack:n,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive),l=this.remuxer.remux(s,n,a,o,t,r,!1,this.id);return{remuxResult:l,chunkMeta:i}}transmuxSampleAes(e,t,r,i,s){return this.demuxer.demuxSampleAes(e,t,r).then(e=>{const t=this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,r,i,!1,this.id);return{remuxResult:t,chunkMeta:s}})}configureTransmuxer(e){const{config:t,observer:r,typeSupported:i,vendor:s}=this;let n;for(let h=0,c=ys.length;h0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(r=t),r}const Es=e=>({remuxResult:{},chunkMeta:e});function bs(e){return"then"in e&&e.then instanceof Function}class Ts{constructor(e,t,r,i,s){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=i,this.defaultInitPts=s||null}}class Ss{constructor(e,t,r,i,s,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=i,this.timeOffset=s,this.initSegmentChange=n}}var Ls={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function i(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function n(e,t,i,n,a){if("function"!==typeof i)throw new TypeError("The listener must be a function");var o=new s(i,n||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,i,s=[];if(0===this._eventsCount)return s;for(i in e=this._events)t.call(e,i)&&s.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,n=i.length,a=new Array(n);s!1};class ks{constructor(e,t,r,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=r,this.onFlush=i;const n=(e,t)=>{t=t||{},t.frag=this.frag,t.id=this.id,e===f.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new ws,this.observer.on(f.FRAG_DECRYPTED,n),this.observer.on(f.ERROR,n);const a={mp4:Rs.isTypeSupported("video/mp4"),mpeg:Rs.isTypeSupported("audio/mpeg"),mp3:Rs.isTypeSupported('audio/mp4; codecs="mp3"')},o=navigator.vendor;if(this.useWorker&&"undefined"!==typeof Worker){const e=s.workerPath||si();if(e){try{s.workerPath?(T.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=ai(s.workerPath)):(T.log(`injecting Web Worker for "${t}"`),this.workerContext=ni()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const r=new Error(`${e.message} (${e.filename}:${e.lineno})`);s.enableWorker=!1,T.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:r})},e.postMessage({cmd:"init",typeSupported:a,vendor:o,id:t,config:JSON.stringify(s)})}catch(Na){T.warn(`Error setting up "${t}" Web Worker, fallback to inline`,Na),this.resetWorker(),this.error=null,this.transmuxer=new vs(this.observer,a,s,o,t)}return}}this.transmuxer=new vs(this.observer,a,s,o,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,r,i,s,n,a,o,l,d){var h,c;l.transmuxing.start=self.performance.now();const{transmuxer:u}=this,f=n?n.start:s.start,p=s.decryptdata,m=this.frag,g=!(m&&s.cc===m.cc),y=!(m&&l.level===m.level),v=m?l.sn-m.sn:-1,_=this.part?l.part-this.part.index:-1,E=0===v&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),b=!y&&(1===v||0===v&&(1===_||E&&_<=0)),S=self.performance.now();(y||v||0===s.stats.parsing.start)&&(s.stats.parsing.start=S),!n||!_&&b||(n.stats.parsing.start=S);const L=!(m&&(null==(h=s.initSegment)?void 0:h.url)===(null==(c=m.initSegment)?void 0:c.url)),A=new Ss(g,b,o,y,f,L);if(!b||g||L){T.log(`[transmuxer-interface, ${s.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${g}\n trackSwitch: ${y}\n contiguous: ${b}\n accurateTimeOffset: ${o}\n timeOffset: ${f}\n initSegmentChange: ${L}`);const e=new Ts(r,i,t,a,d);this.configureTransmuxer(e)}if(this.frag=s,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:p,chunkMeta:l,state:A},e instanceof ArrayBuffer?[e]:[]);else if(u){const t=u.push(e,p,l,A);bs(t)?(u.async=!0,t.then(e=>{this.handleTransmuxComplete(e)}).catch(e=>{this.transmuxerError(e,l,"transmuxer-interface push error")})):(u.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let r=t.flush(e);const i=bs(r);i||t.async?(bs(r)||(r=Promise.resolve(r)),r.then(t=>{this.handleFlushResult(t,e)}).catch(t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")})):this.handleFlushResult(r,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(e=>{this.handleTransmuxComplete(e)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data,r=this.hls;switch(t.event){case"init":{var i;const e=null==(i=this.workerContext)?void 0:i.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":T[t.data.logType]&&T[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data);break}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Is=250,Ds=2,xs=.1,Cs=.05;class Ps{constructor(e,t,r,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=r,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:r,media:i,stalled:s}=this;if(null===i)return;const{currentTime:n,seeking:a}=i,o=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,n!==e){if(this.moved=!0,null!==s){if(this.stallReported){const e=self.performance.now()-s;T.warn(`playback not stuck anymore @${n}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||o)return void(this.stalled=null);if(i.paused&&!a||i.ended||0===i.playbackRate||!Or.getBuffered(i).length)return;const d=Or.bufferInfo(i,n,0),h=d.len>0,c=d.nextStart||0;if(!h&&!c)return;if(a){const e=d.len>Ds,r=!c||t&&t.start<=n||c-n>Ds&&!this.fragmentTracker.getPartialFragment(n);if(e||r)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var u;const e=Math.max(c,d.start||0)-n,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,r=null==t||null==(u=t.details)?void 0:u.live,i=r?2*t.details.targetduration:Ds,s=this.fragmentTracker.getPartialFragment(n);if(e>0&&(e<=i||s))return void this._trySkipBufferHole(s)}const f=self.performance.now();if(null===s)return void(this.stalled=f);const p=f-s;if(!a&&p>=Is&&(this._reportStall(d),!this.media))return;const m=Or.bufferInfo(i,n,r.maxBufferHole);this._tryFixBufferStall(m,p)}_tryFixBufferStall(e,t){const{config:r,fragmentTracker:i,media:s}=this;if(null===s)return;const n=s.currentTime,a=i.getPartialFragment(n);if(a){const e=this._trySkipBufferHole(a);if(e||!this.media)return}(e.len>r.maxBufferHole||e.nextStart&&e.nextStart-n1e3*r.highBufferWatchdogPeriod&&(T.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:r,stallReported:i}=this;if(!i&&r){this.stallReported=!0;const i=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${JSON.stringify(e)})`);T.warn(i.message),t.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_STALLED_ERROR,fatal:!1,error:i,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:r,media:i}=this;if(null===i)return 0;const s=i.currentTime,n=Or.bufferInfo(i,s,0),a=s0&&n.len<1&&i.readyState<3,d=a-s;if(d>0&&(o||l)){if(d>t.maxBufferHole){const{fragmentTracker:t}=this;let r=!1;if(0===s){const e=t.getAppendedFrag(0,_t.MAIN);e&&a1?(e=0,this.bitrateTest=!0):e=r.nextAutoLevel),this.level=r.nextLoadLevel=e,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=Jr.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Jr.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Jr.WAITING_LEVEL:{var e;const{levels:t,level:r}=this,i=null==t||null==(e=t[r])?void 0:e.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=Jr.IDLE;break}if(this.hls.nextLoadLevel!==this.level){this.state=Jr.IDLE;break}break}case Jr.FRAG_LOADING_WAITING_RETRY:{var t;const e=self.performance.now(),r=this.retryDate;(!r||e>=r||null!=(t=this.media)&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=Jr.IDLE)}break}this.state===Jr.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:r,media:i}=this,{config:s,nextLoadLevel:n}=e;if(null===t||!i&&(this.startFragRequested||!s.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(null==r||!r[n])return;const a=r[n],o=this.getMainFwdBufferInfo();if(null===o)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(f.BUFFER_EOS,e),void(this.state=Jr.ENDED)}e.loadLevel!==n&&-1===e.manualLevel&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const d=a.details;if(!d||this.state===Jr.WAITING_LEVEL||d.live&&this.levelLastLoaded!==n)return this.level=n,void(this.state=Jr.WAITING_LEVEL);const h=o.len,c=this.getMaxBufferLength(a.maxBitrate);if(h>=c)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const u=this.backtrackFragment?this.backtrackFragment.start:o.end;let p=this.getNextFragment(u,d);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==Tr.OK){var m;const e=(null!=(m=this.backtrackFragment)?m:p).sn,t=e-d.startSN,r=d.fragments[t-1];r&&p.cc===r.cc&&(p=r,this.fragmentTracker.removeFragment(r))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,u)){const e=p.gap;if(!e){const e=this.audioOnly&&!this.altAudio?D.AUDIO:D.VIDEO,t=(e===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,_t.MAIN)}p=this.getNextFragmentLoopLoading(p,d,o,_t.MAIN,c)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,a,u))}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===Tr.NOT_LOADED||i===Tr.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,r)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,_t.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let r;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const s=this.getLevelDetails();if(null!=s&&s.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*s.targetduration)return}if(!t.paused&&e){const t=this.hls.nextLoadLevel,i=e[t],s=this.fragLastKbps;r=s&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*s)+1:0}else r=0;const n=this.getBufferedFrag(t.currentTime+r);if(n){const e=this.followingBufferedFrag(n);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,r=e.duration,i=Math.max(n.end,t+Math.min(Math.max(r-this.config.maxFragLookUpTolerance,.5*r),.75*r));this.flushMainBuffer(i,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Jr.KEY_LOADING:case Jr.FRAG_LOADING:case Jr.FRAG_LOADING_WAITING_RETRY:case Jr.PARSING:case Jr.PARSED:this.state=Jr.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new Ps(this.config,r,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;u(t)&&this.log("Media seeked to "+t.toFixed(3));const r=this.getMainFwdBufferInfo();null!==r&&0!==r.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${r?r.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(f.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1}onManifestParsed(e,t){let r,i=!1,s=!1;t.levels.forEach(e=>{r=e.audioCodec,r&&(-1!==r.indexOf("mp4a.40.2")&&(i=!0),-1!==r.indexOf("mp4a.40.5")&&(s=!0))}),this.audioCodecSwitch=i&&s&&!ii(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:r}=this;if(!r||this.state!==Jr.IDLE)return;const i=r[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(i.details))&&(this.state=Jr.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:i}=this,s=t.level,n=t.details,a=n.totalduration;if(!i)return void this.warn("Levels were reset while loading level "+s);this.log(`Level ${s} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${a}`);const o=i[s],l=this.fragCurrent;!l||this.state!==Jr.FRAG_LOADING&&this.state!==Jr.FRAG_LOADING_WAITING_RETRY||l.level===t.level&&l.urlId===o.urlId||!l.loader||this.abortCurrentFrag();let d=0;if(n.live||null!=(r=o.details)&&r.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;d=this.alignPlaylists(n,o.details)}if(o.details=n,this.levelLastLoaded=s,this.hls.trigger(f.LEVEL_UPDATED,{details:n,level:s}),this.state===Jr.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=Jr.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,d),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:r,part:i,payload:s}=e,{levels:n}=this;if(!n)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const a=n[r.level],o=a.details;if(!o)return this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),void this.fragmentTracker.removeFragment(r);const l=a.videoCodec,d=o.PTSKnown||!o.live,h=null==(t=r.initSegment)?void 0:t.data,c=this._getAudioCodec(a),u=this.transmuxer=this.transmuxer||new ks(this.hls,_t.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,p=-1!==f,m=new Mr(r.level,r.sn,r.stats.chunkCount,s.byteLength,f,p),g=this.initPTS[r.cc];u.push(s,h,c,l,r,i,o.totalduration,d,m,g)}onAudioTrackSwitching(e,t){const r=this.altAudio,i=!!t.url;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;r&&(e.trigger(f.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(f.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=t.id,i=!!this.hls.audioTracks[r].url;if(i){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const r=t.tracks;let i,s,n=!1;for(const a in r){const e=r[a];if("main"===e.id){if(s=a,i=e,"video"===a){const e=r[a];e&&(this.videoBuffer=e.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r&&r.type!==_t.MAIN)return;if(this.fragContextChanged(r))return this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Jr.PARSED&&(this.state=Jr.IDLE));const s=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}onError(e,t){var r;if(t.fatal)this.state=Jr.ERROR;else switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_t.MAIN,t);break;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Jr.WAITING_LEVEL||(null==(r=t.context)?void 0:r.type)!==vt.LEVEL||(this.state=Jr.IDLE);break;case m.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!Or.getBuffered(e).length){const e=this.state!==Jr.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Jr.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==D.AUDIO||this.audioOnly&&!this.altAudio){const e=(t===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,_t.MAIN)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let r=this.startPosition;if(r>=0&&t0&&(n{const{hls:i}=this;if(!r||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Jr.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(f.FRAG_LOADED,r),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const r="main",{hls:i}=this,{remuxResult:s,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a)return void this.resetWhenMissingContext(n);const{frag:o,part:l,level:d}=a,{video:h,text:c,id3:p,initSegment:m}=s,{details:g}=d,y=this.altAudio?void 0:s.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Jr.PARSING,m){if(null!=m&&m.tracks){const e=o.initSegment||o;this._bufferInitSegment(d,m.tracks,e,n),i.trigger(f.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:m.tracks})}const e=m.initPTS,t=m.timescale;u(e)&&(this.initPTS[o.cc]={baseTime:e,timescale:t},i.trigger(f.INIT_PTS_FOUND,{frag:o,id:r,initPTS:e,timescale:t}))}if(h&&g&&"initSegment"!==o.sn){const e=g.fragments[o.sn-1-g.startSN],t=o.sn===g.startSN,r=!e||o.cc>e.cc;if(!1!==s.independent){const{startPTS:e,endPTS:i,startDTS:s,endDTS:a}=h;if(l)l.elementaryStreams[h.type]={startPTS:e,endPTS:i,startDTS:s,endDTS:a};else if(h.firstKeyFrame&&h.independent&&1===n.id&&!r&&(this.couldBacktrack=!0),h.dropped&&h.independent){const s=this.getMainFwdBufferInfo(),n=(s?s.end:this.getLoadPosition())+this.config.maxBufferHole,l=h.firstKeyFramePTS?h.firstKeyFramePTS:e;if(!t&&n{const s=t[e],n=s.initSegment;null!=n&&n.byteLength&&this.hls.trigger(f.BUFFER_APPENDING,{type:e,data:n,frag:r,part:null,chunkMeta:i,parent:r.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,_t.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Jr.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const r=e.currentTime;if(Or.isBuffered(e,r)?t=this.getAppendedFrag(r):Or.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,r=t.level;e&&t.sn===e.sn&&e.level===r&&t.urlId===e.urlId||(this.fragPlaying=t,this.hls.trigger(f.FRAG_CHANGED,{frag:t}),e&&e.level===r||this.hls.trigger(f.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,r=this.currentFrag;if(r&&u(t)&&u(r.programDateTime)){const e=r.programDateTime+1e3*(t-r.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Fs{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class Ns{constructor(e,t,r,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Fs(e),this.fast_=new Fs(t),this.defaultTTFB_=i,this.ttfb_=new Fs(e)}update(e,t){const{slow_:r,fast_:i,ttfb_:s}=this;r.halfLife!==e&&(this.slow_=new Fs(e,r.getEstimate(),r.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Fs(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new Fs(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,i=e/1e3,s=r/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class Us{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new Ns(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var r;const i=t.frag;this.ignoreFragment(i)||(this.fragCurrent=i,this.partCurrent=null!=(r=t.part)?r:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,r,i){const s=e+r/t,n=i?this.lastLevelLoadSec:0;return s+n}onLevelLoaded(e,t){const r=this.hls.config,{total:i,bwEstimate:s}=t.stats;u(i)&&u(s)&&(this.lastLevelLoadSec=8*i/s),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:r}=this,{autoLevelEnabled:i,media:s}=r;if(!e||!s)return;const n=performance.now(),a=t?t.stats:e.stats,o=t?t.duration:e.duration,l=n-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!i||s.paused||!s.playbackRate||!s.readyState)return;const d=r.mainForwardBufferInfo;if(null===d)return;const h=this.bwEstimator.getEstimateTTFB(),c=Math.abs(s.playbackRate);if(l<=Math.max(h,o/(2*c)*1e3))return;const p=d.len/c;if(p>=2*o/c)return;const m=a.loading.first?a.loading.first-a.loading.start:-1,g=a.loaded&&m>-1,y=this.bwEstimator.getEstimate(),{levels:v,minAutoLevel:_}=r,E=v[e.level],b=a.total||Math.max(a.loaded,Math.round(o*E.maxBitrate/8));let S=l-m;S<1&&g&&(S=Math.min(l,8*a.loaded/y));const L=g?1e3*a.loaded/S:0,A=L?(b-a.loaded)/L:8*b/y+h/1e3;if(A<=p)return;const w=L?8*L:y;let R,k=Number.POSITIVE_INFINITY;for(R=e.level-1;R>_;R--){const e=v[R].maxBitrate;if(k=this.getTimeToLoadFrag(h/1e3,w,o*e,!v[R].details),k=A||k>10*o||(r.nextLoadLevel=R,g?this.bwEstimator.sample(l-Math.min(h,m),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),T.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${p.toFixed(3)} s\n Estimated load time for current fragment: ${A.toFixed(3)} s\n Estimated load time for down switch fragment: ${k.toFixed(3)} s\n TTFB estimate: ${m}\n Current BW estimate: ${u(y)?(y/1024).toFixed(3):"Unknown"} Kb/s\n New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s\n Aborting and switching to level ${R}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),r.trigger(f.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:r}){const i=r?r.stats:t.stats;if(t.type===_t.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const e=r?r.duration:t.duration,s=this.hls.levels[t.level],n=(s.loaded?s.loaded.bytes:0)+i.loaded,a=(s.loaded?s.loaded.duration:0)+e;s.loaded={bytes:n,duration:a},s.realBitrate=Math.round(8*n/a)}if(t.bitrateTest){const e={stats:i,frag:t,part:r,id:t.type};this.onFragBuffered(f.FRAG_BUFFERED,e),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:r,part:i}=t,s=null!=i&&i.stats.loaded?i.stats:r.stats;if(s.aborted)return;if(this.ignoreFragment(r))return;const n=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,s.loaded),s.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==_t.MAIN||"initSegment"===e.sn}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;let r=this.getNextABRAutoLevel();if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return-1!==e&&(r=Math.min(e,r)),r}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this,{maxAutoLevel:i,config:s,minAutoLevel:n,media:a}=r,o=t?t.duration:e?e.duration:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():s.abrEwmaDefaultEstimate,h=r.mainForwardBufferInfo,c=(h?h.len:0)/l;let u=this.findBestLevel(d,n,i,c,s.abrBandWidthFactor,s.abrBandWidthUpFactor);if(u>=0)return u;T.trace(`[abr] ${c?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let f=o?Math.min(o,s.maxStarvationDelay):s.maxStarvationDelay,p=s.abrBandWidthFactor,m=s.abrBandWidthUpFactor;if(!c){const e=this.bitrateTestDelay;if(e){const t=o?Math.min(o,s.maxLoadingDelay):s.maxLoadingDelay;f=t-e,T.trace(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*f)} ms`),p=m=1}}return u=this.findBestLevel(d,n,i,c+f,p,m),Math.max(u,0)}findBestLevel(e,t,r,i,s,n){var a;const{fragCurrent:o,partCurrent:l,lastLoadedFragLevel:d}=this,{levels:h}=this.hls,c=h[d],f=!(null==c||null==(a=c.details)||!a.live),p=null==c?void 0:c.codecSet,m=l?l.duration:o?o.duration:0,g=this.bwEstimator.getEstimateTTFB()/1e3;let y=t,v=-1;for(let _=r;_>=t;_--){const t=h[_];if(!t||p&&t.codecSet!==p){t&&(y=Math.min(_,y),v=Math.max(_,v));continue}-1!==v&&T.trace(`[abr] Skipped level(s) ${y}-${v} with CODECS:"${h[v].attrs.CODECS}"; not compatible with "${c.attrs.CODECS}"`);const r=t.details,a=(l?null==r?void 0:r.partTarget:null==r?void 0:r.averagetargetduration)||m;let o;o=_<=d?s*e:n*e;const E=h[_].maxBitrate,b=this.getTimeToLoadFrag(g,o,E*a,void 0===r);if(T.trace(`[abr] level:${_} adjustedbw-bitrate:${Math.round(o-E)} avgDuration:${a.toFixed(1)} maxFetchDuration:${i.toFixed(1)} fetchDuration:${b.toFixed(1)}`),o>E&&(0===b||!u(b)||f&&!this.bitrateTestDelay||b0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=Jr.IDLE):(this.loadedmetadata=!1,this.state=Jr.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Jr.IDLE:this.doTickIdle();break;case Jr.WAITING_TRACK:{var e;const{levels:t,trackId:r}=this,i=null==t||null==(e=t[r])?void 0:e.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=Jr.WAITING_INIT_PTS}break}case Jr.FRAG_LOADING_WAITING_RETRY:{var t;const e=performance.now(),r=this.retryDate;(!r||e>=r||null!=(t=this.media)&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Jr.IDLE);break}case Jr.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:i,complete:s}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Jr.FRAG_LOADING;const e=i.flush(),n={frag:t,part:r,payload:e,networkDetails:null};this._handleFragmentLoadProgress(n),s&&super._handleFragmentLoadComplete(n)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),r=Or.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole),i=dr(r.end,this.config.maxFragLookUpTolerance,t);i<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${r.end} is needed`),this.clearWaitingFragment())}}else this.state=Jr.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Jr.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:r,trackId:i}=this,s=e.config;if(null==t||!t[i])return;if(!r&&(this.startFragRequested||!s.startFragPrefetch))return;const n=t[i],a=n.details;if(!a||a.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(a))return void(this.state=Jr.WAITING_TRACK);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,D.AUDIO,_t.AUDIO));const l=this.getFwdBufferInfo(o,_t.AUDIO);if(null===l)return;const{bufferedTrack:d,switchingTrack:h}=this;if(!h&&this._streamEnded(l,a))return e.trigger(f.BUFFER_EOS,{type:"audio"}),void(this.state=Jr.ENDED);const c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,_t.MAIN),u=l.len,p=this.getMaxBufferLength(null==c?void 0:c.len);if(u>=p&&!h)return;const m=a.fragments,g=m[0].start;let y=l.end;if(h&&r){const e=this.getLoadPosition();d&&h.attrs!==d.attrs&&(y=e),a.PTSKnown&&eg||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=g+.05)}let v=this.getNextFragment(y,a),_=!1;if(v&&this.isLoopLoading(v,y)&&(_=!!v.gap,v=this.getNextFragmentLoopLoading(v,a,l,_t.MAIN,p)),!v)return void(this.bufferFlushed=!0);const E=c&&v.start>c.end+a.targetduration;if(E||(null==c||!c.len)&&l.len){const e=this.getAppendedFrag(v.start,_t.MAIN);if(null===e)return;if(_||(_=!!e.gap||!!E&&0===c.len),E&&!_||_&&l.nextStart&&l.nextStartnew Gt(e))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),r?this.setInterval(Gs):this.resetTransmuxer(),r?(this.switchingTrack=t,this.state=Jr.IDLE):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Jr.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(f.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var r;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:i}=this,{details:s,id:n}=t;if(!i)return void this.warn("Audio tracks were reset while loading level "+n);this.log(`Track ${n} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const a=i[n];let o=0;if(s.live||null!=(r=a.details)&&r.live){this.checkLiveUpdate(s);const e=this.mainDetails;if(s.deltaUpdateFailed||!e)return;!a.details&&s.hasProgramDateTime&&e.hasProgramDateTime?(Hr(s,e),o=s.fragments[0].start):o=this.alignPlaylists(s,a.details)}a.details=s,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(a.details,o),this.state!==Jr.WAITING_TRACK||this.waitForCdnTuneIn(s)||(this.state=Jr.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:r,part:i,payload:s}=e,{config:n,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const d=l.details;if(!d)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(r.start);const h=n.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let c=this.transmuxer;c||(c=this.transmuxer=new ks(this.hls,_t.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const u=this.initPTS[r.cc],f=null==(t=r.initSegment)?void 0:t.data;if(void 0!==u){const e=!1,t=i?i.index:-1,n=-1!==t,a=new Mr(r.level,r.sn,r.stats.chunkCount,s.byteLength,t,n);c.push(s,f,h,"",r,i,d.totalduration,e,a,u)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${d.startSN} ,${d.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:r,part:i,cache:new Bs,complete:!1};e.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=Jr.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r.type===_t.AUDIO)if(this.fragContextChanged(r))this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==r.sn){this.fragPrevious=r;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(f.AUDIO_TRACK_SWITCHED,o({},e)))}this.fragBufferedComplete(r,i)}else if(!this.loadedmetadata&&r.type===_t.MAIN){const e=this.videoBuffer||this.media;if(e){const t=Or.getBuffered(e);t.length&&(this.loadedmetadata=!0)}}}onError(e,t){var r;if(t.fatal)this.state=Jr.ERROR;else switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_t.AUDIO,t);break;case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Jr.WAITING_TRACK||(null==(r=t.context)?void 0:r.type)!==vt.AUDIO_TRACK||(this.state=Jr.IDLE);break;case m.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushed(e,{type:t}){t===D.AUDIO&&(this.bufferFlushed=!0,this.state===Jr.ENDED&&(this.state=Jr.IDLE))}_handleTransmuxComplete(e){var t;const r="audio",{hls:i}=this,{remuxResult:s,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a)return void this.resetWhenMissingContext(n);const{frag:o,part:l,level:h}=a,{details:c}=h,{audio:u,text:p,id3:m,initSegment:g}=s;if(!this.fragContextChanged(o)&&c){if(this.state=Jr.PARSING,this.switchingTrack&&u&&this.completeAudioSwitch(this.switchingTrack),null!=g&&g.tracks){const e=o.initSegment||o;this._bufferInitSegment(g.tracks,e,n),i.trigger(f.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:g.tracks})}if(u){const{startPTS:e,endPTS:t,startDTS:r,endDTS:i}=u;l&&(l.elementaryStreams[D.AUDIO]={startPTS:e,endPTS:t,startDTS:r,endDTS:i}),o.setElementaryStreamInfo(D.AUDIO,e,t,r,i),this.bufferFragmentData(u,o,l,n)}if(null!=m&&null!=(t=m.samples)&&t.length){const e=d({id:r,frag:o,details:c},m);i.trigger(f.FRAG_PARSING_METADATA,e)}if(p){const e=d({id:r,frag:o,details:c},p);i.trigger(f.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,r){if(this.state!==Jr.PARSING)return;e.video&&delete e.video;const i=e.audio;if(!i)return;i.levelCodec=i.codec,i.id="audio",this.log(`Init audio buffer, container:${i.container}, codecs[parsed]=[${i.codec}]`),this.hls.trigger(f.BUFFER_CODECS,e);const s=i.initSegment;if(null!=s&&s.byteLength){const e={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:s};this.hls.trigger(f.BUFFER_APPENDING,e)}this.tick()}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);var s;(this.fragCurrent=e,this.switchingTrack||i===Tr.NOT_LOADED||i===Tr.PARTIAL)?"initSegment"===e.sn?this._loadInitSegment(e,t):null!=(s=t.details)&&s.live&&!this.initPTS[e.cc]?(this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=Jr.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(e,t,r)):this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:r,bufferedTrack:i}=this,s=null==i?void 0:i.attrs,n=e.attrs;r&&s&&(s.CHANNELS!==n.CHANNELS||s.NAME!==n.NAME||s.LANGUAGE!==n.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(f.AUDIO_TRACK_SWITCHED,o({},e))}}class Ks extends yr{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(f.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:r,groupId:i,details:s}=t,n=this.tracksInGroup[r];if(!n||n.groupId!==i)return void this.warn(`Track with id:${r} and group:${i} not found in active group ${n.groupId}`);const a=n.details;n.details=t.details,this.log(`audio-track ${r} "${n.name}" lang:${n.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.audioGroupIds)return;const r=t.audioGroupIds[t.urlId];if(this.groupId!==r){this.groupId=r||null;const e=this.tracks.filter(e=>!r||e.groupId===r);this.selectDefaultTrack&&!e.some(e=>e.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=e;const t={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group:${r}`),this.hls.trigger(f.AUDIO_TRACKS_UPDATED,t),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&t.context.type===vt.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn("Invalid id passed to audio-track controller");this.clearTimer();const r=this.currentTrack;t[this.trackId];const i=t[e],{groupId:s,name:n}=i;if(this.log(`Switching to audio-track ${e} "${n}" lang:${i.lang} group:${s}`),this.trackId=e,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger(f.AUDIO_TRACK_SWITCHING,o({},i)),i.details&&!i.details.live)return;const a=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{const t=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}findTrackId(e){const t=this.tracksInGroup;for(let r=0;re[r]!==t[r])}const Ys=500;class zs extends ei{constructor(e,t,r){super(e,t,r,"[subtitle-stream-controller]",_t.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.ERROR,this.onError,this),e.on(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(f.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.ERROR,this.onError,this),e.off(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(f.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Jr.IDLE,this.setInterval(Ys),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:r,success:i}=t;if(this.fragPrevious=r,this.state=Jr.IDLE,!i)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let n;const a=r.start;for(let l=0;l=s[l].start&&a<=s[l].end){n=s[l];break}const o=r.start+r.duration;n?n.end=o:(n={start:a,end:o},s.push(n)),this.fragmentTracker.fragBuffered(r)}onBufferFlushing(e,t){const{startOffset:r,endOffset:i}=t;if(0===r&&i!==Number.POSITIVE_INFINITY){const e=i-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach(t=>{for(let r=0;rnew Gt(e)):(this.tracksBuffered=[],this.levels=t.map(e=>{const t=new Gt(e);return this.tracksBuffered[t.id]=[],t}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,_t.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(Ys)}onSubtitleTrackLoaded(e,t){var r;const{details:i,id:s}=t,{currentTrackId:n,levels:a}=this;if(!a.length)return;const o=a[n];if(s>=a.length||s!==n||!o)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(i.live||null!=(r=o.details)&&r.live){const e=this.mainDetails;if(i.deltaUpdateFailed||!e)return;const t=e.fragments[0];o.details?(l=this.alignPlaylists(i,o.details),0===l&&t&&(l=t.start,qt(i,l))):i.hasProgramDateTime&&e.hasProgramDateTime?(Hr(i,e),l=i.fragments[0].start):t&&(l=t.start,qt(i,l))}if(o.details=i,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(o.details,l),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===Jr.IDLE){const e=lr(null,i.fragments,this.media.currentTime,0);e||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){const e=performance.now();this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).catch(e=>{throw s.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e}).then(r=>{const i=performance.now();s.trigger(f.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:e,tdecrypt:i}})}).catch(e=>{this.warn(`${e.name}: ${e.message}`),this.state=Jr.IDLE})}}doTick(){if(this.media){if(this.state===Jr.IDLE){const{currentTrackId:e,levels:t}=this,r=t[e];if(!t.length||!r||!r.details)return;const{config:i}=this,s=this.getLoadPosition(),n=Or.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,i.maxBufferHole),{end:a,len:o}=n,l=this.getFwdBufferInfo(this.media,_t.MAIN),d=r.details,h=this.getMaxBufferLength(null==l?void 0:l.len)+d.levelTargetDuration;if(o>h)return;const c=d.fragments,u=c.length,f=d.edge;let p=null;const m=this.fragPrevious;if(af-e?0:e;p=lr(m,c,Math.max(c[0].start,a),t),!p&&m&&m.start{if(r>>>=0,r>i-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${i})`);return e[r][t]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}class qs extends yr{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(f.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);const e=Xs(this.media.textTracks);e.forEach(e=>{At(e)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:r,details:i}=t,{trackId:s}=this,n=this.tracksInGroup[s];if(!n)return void this.warn("Invalid subtitle track id "+r);const a=n.details;n.details=t.details,this.log(`subtitle track ${r} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.textGroupIds)return;const r=t.textGroupIds[t.urlId],i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==r){const e=this.tracks.filter(e=>!r||e.groupId===r);this.tracksInGroup=e;const t=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r||null;const s={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${r}" group-id`),this.hls.trigger(f.SUBTITLE_TRACKS_UPDATED,s),-1!==t&&this.setSubtitleTrack(t,i)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId,i)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;re.groupId===this.groupId);if(-1===e)[].slice.call(i).forEach(e=>{e.mode="disabled"});else{const e=s[r];e&&(e.mode="disabled")}const n=s[e];n&&(n.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var r;const i=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(-1===e||null!=(r=i[e])&&r.details)||e<-1||e>=i.length)return;this.clearTimer();const s=i[e];if(this.log("Switching to subtitle-track "+e+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:"")),this.trackId=e,s){const{id:e,groupId:r="",name:i,type:n,url:a}=s;this.hls.trigger(f.SUBTITLE_TRACK_SWITCH,{id:e,groupId:r,name:i,type:n,url:a});const o=this.switchParams(s.url,null==t?void 0:t.details);this.loadPlaylist(o)}else this.hls.trigger(f.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=Xs(this.media.textTracks);for(let r=0;r{t=e}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),r}executeNext(e){const{buffers:t,queues:r}=this,i=t[e],s=r[e];if(s.length){const t=s[0];try{t.execute()}catch(n){T.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),t.onError(n),null!=i&&i.updating||(s.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Zs=Je(),Js=/([ha]vc.)(?:\.[^.,]+)+/;class en{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;T.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(f.MEDIA_ATTACHED,{media:e})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{T.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{T.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:t}=this;e&&e.src!==t&&T.error(`Media element src was set while attaching MediaSource (${t} > ${e.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.BUFFER_RESET,this.onBufferReset,this),e.on(f.BUFFER_APPENDING,this.onBufferAppending,this),e.on(f.BUFFER_CODECS,this.onBufferCodecs,this),e.on(f.BUFFER_EOS,this.onBufferEos,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(f.FRAG_PARSED,this.onFragParsed,this),e.on(f.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.BUFFER_RESET,this.onBufferReset,this),e.off(f.BUFFER_APPENDING,this.onBufferAppending,this),e.off(f.BUFFER_CODECS,this.onBufferCodecs,this),e.off(f.BUFFER_EOS,this.onBufferEos,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(f.FRAG_PARSED,this.onFragParsed,this),e.off(f.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Qs(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,T.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")}onMediaAttaching(e,t){const r=this.media=t.media;if(r&&Zs){const e=this.mediaSource=new Zs;e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(e),this._objectUrl=r.src,r.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:r}=this;if(t){if(T.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(Na){T.warn(`[buffer-controller]: onMediaDetaching: ${Na.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):T.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(f.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(Na){T.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,Na)}}),this._initSourceBuffer()}onBufferCodecs(e,t){const r=this.getSourceBufferTypes().length;Object.keys(t).forEach(e=>{if(r){const r=this.tracks[e];if(r&&"function"===typeof r.buffer.changeType){const{id:i,codec:s,levelCodec:n,container:a,metadata:o}=t[e],l=(r.levelCodec||r.codec).replace(Js,"$1"),d=(n||s).replace(Js,"$1");if(l!==d){const t=`${a};codecs=${n||s}`;this.appendChangeType(e,t),T.log(`[buffer-controller]: switching codec ${l} to ${d}`),this.tracks[e]={buffer:r.buffer,codec:s,container:a,levelCodec:n,metadata:o,id:i}}}}else this.pendingTracks[e]=t[e]}),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:r}=this,i={execute:()=>{const i=this.sourceBuffer[e];i&&(T.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),i.changeType(t)),r.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{T.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,t)}};r.append(i,e)}onBufferAppending(e,t){const{hls:r,operationQueue:i,tracks:s}=this,{data:n,type:a,frag:o,part:l,chunkMeta:d}=t,h=d.buffering[a],c=self.performance.now();h.start=c;const u=o.stats.buffering,g=l?l.stats.buffering:null;0===u.start&&(u.start=c),g&&0===g.start&&(g.start=c);const y=s.audio;let v=!1;"audio"===a&&"audio/mpeg"===(null==y?void 0:y.container)&&(v=!this.lastMpegAudioChunk||1===d.id||this.lastMpegAudioChunk.sn!==d.sn,this.lastMpegAudioChunk=d);const _=o.start,E={execute:()=>{if(h.executeStart=self.performance.now(),v){const e=this.sourceBuffer[a];if(e){const t=_-e.timestampOffset;Math.abs(t)>=.1&&(T.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${_} (delta: ${t}) sn: ${o.sn})`),e.timestampOffset=_)}}this.appendExecutor(n,a)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();h.executeEnd=h.end=e,0===u.first&&(u.first=e),g&&0===g.first&&(g.first=e);const{sourceBuffer:t}=this,r={};for(const i in t)r[i]=Or.getBuffered(t[i]);this.appendError=0,this.hls.trigger(f.BUFFER_APPENDED,{type:a,frag:o,part:l,chunkMeta:d,parent:o.type,timeRanges:r})},onError:e=>{T.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,e);const t={type:p.MEDIA_ERROR,parent:o.type,details:m.BUFFER_APPEND_ERROR,frag:o,part:l,chunkMeta:d,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=m.BUFFER_FULL_ERROR:(this.appendError++,t.details=m.BUFFER_APPEND_ERROR,this.appendError>r.config.appendErrorMaxRetry&&(T.error(`[buffer-controller]: Failed ${r.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),t.fatal=!0)),r.trigger(f.ERROR,t)}};i.append(E,a)}onBufferFlushing(e,t){const{operationQueue:r}=this,i=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(f.BUFFER_FLUSHED,{type:e})},onError:t=>{T.warn(`[buffer-controller]: Failed to remove from ${e} SourceBuffer`,t)}});t.type?r.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(e=>{r.append(i(e),e)})}onFragParsed(e,t){const{frag:r,part:i}=t,s=[],n=i?i.elementaryStreams:r.elementaryStreams;n[D.AUDIOVIDEO]?s.push("audiovideo"):(n[D.AUDIO]&&s.push("audio"),n[D.VIDEO]&&s.push("video"));const a=()=>{const e=self.performance.now();r.stats.buffering.end=e,i&&(i.stats.buffering.end=e);const t=i?i.stats:r.stats;this.hls.trigger(f.FRAG_BUFFERED,{frag:r,part:i,stats:t,id:r.type})};0===s.length&&T.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(a,s)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){const r=this.getSourceBufferTypes().reduce((e,r)=>{const i=this.sourceBuffer[r];return!i||t.type&&t.type!==r||(i.ending=!0,i.ended||(i.ended=!0,T.log(`[buffer-controller]: ${r} sourceBuffer now EOS`))),e&&!(i&&!i.ended)},!0);r&&(T.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)});const{mediaSource:e}=this;e&&"open"===e.readyState?(T.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&T.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+e.readyState)}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:r,sourceBuffer:i}=this;if(!r||null===t)return;const s=this.getSourceBufferTypes();if(!s.length)return;const n=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(!u(n)||n<0)return;const a=r.currentTime,o=t.levelTargetDuration,l=Math.max(n,o),d=Math.floor(a/o)*o-l;s.forEach(r=>{const s=i[r];if(s){const i=Or.getBuffered(s);if(i.length>0&&d>i.start(0)){if(e.trigger(f.BACK_BUFFER_REACHED,{bufferEnd:d}),t.live)e.trigger(f.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d});else if(s.ended&&i.end(i.length-1)-a<2*o)return void T.info(`[buffer-controller]: Cannot flush ${r} back buffer while SourceBuffer is in ended state`);e.trigger(f.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:r})}}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:r,mediaSource:i}=this,s=e.fragments[0].start+e.totalduration,n=r.duration,a=u(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(T.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(e)):(s>a&&s>n||!u(n))&&(T.log("[buffer-controller]: Updating Media Source duration to "+s.toFixed(3)),i.duration=s)}updateSeekableRange(e){const t=this.mediaSource,r=e.fragments,i=r.length;if(i&&e.live&&null!=t&&t.setLiveSeekableRange){const i=Math.max(0,r[0].start),s=Math.max(i,i+e.totalduration);t.setLiveSeekableRange(i,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:r}=this,i=Object.keys(r).length;if(i&&!e||2===i){this.createSourceBuffers(r),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(f.BUFFER_CREATED,{tracks:this.tracks}),e.forEach(e=>{t.executeNext(e)});else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:r}=this;if(!r)throw Error("createSourceBuffers called when mediaSource was null");for(const i in e)if(!t[i]){const s=e[i];if(!s)throw Error(`source buffer exists for track ${i}, however track does not`);const n=s.levelCodec||s.codec,a=`${s.container};codecs=${n}`;T.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const e=t[i]=r.addSourceBuffer(a),o=i;this.addBufferListener(o,"updatestart",this._onSBUpdateStart),this.addBufferListener(o,"updateend",this._onSBUpdateEnd),this.addBufferListener(o,"error",this._onSBUpdateError),this.tracks[i]={buffer:e,codec:n,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(Na){T.error("[buffer-controller]: error while trying to add sourceBuffer: "+Na.message),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:Na,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this,r=t.current(e);r.onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this,r=t.current(e);r.onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const r=new Error(e+" SourceBuffer error");T.error("[buffer-controller]: "+r,t),this.hls.trigger(f.ERROR,{type:p.MEDIA_ERROR,details:m.BUFFER_APPENDING_ERROR,error:r,fatal:!1});const i=this.operationQueue.current(e);i&&i.onError(t)}removeExecutor(e,t,r){const{media:i,mediaSource:s,operationQueue:n,sourceBuffer:a}=this,o=a[e];if(!i||!s||!o)return T.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void n.shiftAndExecuteNext(e);const l=u(i.duration)?i.duration:1/0,d=u(s.duration)?s.duration:1/0,h=Math.max(0,t),c=Math.min(r,l,d);c>h&&!o.ending?(o.ended=!1,T.log(`[buffer-controller]: Removing [${h},${c}] from the ${e} SourceBuffer`),o.remove(h,c)):n.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:r,sourceBuffer:i}=this,s=i[t];if(!s)return T.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),void r.shiftAndExecuteNext(t);s.ended=!1,s.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return T.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:r}=this,i=t.map(e=>r.appendBlocker(e));Promise.all(i).then(()=>{e(),t.forEach(e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||r.shiftAndExecuteNext(e)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,r){const i=this.sourceBuffer[e];if(!i)return;const s=r.bind(this,e);this.listeners[e].push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(e=>{t.removeEventListener(e.event,e.listener)})}}const tn={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},rn=function(e){let t=e;return tn.hasOwnProperty(e)&&(t=tn[e]),String.fromCharCode(t)},sn=15,nn=100,an={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},on={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ln={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},dn={25:2,26:4,29:6,30:8,31:10,27:13,28:15},hn=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class cn{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r="function"===typeof t?t():t;T.log(`${this.time} [${e}] ${r}`)}}}const un=function(e){const t=[];for(let r=0;rnn&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=nn)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r=144&&this.backSpace();const t=rn(e);this.pos>=nn?this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let r="",i=-1;for(let s=0;s0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}getTextAndFormat(){return this.rows}}class yn{constructor(e,t,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new gn(r),this.nonDisplayedMemory=new gn(r),this.lastOutputScreen=new gn(r),this.currRollUpRow=this.displayedMemory.rows[sn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[sn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let r=0;rt+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class vn{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const i=new cn;this.channels=[null,new yn(e,t,i),new yn(e+1,r,i)],this.cmdHistory=bn(),this.logger=i}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let r,i,s,n=!1;this.logger.time=e;for(let a=0;a ("+un([i,s])+")"),r=this.parseCmd(i,s),r||(r=this.parseMidrow(i,s)),r||(r=this.parsePAC(i,s)),r||(r=this.parseBackgroundAttributes(i,s)),!r&&(n=this.parseChars(i,s),n)){const e=this.currentChannel;if(e&&e>0){const t=this.channels[e];t.insertChars(n)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||n||this.logger.log(2,"Couldn't parse cleaned data "+un([i,s])+" orig: "+un([t[a],t[a+1]]))}}parseCmd(e,t){const{cmdHistory:r}=this,i=(20===e||28===e||21===e||29===e)&&t>=32&&t<=47,s=(23===e||31===e)&&t>=33&&t<=35;if(!i&&!s)return!1;if(En(e,t,r))return _n(null,null,r),this.logger.log(3,"Repeated command ("+un([e,t])+") is dropped"),!0;const n=20===e||21===e||23===e?1:2,a=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),_n(e,t,r),this.currentChannel=n,!0}parseMidrow(e,t){let r=0;if((17===e||25===e)&&t>=32&&t<=47){if(r=17===e?1:2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[r];return!!i&&(i.ccMIDROW(t),this.logger.log(3,"MIDROW ("+un([e,t])+")"),!0)}return!1}parsePAC(e,t){let r;const i=this.cmdHistory,s=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,n=(16===e||24===e)&&t>=64&&t<=95;if(!s&&!n)return!1;if(En(e,t,i))return _n(null,null,i),!0;const a=e<=23?1:2;r=t>=64&&t<=95?1===a?an[e]:ln[e]:1===a?on[e]:dn[e];const o=this.channels[a];return!!o&&(o.setPAC(this.interpretPAC(r,t)),_n(e,t,i),this.currentChannel=a,!0)}interpretPAC(e,t){let r;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1===(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i}parseChars(e,t){let r,i=null,s=null;if(e>=25?(r=2,s=e-8):(r=1,s=e),s>=17&&s<=19){let e;e=17===s?t+80:18===s?t+112:t+144,this.logger.log(2,"Special char '"+rn(e)+"' in channel "+r),i=[e]}else e>=32&&e<=127&&(i=0===t?[e]:[e,t]);if(i){const r=un(i);this.logger.log(3,"Char codes = "+r.join(",")),_n(e,t,this.cmdHistory)}return i}parseBackgroundAttributes(e,t){const r=(16===e||24===e)&&t>=32&&t<=47,i=(23===e||31===e)&&t>=45&&t<=47;if(!r&&!i)return!1;let s;const n={};16===e||24===e?(s=Math.floor((t-32)/2),n.background=hn[s],t%2===1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));const a=e<=23?1:2,o=this.channels[a];return o.setBkgData(n),_n(e,t,this.cmdHistory),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Sn=function(){if("undefined"!==typeof self&&self.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!==typeof t)return!1;if(!Array.isArray(e))return!1;const r=t.toLowerCase();return!!~e.indexOf(r)&&r}function i(t){return r(e,t)}function s(e){return r(t,e)}function n(e,...t){let r=1;for(;r100)throw new Error("Position must be between 0 and 100.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",n({},o,{get:function(){return _},set:function(e){const t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",n({},o,{get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",n({},o,{get:function(){return b},set:function(e){const t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),a.displayState=void 0}return a.prototype.getCueAsHTML=function(){const e=self.WebVTT;return e.convertCueToDOMTree(self,this.text)},a}();class Ln{decode(e,t){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function An(e){function t(e,t,r,i){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(i||0)}const r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}class wn{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let i=0;i=0&&r<=100)return this.set(e,r),!0}return!1}}function Rn(e,t,r,i){const s=i?e.split(i):[e];for(const n in s){if("string"!==typeof s[n])continue;const e=s[n].split(r);if(2!==e.length)continue;const i=e[0],a=e[1];t(i,a)}}const kn=new Sn(0,0,""),In="middle"===kn.align?"middle":"center";function Dn(e,t,r){const i=e;function s(){const t=An(e);if(null===t)throw new Error("Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function n(e,t){const i=new wn;Rn(e,(function(e,t){let s;switch(e){case"region":for(let s=r.length-1;s>=0;s--)if(r[s].id===t){i.set(e,r[s].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":s=t.split(","),i.integer(e,s[0]),i.percent(e,s[0])&&i.set("snapToLines",!1),i.alt(e,s[0],["auto"]),2===s.length&&i.alt("lineAlign",s[1],["start",In,"end"]);break;case"position":s=t.split(","),i.percent(e,s[0]),2===s.length&&i.alt("positionAlign",s[1],["start",In,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",In,"end","left","right"]);break}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");let s=i.get("line","auto");"auto"===s&&-1===kn.line&&(s=-1),t.line=s,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",In);let n=i.get("position","auto");"auto"===n&&50===kn.position&&(n="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=n}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=s(),a(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.slice(3),a(),t.endTime=s(),a(),n(e,t)}function xn(e){return e.replace(//gi,"\n")}class Cn{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Ln,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function r(){let e=t.buffer,r=0;e=xn(e);while(r9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!u(t)||!u(r)||!u(i)||!u(s))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*r,t+=6e4*i,t+=36e5*s,t},Fn=function(e){let t=5381,r=e.length;while(r)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()};function Nn(e,t,r){return Fn(e.toString())+Fn(t.toString())+Fn(r)}const Un=function(e,t,r){let i=e[t],s=e[i.prevCC];if(!s||!s.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);while(null!=(n=s)&&n.new){var n;e.ccOffset+=i.start-s.start,i.new=!1,i=s,s=e[i.prevCC]}e.presentationOffset=r};function Bn(e,t,r,i,s,n,a){const o=new Cn,l=ue(new Uint8Array(e)).trim().replace(Pn,"\n").split("\n"),d=[],h=t?es(t.baseTime,t.timescale):0;let c,u="00:00.000",f=0,p=0,m=!0;o.oncue=function(e){const n=r[i];let a=r.ccOffset;const o=(f-h)/9e4;if(null!=n&&n.new&&(void 0!==p?a=r.ccOffset=n.start:Un(r,i,o)),o){if(!t)return void(c=new Error("Missing initPTS for VTT MPEGTS"));a=o-r.presentationOffset}const l=e.endTime-e.startTime,u=ls(9e4*(e.startTime+a-p),9e4*s)/9e4;e.startTime=Math.max(u,0),e.endTime=Math.max(u+l,0);const m=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(m)),e.id||(e.id=Nn(e.startTime,e.endTime,m)),e.endTime>0&&d.push(e)},o.onparsingerror=function(e){c=e},o.onflush=function(){c?a(c):n(d)},l.forEach(e=>{if(m){if(On(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach(e=>{On(e,"LOCAL:")?u=e.slice(6):On(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))});try{p=Mn(u)/1e3}catch(t){c=t}return}""===e&&(m=!1)}o.parse(e+"\n")}),o.flush()}const $n="stpp.ttml.im1t",Gn=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,jn=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Kn={left:"start",center:"center",right:"end",start:"start",end:"end"};function Vn(e,t,r,i){const s=Le(new Uint8Array(e),["mdat"]);if(0===s.length)return void i(new Error("Could not parse IMSC1 mdat"));const n=s.map(e=>ue(e)),a=Zi(t.baseTime,1,t.timescale);try{n.forEach(e=>r(Hn(e,a)))}catch(o){i(o)}}function Hn(e,t){const r=new DOMParser,i=r.parseFromString(e,"text/xml"),s=i.getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(n).reduce((e,t)=>(e[t]=s.getAttribute("ttp:"+t)||n[t],e),{}),o="preserve"!==s.getAttribute("xml:space"),l=zn(Yn(s,"styling","style")),h=zn(Yn(s,"layout","region")),c=Yn(s,"body","[begin]");return[].map.call(c,e=>{const r=Wn(e,o);if(!r||!e.hasAttribute("begin"))return null;const i=Zn(e.getAttribute("begin"),a),s=Zn(e.getAttribute("dur"),a);let n=Zn(e.getAttribute("end"),a);if(null===i)throw Qn(e);if(null===n){if(null===s)throw Qn(e);n=i+s}const c=new Sn(i-t,n-t,r);c.id=Nn(c.startTime,c.endTime,c.text);const u=h[e.getAttribute("region")],f=l[e.getAttribute("style")],p=qn(u,f,l),{textAlign:m}=p;if(m){const e=Kn[m];e&&(c.lineAlign=e),c.align=m}return d(c,p),c}).filter(e=>null!==e)}function Yn(e,t,r){const i=e.getElementsByTagName(t)[0];return i?[].slice.call(i.querySelectorAll(r)):[]}function zn(e){return e.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function Wn(e,t){return[].slice.call(e.childNodes).reduce((e,r,i)=>{var s;return"br"===r.nodeName&&i?e+"\n":null!=(s=r.childNodes)&&s.length?Wn(r,t):t?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent},"")}function qn(e,t,r){const i="http://www.w3.org/ns/ttml#styling";let s=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return a&&r.hasOwnProperty(a)&&(s=r[a]),n.reduce((r,n)=>{const a=Xn(t,i,n)||Xn(e,i,n)||Xn(s,i,n);return a&&(r[n]=a),r},{})}function Xn(e,t,r){return e&&e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function Qn(e){return new Error("Could not parse ttml timestamp "+e)}function Zn(e,t){if(!e)return null;let r=An(e);return null===r&&(Gn.test(e)?r=Jn(e,t):jn.test(e)&&(r=ea(e,t))),r}function Jn(e,t){const r=Gn.exec(e),i=(0|r[4])+(0|r[5])/t.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+i/t.frameRate}function ea(e,t){const r=jn.exec(e),i=Number(r[1]),s=r[2];switch(s){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/t.frameRate;case"t":return i/t.tickRate}return i}class ta{constructor(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=sa(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new Tn(this,"textTrack1"),t=new Tn(this,"textTrack2"),r=new Tn(this,"textTrack3"),i=new Tn(this,"textTrack4");this.cea608Parser1=new vn(1,e,t),this.cea608Parser2=new vn(3,r,i)}e.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(f.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(f.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(f.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(f.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,r,i,s){let n=!1;for(let a=s.length;a--;){const e=s[a],i=ia(e[0],e[1],t,r);if(i>=0&&(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],r),n=!0,i/(r-t)>.5))return}if(n||s.push([t,r]),this.config.renderTextTracksNatively){const s=this.captionsTracks[e];this.Cues.newCue(s,t,r,i)}else{const s=this.Cues.newCue(null,t,r,i);this.hls.trigger(f.CUES_PARSED,{type:"captions",cues:s,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:i,timescale:s}){const{unparsedVttFrags:n}=this;"main"===r&&(this.initPTS[t.cc]={baseTime:i,timescale:s}),n.length&&(this.unparsedVttFrags=[],n.forEach(e=>{this.onFragLoaded(f.FRAG_LOADED,e)}))}getExistingTrack(e){const{media:t}=this;if(t)for(let r=0;r{At(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=sa(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let r=0;re.textCodec===$n);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){const e=Vs(this.tracks,r);if(e)return void(this.tracks=r);if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const e=this.media?this.media.textTracks:null;this.tracks.forEach((t,r)=>{let i;if(e&&r({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}));this.hls.trigger(f.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),r=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&r)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const r="textTrack"+t[1],i=this.captionsProperties[r];i&&(i.label=e.name,e.lang&&(i.languageCode=e.lang),i.media=e)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:r,cea608Parser2:i,lastSn:s,lastPartIndex:n}=this;if(this.enabled&&r&&i&&t.frag.type===_t.MAIN){var a,o;const e=t.frag.sn,l=null!=(a=null==t||null==(o=t.part)?void 0:o.index)?a:-1;e===s+1||e===s&&l===n+1||(r.reset(),i.reset()),this.lastSn=e,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:r,payload:i}=t;if(r.type===_t.SUBTITLE)if(i.byteLength){const e=r.decryptdata,s="stats"in t;if(null==e||!e.encrypted||s){const e=this.tracks[r.level],s=this.vttCCs;s[r.cc]||(s[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),e&&e.textCodec===$n?this._parseIMSC1(r,i):this._parseVTTs(t)}}else this.hls.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;Vn(t,this.initPTS[e.cc],t=>{this._appendCues(t,e.level),r.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},t=>{T.log("Failed to parse IMSC1: "+t),r.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})}_parseVTTs(e){var t;const{frag:r,payload:i}=e,{initPTS:s,unparsedVttFrags:n}=this,a=s.length-1;if(!s[r.cc]&&-1===a)return void n.push(e);const o=this.hls,l=null!=(t=r.initSegment)&&t.data?Oe(r.initSegment.data,new Uint8Array(i)):i;Bn(l,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,e=>{this._appendCues(e,r.level),o.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},t=>{const s="Missing initPTS for VTT MPEGTS"===t.message;s?n.push(e):this._fallbackToIMSC1(r,i),T.log("Failed to parse VTT cue: "+t),s&&a>r.cc||o.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:t})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||Vn(t,this.initPTS[e.cc],()=>{r.textCodec=$n,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||"disabled"===r.mode)return;e.forEach(e=>Lt(r,e))}else{const i=this.tracks[t];if(!i)return;const s=i.default?"default":"subtitles"+t;r.trigger(f.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===_t.SUBTITLE&&this.onFragLoaded(f.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:r,cea608Parser2:i}=this;if(!this.enabled||!r||!i)return;const{frag:s,samples:n}=t;if(s.type!==_t.MAIN||"NONE"!==this.closedCaptionsForLevel(s))for(let a=0;awt(e[i],t,r))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==i){const{textTracks:e}=this;Object.keys(e).forEach(r=>wt(e[r],t,i))}}}extractCea608Data(e){const t=[[],[]],r=31&e[0];let i=2;for(let s=0;s0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const r=t.filter((t,r)=>this.isLevelAllowed(t)&&r<=e);return this.clientRect=null,na.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}isLevelAllowed(e){const t=this.restrictedLevels;return!t.some(t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height)}static getMaxLevelByMediaSize(e,t,r){if(null==e||!e.length)return-1;const i=(e,t)=>!t||(e.width!==t.width||e.height!==t.height);let s=e.length-1;for(let n=0;n=t||a.height>=r)&&i(a,e[n+1])){s=n;break}}return s}}class aa{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"===typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,r){const i=performance.now();if(t){if(this.lastTime){const e=i-this.lastTime,s=r-this.lastDroppedFrames,n=t-this.lastDecodedFrames,a=1e3*s/e,o=this.hls;if(o.trigger(f.FPS_DROP,{currentDropped:s,currentDecoded:n,totalDroppedFrames:r}),a>0&&s>o.config.fpsDroppedMonitoringThreshold*n){let e=o.currentLevel;T.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(f.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const oa="[eme]";class la{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=la.CDMCleanupPromise?[la.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=T.debug.bind(T,oa),this.log=T.log.bind(T,oa),this.warn=T.warn.bind(T,oa),this.error=T.error.bind(T,oa),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(f.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(f.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(f.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(f.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===G.WIDEVINE&&r)return r;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,r=t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(e,t,r)=>!!e&&r.indexOf(e)===t,i=t.map(e=>e.audioCodec).filter(r),s=t.map(e=>e.videoCodec).filter(r);return i.length+s.length===0&&s.push("avc1.42e01e"),new Promise((t,r)=>{const n=e=>{const a=e.shift();this.getMediaKeysPromise(a,i,s).then(e=>t({keySystem:a,mediaKeys:e})).catch(t=>{e.length?n(e):r(t instanceof da?t:new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))})};n(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if("function"!==typeof r){let e="Configured requestMediaKeySystemAccess is not a function "+r;return null===W&&"http:"===self.location.protocol&&(e="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(e))}return r(e,t)}getMediaKeysPromise(e,t,r){const i=q(e,t,r,this.config.drmSystemOptions),s=this.keySystemAccessPromises[e];let n=null==s?void 0:s.keySystemAccess;if(!n){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),n=this.requestMediaKeySystemAccess(e,i);const t=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch(t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)}),n.then(r=>{this.log(`Access for key-system "${r.keySystem}" obtained`);const i=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=r.createMediaKeys().then(t=>(this.log(`Media-keys created for "${e}"`),i.then(r=>r?this.setMediaKeysServerCertificate(t,e,r):t))),t.mediaKeys.catch(t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)}),t.mediaKeys})}return n.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${me.hexDump(e.keyId||[])}`);const i=r.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(r,s,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return me.hexDump(e.keyId)}updateKeySession(e,t){var r;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${me.hexDump((null==(r=e.decryptdata)?void 0:r.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,r)=>{const i=z(this.config),s=e.map(K).filter(e=>!!e&&-1!==i.indexOf(e));return this.getKeySystemSelectionPromise(s).then(({keySystem:e})=>{const i=Y(e);i?t(i):r(new Error(`Unable to find format for key-system "${e}"`))}).catch(r)})}loadKey(e){const t=e.keyInfo.decryptdata,r=this.getKeyIdString(t),i=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log("Starting session for key "+i);let s=this.keyIdToKeySessionPromise[r];return s||(s=this.keyIdToKeySessionPromise[r]=this.getKeySystemForKeyPromise(t).then(({keySystem:r,mediaKeys:s})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(r,s).then(()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:r,mediaKeys:s,decryptdata:t}),i="cenc";return this.generateRequestWithPreferredKeySession(e,i,t.pssh,"playlist-key")}))),s.catch(e=>this.handleError(e))),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof da?this.hls.trigger(f.ERROR,e.data):this.hls.trigger(f.ERROR,{type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){const t=K(e.keyFormat),r=t?[t]:z(this.config);return this.attemptKeySystemAccess(r)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=z(this.config)),0===e.length)throw new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:r}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===r)return;let i,s;if("sinf"===t&&this.config.drmSystems[G.FAIRPLAY]){const e=_e(new Uint8Array(r));try{const t=F(JSON.parse(e).sinf),r=ke(new Uint8Array(t));if(!r)return;i=r.subarray(8,24),s=G.FAIRPLAY}catch(d){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=Ke(r);if(null===e)return;0===e.version&&e.systemId===V.WIDEVINE&&e.data&&(i=e.data.subarray(8,24)),s=H(e.systemId)}if(!s||!i)return;const n=me.hexDump(i),{keyIdToKeySessionPromise:a,mediaKeySessions:o}=this;let l=a[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(e,t,r,"encrypted-event-key-match"));break}}l||(l=a[n]=this.getKeySystemSelectionPromise([s]).then(({keySystem:e,mediaKeys:s})=>{var a;this.throwIfDestroyed();const o=new He("ISO-23001-7",n,null!=(a=Y(e))?a:"");return o.pssh=new Uint8Array(r),o.keyId=i,this.attemptSetMediaKeys(e,s).then(()=>{this.throwIfDestroyed();const i=this.createMediaKeySessionContext({decryptdata:o,keySystem:e,mediaKeys:s});return this.generateRequestWithPreferredKeySession(i,t,r,"encrypted-event-no-match")})})),l.catch(e=>this.handleError(e))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(r).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(e=>-1===r.indexOf(e))})}generateRequestWithPreferredKeySession(e,t,r,i){var s,n;const a=null==(s=this.config.drmSystems)||null==(n=s[e.keySystem])?void 0:n.generateRequest;if(a)try{const i=a.call(this.hls,t,r,e);if(!i)throw new Error("Invalid response from configured generateRequest filter");t=i.initDataType,r=e.decryptdata.pssh=i.initData?new Uint8Array(i.initData):null}catch(c){var o;if(this.warn(c.message),null!=(o=this.hls)&&o.config.debug)throw c}if(null===r)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${l} (init data type: ${t} length: ${r?r.byteLength:null})`);const d=new ws;e.mediaKeysSession.onmessage=t=>{const r=e.mediaKeysSession;if(!r)return void d.emit("error",new Error("invalid state"));const{messageType:i,message:s}=t;this.log(`"${i}" message event for session "${r.sessionId}" message size: ${s.byteLength}`),"license-request"===i||"license-renewal"===i?this.renewLicense(e,s).catch(e=>{this.handleError(e),d.emit("error",e)}):"license-release"===i?e.keySystem===G.FAIRPLAY&&(this.updateKeySession(e,$("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${i}"`)},e.mediaKeysSession.onkeystatuseschange=t=>{const r=e.mediaKeysSession;if(!r)return void d.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const i=e.keyStatus;d.emit("keyStatus",i),"expired"===i&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const h=new Promise((e,t)=>{d.on("error",t),d.on("keyStatus",r=>{r.startsWith("usable")?e():"output-restricted"===r?t(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===r?t(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${r}"`)):"expired"===r?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${r}"`)})});return e.mediaKeysSession.generateRequest(t,r).then(()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)}).catch(e=>{throw new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},"Error generating key-session request: "+e)}).then(()=>h).catch(t=>{throw d.removeAllListeners(),this.removeSession(e),t}).then(()=>(d.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,r)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${me.hexDump("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))} session keyId: ${me.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,r=t.loader,i=new r(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching serverCertificate for "${e}"`),new Promise((r,n)=>{const a={responseType:"arraybuffer",url:s},l=t.certLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(e,t,i,s)=>{r(e.data)},onError:(t,r,i,l)=>{n(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:o({url:a.url,data:void 0},t)},`"${e}" certificate request failed (${s}). Status: ${t.code} (${t.text})`))},onTimeout:(t,r,i)=>{n(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(e,t,r)=>{n(new Error("aborted"))}};i.load(a,d,h)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((i,s)=>{e.setServerCertificate(r).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${null==r?void 0:r.byteLength}) on "${t}"`),i(e)}).catch(e=>{s(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(t=>this.updateKeySession(e,new Uint8Array(t)).catch(e=>{throw new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))}setupLicenseXHR(e,t,r,i){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,r,i)}).catch(n=>{if(!r.decryptdata)throw n;return e.open("POST",t,!0),s.call(this.hls,e,t,r,i)}).then(r=>{e.readyState||e.open("POST",t,!0);const s=r||i;return{xhr:e,licenseChallenge:s}}):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((i,s)=>{const n=this.getLicenseServerUrl(e.keySystem);this.log("Sending license request to URL: "+n);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let t=a.response;this.log("License received "+(t instanceof ArrayBuffer?t.byteLength:t));const r=this.config.licenseResponseCallback;if(r)try{t=r.call(this.hls,a,n,e)}catch(o){this.error(o)}i(t)}else{const o=r.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)s(new da({type:p.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:n,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${n}). Status: ${a.status} (${a.statusText})`));else{const r=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${r} attempts left`),this.requestLicense(e,t).then(i,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,n,e,t).then(({xhr:e,licenseChallenge:t})=>{e.send(t)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},He.clearKeyUriToKeyIdMap();const r=t.length;la.CDMCleanupPromise=Promise.all(t.map(e=>this.removeSession(e)).concat(null==e?void 0:e.setMediaKeys(null).catch(t=>{this.log(`Could not clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)}))).then(()=>{r&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(t=>{this.log(`Could not close sessions and clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e),[]);this.log("Selecting key-system from session-keys "+e.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r}=e;if(t){this.log("Remove licenses and keys and close session "+t.sessionId),t.onmessage=null,t.onkeystatuseschange=null,r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(e=>{this.log("Could not remove session: "+e)}).then(()=>t.close()).catch(e=>{this.log("Could not close session: "+e)})}}}la.CDMCleanupPromise=void 0;class da extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}const ha=1;var ca={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const ua="h";class fa{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:ca.MANIFEST,su:!this.initialized})}catch(t){T.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=e=>{try{const t=e.frag,r=this.hls.levels[t.level],i=this.getObjectType(t),s={d:1e3*t.duration,ot:i};i!==ca.VIDEO&&i!==ca.AUDIO&&i!=ca.MUXED||(s.br=r.bitrate/1e3,s.tb=this.getTopBandwidth(i)/1e3,s.bl=this.getBufferLength(i)),this.apply(e,s)}catch(t){T.warn("Could not generate segment CMCD data.",t)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;null!=r&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||fa.uuid(),this.cid=r.contentId,this.useHeaders=!0===r.useHeaders,this.registerListeners())}registerListeners(){const e=this.hls;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHED,this.onMediaDetached,this),e.on(f.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHED,this.onMediaDetached,this),e.off(f.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var r,i;this.audioBuffer=null==(r=t.tracks.audio)?void 0:r.buffer,this.videoBuffer=null==(i=t.tracks.video)?void 0:i.buffer}createData(){var e;return{v:ha,sf:ua,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){d(t,this.createData());const r=t.ot===ca.INIT||t.ot===ca.VIDEO||t.ot===ca.MUXED;if(this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering),this.useHeaders){const r=fa.toHeaders(t);if(!Object.keys(r).length)return;e.headers||(e.headers={}),d(e.headers,r)}else{const r=fa.toQuery(t);if(!r)return;e.url=fa.appendQueryToUri(e.url,r)}}getObjectType(e){const{type:t}=e;return"subtitle"===t?ca.TIMED_TEXT:"initSegment"===e.sn?ca.INIT:"audio"===t?ca.AUDIO:"main"===t?this.hls.audioTracks.length?ca.VIDEO:ca.MUXED:void 0}getTopBandwidth(e){let t,r=0;const i=this.hls;if(e===ca.AUDIO)t=i.audioTracks;else{const e=i.maxAutoLevel,r=e>-1?e+1:i.levels.length;t=i.levels.slice(0,r)}for(const s of t)s.bitrate>r&&(r=s.bitrate);return r>0?r:NaN}getBufferLength(e){const t=this.hls.media,r=e===ca.AUDIO?this.audioBuffer:this.videoBuffer;if(!r||!t)return NaN;const i=Or.bufferInfo(r,t.currentTime,this.config.maxBufferHole);return 1e3*i.len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,i){t(e),this.loader.load(e,r,i)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,i){t(e),this.loader.load(e,r,i)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],r=e=>!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e,i=e=>Math.round(e),s=e=>100*i(e/100),n=e=>encodeURIComponent(e),a={br:i,d:i,bl:s,dl:s,mtp:s,nor:n,rtp:s,tb:i},o=Object.keys(e||{}).sort();for(const l of o){let i=e[l];if(!r(i))continue;if("v"===l&&1===i)continue;if("pr"==l&&1===i)continue;const s=a[l];s&&(i=s(i));const n=typeof i;let o;o="ot"===l||"sf"===l||"st"===l?`${l}=${i}`:"boolean"===n?l:"number"===n?`${l}=${i}`:`${l}=${JSON.stringify(i)}`,t.push(o)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),r={},i=["Object","Request","Session","Status"],s=[{},{},{},{}],n={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};for(const a of t){const t=null!=n[a]?n[a]:1;s[t][a]=e[a]}for(let a=0;at!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:r}=t;null!==r&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((null==r?void 0:r.action)===fr.SendAlternateToPenaltyBox&&r.flags===pr.MoveAllAlternatesMatchingHost){let e=this.pathwayPriority;const t=this.pathwayId;this.penalizedPathways[t]||(this.penalizedPathways[t]=performance.now()),!e&&this.levels&&(e=this.levels.reduce((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e),[])),e&&e.length>1&&(this.updatePathwayPriority(e),r.resolved=this.pathwayId!==t)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){let t;this.pathwayPriority=e;const r=this.penalizedPathways,i=performance.now();Object.keys(r).forEach(e=>{i-r[e]>pa&&delete r[e]});for(let s=0;s0){this.log(`Setting Pathway to "${i}"`),this.pathwayId=i,this.hls.trigger(f.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[n];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=n);break}}}clonePathways(e){const t=this.levels;if(!t)return;const r={},i={};e.forEach(e=>{const{ID:s,"BASE-ID":n,"URI-REPLACEMENT":a}=e;if(t.some(e=>e.pathwayId===s))return;const o=this.getLevelsForPathway(n).map(e=>{const t=d({},e);t.details=void 0,t.url=ya(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a);const n=new A(e.attrs);n["PATHWAY-ID"]=s;const o=n.AUDIO&&`${n.AUDIO}_clone_${s}`,l=n.SUBTITLES&&`${n.SUBTITLES}_clone_${s}`;o&&(r[n.AUDIO]=o,n.AUDIO=o),l&&(i[n.SUBTITLES]=l,n.SUBTITLES=l),t.attrs=n;const h=new Gt(t);return Er(h,"audio",o),Er(h,"text",l),h});t.push(...o),ga(this.audioTracks,r,a,s),ga(this.subtitleTracks,i,a,s)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;let i;this.loader&&this.loader.destroy(),this.loader=new r(t);try{i=new self.URL(e)}catch(d){return this.enabled=!1,void this.log("Failed to parse Steering Manifest URI: "+e)}if("data:"!==i.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+e)}const s={responseType:"json",url:i.href},n=t.steeringManifestLoadPolicy.default,a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,r,s)=>{this.log(`Loaded steering manifest: "${i}"`);const n=e.data;if(1!==n.VERSION)return void this.log(`Steering VERSION ${n.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=n.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=n;if(a)try{this.uri=new self.URL(a,i).href}catch(d){return this.enabled=!1,void this.log("Failed to parse Steering Manifest RELOAD-URI: "+a)}this.scheduleRefresh(this.uri||r.url),o&&this.clonePathways(o),l&&this.updatePathwayPriority(l)},onError:(e,t,r,i)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let s=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,s);else{const e=this.loader;if("function"===typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(s=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,r)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log("Requesting steering manifest: "+i),this.loader.load(s,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(e)},t)}}function ga(e,t,r,i){e&&Object.keys(t).forEach(s=>{const n=e.filter(e=>e.groupId===s).map(e=>{const n=d({},e);return n.details=void 0,n.attrs=new A(n.attrs),n.url=n.attrs.URI=ya(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",r),n.groupId=n.attrs["GROUP-ID"]=t[s],n.attrs["PATHWAY-ID"]=i,n});e.push(...n)})}function ya(e,t,r,i){const{HOST:s,PARAMS:n,[r]:a}=i;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return s&&!o&&(l.host=s),n&&Object.keys(n).sort().forEach(e=>{e&&l.searchParams.set(e,n[e])}),l.href}const va=/^age:\s*[\d.]+\s*$/im;class _a{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new I,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!this.stats.aborted)return s(r,t.url)}).catch(e=>(r.open("GET",t.url,!0),s(r,t.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(e=>{this.callbacks.onError({code:r.status,text:e.message},t,r,i)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const i=this.context.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:n}=r.loadPolicy;if(i)for(const a in i)e.setRequestHeader(a,i[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=s&&u(s)?s:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const i=t.readyState,s=this.config;if(!r.aborted&&i>=2&&(0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),4===i)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const i=t.status,n="text"!==t.responseType;if(i>=200&&i<300&&(n&&t.response||null!==t.responseText)){r.loading.end=Math.max(self.performance.now(),r.loading.first);const s=n?t.response:t.responseText,a="arraybuffer"===t.responseType?s.byteLength:s.length;if(r.loaded=r.total=a,r.bwEstimate=8e3*r.total/(r.loading.end-r.loading.first),!this.callbacks)return;const o=this.callbacks.onProgress;if(o&&o(r,e,s,t),!this.callbacks)return;const l={url:t.responseURL,data:s,code:i};this.callbacks.onSuccess(l,r,e,t)}else{const n=s.loadPolicy.errorRetry,a=r.retry;sr(n,a,!1,i)?this.retry(n):(T.error(`${i} while loading ${e.url}`),this.callbacks.onError({code:i,text:t.statusText},e,t,r))}}}loadtimeout(){var e;const t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry,r=this.stats.retry;if(sr(t,r,!0))this.retry(t);else{T.warn("timeout while loading "+this.context.url);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=rr(e,r.retry),r.retry++,T.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${r.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&va.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function Ea(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}const ba=/(\d+)-(\d+)\/(\d+)/;class Ta{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||wa,this.controller=new self.AbortController,this.stats=new I}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,r){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const s=Sa(e,this.controller.signal),n=r.onProgress,a="arraybuffer"===e.responseType,o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:d}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=l&&u(l)?l:d,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),r.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(s=>{this.response=this.loader=s;const o=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=d,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),r.onTimeout(i,e,this.response)},d-(o-i.loading.start)),!s.ok){const{status:e,statusText:t}=s;throw new Ra(t||"fetch, bad network response",e,s)}return i.loading.first=o,i.total=Aa(s.headers)||i.total,n&&u(t.highWaterMark)?this.loadProgressively(s,i,e,t.highWaterMark,n):a?s.arrayBuffer():"json"===e.responseType?s.json():s.text()}).then(s=>{const{response:a}=this;self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const l=s[o];l&&(i.loaded=i.total=l);const d={url:a.url,data:s,code:a.status};n&&!u(t.highWaterMark)&&n(i,e,s,a),r.onSuccess(d,i,e,a)}).catch(t=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const s=t&&t.code||0,n=t?t.message:null;r.onError({code:s,text:n},e,t?t.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,i=0,s){const n=new Bs,a=e.body.getReader(),o=()=>a.read().then(a=>{if(a.done)return n.dataLength&&s(t,r,n.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=a.value,d=l.length;return t.loaded+=d,d=i&&s(t,r,n.flush(),e)):s(t,r,l,e),o()}).catch(()=>Promise.reject());return o()}}function Sa(e,t){const r={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(d({},e.headers))};return e.rangeEnd&&r.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),r}function La(e){const t=ba.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}function Aa(e){const t=e.get("Content-Range");if(t){const e=La(t);if(u(e))return e}const r=e.get("Content-Length");if(r)return parseInt(r)}function wa(e,t){return new self.Request(e.url,t)}class Ra extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const ka=/\s/,Ia={newCue(e,t,r,i){const s=[];let n,a,o,l,d;const h=self.VTTCue||self.TextTrackCue;for(let u=0;u=16?l--:l++;const i=xn(d.trim()),f=Nn(t,r,i);null!=e&&null!=(c=e.cues)&&c.getCueById(f)||(a=new h(t,r,i),a.id=f,a.line=u+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),s.push(a))}return e&&s.length&&(s.sort((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line),s.forEach(t=>Lt(e,t))),s}},Da={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},xa=o(o({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:_a,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Us,bufferController:en,capLevelController:na,errorController:mr,fpsController:aa,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:W,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:Da},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Ca()),{},{subtitleStreamController:zs,subtitleTrackController:qs,timelineController:ta,audioStreamController:js,audioTrackController:Ks,emeController:la,cmcdController:fa,contentSteeringController:ma});function Ca(){return{cueHandler:Ia,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Pa(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=Oa(e),i=["manifest","level","frag"],s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(e=>{const i=("level"===e?"playlist":e)+"LoadPolicy",n=void 0===t[i],a=[];s.forEach(s=>{const o=`${e}Loading${s}`,l=t[o];if(void 0!==l&&n){a.push(o);const e=r[i].default;switch(t[i]={default:e},s){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l;break}}}),a.length&&T.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${i}": ${JSON.stringify(t[i])}`)}),o(o({},r),t)}function Oa(e){return e&&"object"===typeof e?Array.isArray(e)?e.map(Oa):Object.keys(e).reduce((t,r)=>(t[r]=Oa(e[r]),t),{}):e}function Ma(e){const t=e.loader;if(t!==Ta&&t!==_a)T.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{const t=Ea();t&&(e.loader=Ta,e.progressive=!0,e.enableSoftwareAES=!0,T.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class Fa{static get version(){return"1.4.12"}static isSupported(){return ri()}static get Events(){return f}static get ErrorTypes(){return p}static get ErrorDetails(){return m}static get DefaultConfig(){return Fa.defaultConfig?Fa.defaultConfig:xa}static set DefaultConfig(e){Fa.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ws,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,b(e.debug||!1,"Hls instance");const t=this.config=Pa(Fa.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&Ma(t);const{abrController:r,bufferController:i,capLevelController:s,errorController:n,fpsController:a}=t,o=new n(this),l=this.abrController=new r(this),d=this.bufferController=new i(this),h=this.capLevelController=new s(this),c=new a(this),u=new Tt(this),p=new Mt(this),m=t.contentSteeringController,g=m?new m(this):null,y=this.levelController=new _r(this,g),v=new Sr(this),_=new xr(this.config),E=this.streamController=new Ms(this,v,_);h.setStreamController(E),c.setStreamController(E);const T=[u,y,E];g&&T.splice(1,0,g),this.networkControllers=T;const S=[l,d,h,c,p,v];this.audioTrackController=this.createController(t.audioTrackController,T);const L=t.audioStreamController;L&&T.push(new L(this,v,_)),this.subtitleTrackController=this.createController(t.subtitleTrackController,T);const A=t.subtitleStreamController;A&&T.push(new A(this,v,_)),this.createController(t.timelineController,S),_.emeController=this.emeController=this.createController(t.emeController,S),this.cmcdController=this.createController(t.cmcdController,S),this.latencyController=this.createController(Ft,S),this.coreComponents=S,T.push(o);const w=o.onErrorOut;"function"===typeof w&&this.on(f.ERROR,w,o)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,i){this._emitter.off(e,t,r,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){T.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.trigger(f.ERROR,{type:p.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:!1,event:e,error:r})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){T.log("destroy"),this.trigger(f.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){T.log("attachMedia"),this._media=e,this.trigger(f.MEDIA_ATTACHING,{media:e})}detachMedia(){T.log("detachMedia"),this.trigger(f.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,r=this.url,i=this.url=n.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});T.log("loadSource:"+i),t&&r&&(r!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(f.MANIFEST_LOADING,{url:e})}startLoad(e=-1){T.log(`startLoad(${e})`),this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){T.log("stopLoad"),this.networkControllers.forEach(e=>{e.stopLoad()})}swapAudioCodec(){T.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){T.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){T.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){T.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){T.log("set loadLevel:"+e),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){T.log("set firstLevel:"+e),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){T.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(T.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Nt.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const r=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let i;if(i=-1===t&&e&&e.length?e.length-1:t,r)for(let s=i;s--;){const t=e[s].attrs["HDCP-LEVEL"];if(t&&t<=r)return s}return i}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Fa.defaultConfig=void 0},ae74:function(e,t,r){var i=r("24fb");t=i(!1),t.push([e.i,'/*!\n* Mui Player Css Library v1.8.1 @Professional edition\n* Date:2023-01-28\n* Released under GPL-3.0 license\n* https://muiplayer.js.org/\n*/.m-player{width:auto;height:225px;position:relative;overflow:hidden;background:#000;outline:none;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.m-player .mplayer-footer{color:#fff;position:absolute;bottom:0;right:0;left:0;background:linear-gradient(180deg,hsla(0,0%,100%,0),rgba(0,0,0,.65));-webkit-transform:translateY(50px);transform:translateY(50px);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;z-index:7;height:48px;padding:0 10px}.m-player .mplayer-footer.show{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}.m-player .mplayer-footer .progress{display:flex;align-items:center;justify-content:space-between;height:inherit}.m-player .mplayer-footer .progress .progress-container{display:flex;align-items:center;flex:1;height:25px}.m-player .mplayer-footer .progress .progress-container.upper-position{position:absolute;left:20px;right:20px;bottom:100%;margin-bottom:-10.5px}.m-player .mplayer-footer .progress .progress-container .touch-effective{position:relative;height:100%;display:flex;flex:1;align-items:center;margin-left:8px;margin-right:8px;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-default-scale{border-radius:0!important;-webkit-transform:translateY(-50%) translateZ(0) scaleY(2)!important;transform:translateY(-50%) translateZ(0) scaleY(2)!important}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-hover-scale{-webkit-transform:translateY(-50%) translateZ(0) scaleY(3)!important;transform:translateY(-50%) translateZ(0) scaleY(3)!important}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-total{width:100%;background-color:hsla(0,0%,100%,.2);overflow:hidden}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-play,.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-total{position:absolute;height:2px;border-radius:5px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-buffered{background-color:hsla(0,0%,71%,.7);position:absolute;height:2px;border-top-left-radius:5px;border-bottom-left-radius:5px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:width .15s,-webkit-transform;transition:transform,width .15s;transition:transform,width .15s,-webkit-transform}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-prompt{position:absolute;height:2px;width:9px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;z-index:6}.m-player .mplayer-footer .progress .progress-container .touch-effective .progress-seekline{position:absolute;background-color:#ddd;height:2px;width:3px;top:50%;-webkit-transform:scaleY(.9) translateY(-50%);transform:scaleY(.9) translateY(-50%);transition:left 0s linear;z-index:5;visibility:hidden}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container{position:absolute;height:100%;width:100%}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag{height:30px;width:30px;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;z-index:7}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag.hover-scale,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag.hover-scale{-webkit-transform:translate(-50%,-50%) scale(1)!important;transform:translate(-50%,-50%) scale(1)!important}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag.default-scale,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag.default-scale{-webkit-transform:translate(-50%,-50%) scale(0);transform:translate(-50%,-50%) scale(0)}.m-player .mplayer-footer .progress .progress-container .touch-effective .ball-container .progress-drag .progress-ball,.m-player .mplayer-footer .progress .progress-container .touch-effective .prompts-container .progress-drag .progress-ball{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);height:17px;width:17px;border-radius:50%;display:inline-block;background:#fff}.m-player .mplayer-footer .progress .progress-begin{font-size:13px;min-width:40px;text-align:left}.m-player .mplayer-footer .progress .progress-long{font-size:13px;min-width:40px;text-align:right}.m-player .mplayer-footer .progress .left-part,.m-player .mplayer-footer .progress .right-part{display:flex;height:inherit}.m-player .mplayer-footer .progress .left-part .footer-control,.m-player .mplayer-footer .progress .right-part .footer-control{position:relative}.m-player .mplayer-footer .progress .left-part .footer-control:not(.no-active):active,.m-player .mplayer-footer .progress .right-part .footer-control:not(.no-active):active{opacity:.75}.m-player .mplayer-footer .progress .left-part .footer-control svg,.m-player .mplayer-footer .progress .right-part .footer-control svg{vertical-align:middle}.m-player .mplayer-footer .progress .panel-controls{position:absolute;min-height:50px;bottom:50px;padding:12px;background-color:rgba(0,0,0,.6);border-radius:3px}.m-player .mplayer-footer .progress .live-mode{color:#fff;position:relative;font-size:14px;width:auto;white-space:nowrap}.m-player .mplayer-footer .progress .live-mode .spot{width:6px;height:6px;border-radius:50%;background:#1e98d4;margin-right:5px;display:inline-block;vertical-align:middle}.m-player .mplayer-footer .progress .live-mode .mode-text{display:inline-block;vertical-align:middle}.m-player .mplayer-header{background:linear-gradient(180deg,rgba(0,0,0,.5),hsla(0,0%,100%,0));padding:0 10px;height:60px;position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;-webkit-transform:translateY(-50px);transform:translateY(-50px);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;z-index:7}.m-player .mplayer-header.show{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}.m-player .mplayer-header .title-groupt{height:100%}.m-player .mplayer-header .title-groupt .back-button{white-space:nowrap;width:auto}.m-player .mplayer-header .title-groupt .back-button div,.m-player .mplayer-header .title-groupt .back-button svg{vertical-align:middle}.m-player .mplayer-header .title-groupt .back-button .title-name{position:relative;color:#fff;margin-left:5px;display:inline-block}.m-player .mplayer-header .buttom-group{display:flex;height:100%}.m-player .mplayer-header .buttom-group .battery-info{display:flex;flex-direction:column;align-items:center;justify-content:center;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:right;transform-origin:right}.m-player .mplayer-header .buttom-group .battery-info .time{color:#fff;font-size:14px;position:relative;top:4px;right:0}.m-player .mplayer-header .buttom-group .battery-info .capacity{border:1px solid #fff;height:11px;width:24px;border-radius:2px;position:relative}.m-player .mplayer-header .buttom-group .battery-info .capacity:after{content:"";height:7px;width:2px;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);border-right:none;border-top-left-radius:3px;border-bottom-left-radius:3px;left:-3px;background:#fff}.m-player .mplayer-header .buttom-group .battery-info .capacity .level{position:absolute;top:1px;bottom:1px;left:1px;right:1px}.m-player .mplayer-header .buttom-group .battery-info .capacity .level .count{background:#fff;height:100%;width:0;float:right;border-top-right-radius:1px;border-bottom-right-radius:1px}.m-player .mplayer-sidebar{display:block;position:absolute;top:0;bottom:0;right:0;background-color:rgba(0,0,0,.75);z-index:8;-webkit-transform:translateX(100%);transform:translateX(100%);transition:-webkit-transform .4s ease;transition:transform .4s ease;transition:transform .4s ease,-webkit-transform .4s ease;overflow:auto}.m-player .mplayer-sidebar.open{-webkit-transform:none!important;transform:none!important}.m-player .mplayer-sidebar::-webkit-scrollbar{width:4px;background:transparent}.m-player .mplayer-sidebar::-webkit-scrollbar-thumb{background:rgba(230,230,250,.24);border-radius:3px;height:100px}.m-player .mplayer-sidebar .title{color:#9a9e98;font-size:15px;line-height:40px;position:relative;margin-left:20px;margin-right:50px;text-align:left}.m-player .mplayer-sidebar .title:before{content:"";border-bottom:1px solid hsla(0,0%,87%,.3);position:absolute;left:0;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.m-player .mplayer-sidebar .setting-box{font-size:15px;color:#fff;display:flex;flex-wrap:wrap;align-items:center;margin:15px 50px 20px 20px}.m-player .mplayer-sidebar .setting-box .box-name{margin-left:12px;flex:1;text-align:left}.m-player .mplayer-sidebar .setting-box .toogle-switch{margin-left:12px;cursor:pointer;border-radius:50px;width:45px;height:22px;position:relative;transition:background-color .2s ease-in}.m-player .mplayer-sidebar .setting-box .toogle-switch.open .ball{right:3px}.m-player .mplayer-sidebar .setting-box .toogle-switch.close{background-color:hsla(0,0%,100%,.3)!important}.m-player .mplayer-sidebar .setting-box .toogle-switch.close .ball{right:24px}.m-player .mplayer-sidebar .setting-box .toogle-switch .ball{border-radius:50px;height:18px;width:18px;border-radius:50%;background:#fff;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);transition:right .2s ease-in}.m-player .mplayer-sidebar .setting-box .toogle-switch .disable{position:absolute;top:0;bottom:0;right:0;left:0;border-radius:50px;background:rgba(0,0,0,.6)}.m-player .mplayer-sidebar .setting-box .play-speed{cursor:pointer;font-size:16px;height:35px;width:48px;display:flex;justify-content:center;align-items:center;border-radius:5px;margin-right:4px;flex-shrink:0}.m-player .mplayer-sidebar .setting-box .share-box{cursor:pointer;height:45px;width:45px;display:flex;justify-content:center;align-items:center;margin-right:22px;margin-bottom:12px;flex-shrink:0}.m-player .mp-tooltip{position:absolute;font-size:12px;white-space:nowrap;background-color:rgba(0,0,0,.73);padding:3px 10px;display:block;color:#fff;z-index:9;border-radius:3px;pointer-events:none}.m-player .player-btn{position:relative;cursor:pointer;border:none;background-color:initial;padding:0;padding:0 11px;outline:0;width:45px;min-width:45px;height:inherit;font-size:14px}.m-player .player-btn:focus{outline:none}.m-player .player-btn::-moz-focus-inner{border:0;outline:0}.m-player .mplayer-poster{position:absolute;top:0;bottom:0;left:0;right:0;background:#000}.m-player .mplayer-poster:before{content:"";position:absolute;top:0;bottom:0;left:0;right:0;background:rgba(0,0,0,.4)}.m-player .mplayer-cover{position:absolute;top:0;bottom:0;left:0;right:0;background:#000;z-index:8;opacity:0;transition:opacity .2s;pointer-events:none}.m-player .mplayer-time{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:8;opacity:0}.m-player .mplayer-time .time{color:#fff;font-size:26px;text-align:center;white-space:nowrap}.m-player .mplayer-time .time-progress{margin:auto;height:3px;background:hsla(0,0%,100%,.6);width:180px;border-radius:50px;margin-top:9px;overflow:hidden}.m-player .mplayer-time .time-progress .time-total{background:#fff;height:100%;width:50%;border-top-left-radius:50px;border-bottom-left-radius:50px}.m-player .small-control{height:32px;position:absolute;width:143px;top:15%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border-radius:50px;background-color:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;opacity:0;z-index:7}.m-player .small-control .progress{border-radius:50px;overflow:hidden;height:3px;width:96px;background:hsla(0,0%,87%,.85);margin-left:6px}.m-player .small-control .progress .total{width:50%;height:100%;background:#fff}.m-player .mplayer-loading{color:#1e98d4;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:100%;max-height:100%;display:none;z-index:8}@-webkit-keyframes mp-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mp-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes mp-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}to{stroke-dasharray:90,150;stroke-dashoffset:-120}}@keyframes mp-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}to{stroke-dasharray:90,150;stroke-dashoffset:-120}}.m-player .mplayer-loading .mplayer-loading__circular{width:40px;height:40px;-webkit-animation:mp-rotate 1.8s linear infinite;animation:mp-rotate 1.8s linear infinite}.m-player .mplayer-loading .mplayer-loading__circular circle{-webkit-animation:mp-circular 1.5s ease-in-out infinite;animation:mp-circular 1.5s ease-in-out infinite;stroke:currentColor;stroke-width:3;stroke-linecap:round}.m-player .mplayer-toast{padding:7px 12px;background-color:rgba(80,80,77,.9);position:absolute;bottom:18%;color:#fff;border-radius:50px;font-size:14px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);-webkit-animation:mplayerToast .25s;animation:mplayerToast .25s;z-index:10}@-webkit-keyframes mplayerToast{0%{bottom:-18%}to{bottom:18%}}@keyframes mplayerToast{0%{bottom:-18%}to{bottom:18%}}.m-player .mplayer-left{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);transition:left .3s;opacity:0;z-index:7}.m-player .mplayer-left ._unlock,.m-player .mplayer-left .control-icon ._lock{height:38px;width:38px;border-radius:50%;background-color:rgba(0,0,0,.3);display:flex;justify-content:center;align-items:center;cursor:pointer}.m-player .mplayer-error{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff;z-index:10;font-size:13px;text-align:center;display:none;opacity:1;-webkit-animation:mplayerError .7s;animation:mplayerError .7s}@-webkit-keyframes mplayerError{0%{opacity:0}to{opacity:1}}@keyframes mplayerError{0%{opacity:0}to{opacity:1}}.m-player .mplayer-error .errop-tip{height:25px}.m-player .mplayer-error:active{opacity:.75}.m-player .mini-progress{height:2px;position:absolute;bottom:0;left:0;right:0;-webkit-transform:translateY(.3px);transform:translateY(.3px);opacity:0;z-index:7}.m-player .mini-progress .mini-total{position:absolute;background-color:hsla(0,0%,100%,.2);width:100%;height:100%}.m-player .mini-progress .mini-buffered{position:absolute;background-color:hsla(0,0%,71%,.5);height:100%}.m-player .mini-progress .mini-play{position:absolute;height:100%}@-webkit-keyframes mp-bezel-fadeout{0%{opacity:1}to{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}}@keyframes mp-bezel-fadeout{0%{opacity:1}to{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}}.m-player .mp-bezel-text-hide .mp-bezel{z-index:10;position:absolute;left:50%;top:50%;width:52px;height:52px;margin-left:-26px;margin-top:-26px;background:rgba(0,0,0,.6);border-radius:26px;-webkit-animation:mp-bezel-fadeout .4s linear 1 normal forwards;animation:mp-bezel-fadeout .4s linear 1 normal forwards;pointer-events:none}.m-player .mp-bezel-text-hide .mp-bezel .mp-bezel-icon{width:24px;height:24px;margin:14px}.m-player .mp-bezel-text-hide .mp-bezel .mp-bezel-icon .mp-svg-shadow{stroke:#000;stroke-opacity:.15;stroke-width:2px;fill:none}.m-player .ctxmenu-wrapper{position:absolute;top:0;bottom:0;left:0;right:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:none}.m-player .ctxmenu-wrapper .ctxmenulist{text-align:left;position:absolute;list-style:none;font-size:14px;background:rgba(28,28,28,.9);text-shadow:0 0 2px rgba(0,0,0,.5);color:#eee;border-radius:2px;margin:0;padding:0;min-width:170px;transition:opacity .1s;opacity:0;outline:0;z-index:9}.m-player .ctxmenu-wrapper .ctxmenulist li{padding:9px 30px;cursor:pointer}.m-player .ctxmenu-wrapper .ctxmenulist li:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.m-player .ctxmenu-wrapper .ctxmenulist li:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.m-player .ctxmenu-wrapper .ctxmenulist li:hover{background-color:hsla(0,0%,100%,.1)}.m-player .mplayer-shortcut{text-align:left;font-size:16px;background:rgba(28,28,28,.9);text-shadow:0 0 2px rgba(0,0,0,.5);color:#eee;border-radius:3px;padding:15px 0 15px 20px;position:absolute;top:10px;left:10px;z-index:8;display:none;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;width:430px;max-width:calc(100% - 40px)}.m-player .mplayer-shortcut .title{margin:0;padding-bottom:10px}.m-player .mplayer-shortcut .close-shortcut-panel{position:absolute;top:15px;right:15px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:24px;height:24px}.m-player .mplayer-shortcut .close-shortcut-panel:active{opacity:.8}.m-player .mplayer-shortcut ul{list-style:none;margin:0 0 2px;padding:0;font-size:14px}.m-player .mplayer-shortcut ul li{display:inline-block;height:28px;line-height:28px;width:50%}.m-player .mplayer-shortcut ul li span{color:#999}.m-player .mp-popup-animation{transition:all .25s cubic-bezier(0,0,.2,1)}.m-player .popup-toggle{transition:opacity .1s cubic-bezier(0,0,.2,1)!important}.m-player .mp-popup{border-radius:2px;overflow:hidden;position:absolute;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:width,height;background:rgba(28,28,28,.9);opacity:0;min-width:42px}.m-player .mp-popup .mp-panel{min-width:260px}.m-player .mp-popup .mp-panel.mp-panel-child .mp-menuitem{padding-left:14.5%}.m-player .mp-popup .mp-panel.mp-panel-item{position:absolute;bottom:0;right:0;overflow-y:auto;overflow-x:hidden}.m-player .mp-popup .mp-panel.mp-panel-item::-webkit-scrollbar{width:8px;background-color:#424242}.m-player .mp-popup .mp-panel.mp-panel-item::-webkit-scrollbar-thumb{background-color:#8e8e8e;border:1px solid #424242;border-radius:3px}.m-player .mp-popup .mp-panel.mp-panel-item::-webkit-scrollbar-track{background-color:#424242}.m-player .mp-popup .mp-panel.mp-panel-item .mp-panel-selected{background-size:8%;background-repeat:no-repeat;background-position:4%;vertical-align:middle;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTkgMTYuMkw0LjggMTJsLTEuNCAxLjRMOSAxOSAyMSA3bC0xLjQtMS40TDkgMTYuMnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.m-player .mp-popup .mp-panel.mp-panel-item .mp-panel-header{height:50px;padding-left:0;line-height:50px}.m-player .mp-popup .mp-panel.mp-panel-item .mp-panel-header:before{content:"";position:absolute;border-bottom:1px solid #fff;left:0;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);opacity:.2;z-index:100}.m-player .mp-popup .mp-panel .mp-menuitem{position:relative;list-style:none;color:#eee;margin:0;padding:0;display:flex;justify-content:space-between;align-items:center;padding-left:10%;height:40px;line-height:40px;white-space:nowrap;outline:none}.m-player .mp-popup .mp-panel .mp-menuitem:not(.mp-panel-header){cursor:pointer}.m-player .mp-popup .mp-panel .mp-menuitem:not(.mp-panel-header):hover{background-color:hsla(0,0%,100%,.1)}.m-player .mp-popup .mp-panel .mp-menuitem li{height:inherit;width:50%}.m-player .mp-popup .mp-panel .mp-menuitem li:first-child{padding-right:40px;white-space:pre;overflow:hidden;text-overflow:ellipsis;text-align:left}.m-player .mp-popup .mp-panel .mp-menuitem li:last-child{text-align:right}.m-player .mp-popup .mp-panel .mp-menuitem li .mp-menuitem-content{height:inherit}.m-player .mp-popup .mp-panel .mp-menuitem li .arrow-icon{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTEyLjU5IDIwLjM0bDQuNTgtNC41OS00LjU4LTQuNTlMMTQgOS43NWw2IDYtNiA2eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==);background-size:35%;background-repeat:no-repeat;background-position:100%;vertical-align:middle;padding-right:35%}.m-player .mp-popup .mp-panel .mp-menuitem li .left-arrow-icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTTE5LjQxIDIwLjA5bC00LjU4LTQuNTkgNC41OC00LjU5TDE4IDkuNWwtNiA2IDYgNnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=);background-repeat:no-repeat;background-position:0;background-size:30%;padding-left:30%;text-align:left;cursor:pointer}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch{cursor:pointer;border-radius:50px;width:41px;height:20px;position:relative;display:inline-block;transition:background-color .2s ease-in;vertical-align:middle;right:13%}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch.close{background-color:hsla(0,0%,100%,.3)!important}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch.open .ball{right:4.83%}.m-player .mp-popup .mp-panel .mp-menuitem li .toogle-switch .ball{border-radius:50px;height:16px;width:16px;border-radius:50%;background:#fff;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);transition:right .15s ease-in;right:56.46%}.m-player .volume-container{width:100%;height:100%;border-radius:2px;color:#fff;text-align:center;outline:0;font-size:12px;padding-top:8px;padding-bottom:8px}.m-player .volume-container .volume-size{color:#fff}.m-player .volume-container .volume-capacity{cursor:pointer;height:100px;width:4px;background-color:#373838;border-radius:7px;margin:25% auto 0;position:relative}.m-player .volume-container .volume-capacity .volume-drag-ball{background-color:#fff;width:14px;height:14px;border-radius:50%;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:0;z-index:7}.m-player .volume-container .volume-capacity .progress-bar{border-radius:7px;position:absolute;bottom:0;left:0;right:0;height:0}.m-player .danmaku-controls{display:flex;flex-direction:row;align-items:center;font-size:12px;flex:0.65;margin:auto .82%}.m-player .danmaku-controls .dms-button:active{cursor:pointer;opacity:.85}.m-player .danmaku-controls .danmaku-input-wrap{position:relative;width:auto;height:34px;background-color:#111226;flex:1;flex-shrink:0;border-radius:50px;background:hsla(0,0%,100%,.25);color:#fff;margin-left:1.2%;display:flex}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text{height:100%;border:0;left:0;border-radius:50px 0 0 50px;flex:1;padding:0;margin:0;outline:0;background-color:initial;padding:0 12px;color:#fff;font-size:14px;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::-webkit-input-placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::-moz-placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::-ms-input-placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-input-text::placeholder{color:#ddd;text-shadow:0 0 4px rgba(0,0,0,.75)}.m-player .danmaku-controls .danmaku-input-wrap .dms-btn-submit{top:0;right:0;width:66px;height:100%;border:none;border-radius:0 50px 50px 0;outline:0;background-color:#292a3c;color:#eee;cursor:pointer;margin-left:8px;position:relative}.m-player .danmaku-controls .danmaku-input-wrap .dms-btn-submit span{display:inline-block;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.m-player .mp-rolling{position:absolute;top:0;width:100%;color:#fff;overflow:hidden;z-index:6;-webkit-transform-origin:right;transform-origin:right}.m-player .mp-rolling .rolling-content{position:relative;white-space:nowrap;display:inline-block}.m-player .mp-logot-box{position:absolute;width:100%;height:100%;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);pointer-events:none;z-index:6}@-webkit-keyframes mp-logot-show{0%{opacity:.1}to{opacity:1}}@keyframes mp-logot-show{0%{opacity:.1}to{opacity:1}}.m-player .mp-logot-box .mp-logot{position:absolute;background-repeat:no-repeat;background-size:contain;opacity:0;-webkit-animation:mp-logot-show .35s linear both;animation:mp-logot-show .35s linear both;image-rendering:-moz-crisp-edges;image-rendering:-o-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;-ms-interpolation-mode:nearest-neighbor}.m-player .mp-logot-box .mp-logot.logot-top-right{right:1.5%;top:3%;-webkit-transform-origin:top right;transform-origin:top right}.m-player .mp-logot-box .mp-logot.logot-top-left{left:1.5%;top:3%;-webkit-transform-origin:top left;transform-origin:top left}.m-player .mp-logot-box .mp-logot.logot-bottom-left{left:1.5%;bottom:3%;-webkit-transform-origin:bottom left;transform-origin:bottom left}.m-player .mp-logot-box .mp-logot.logot-bottom-right{right:1.5%;bottom:3%;-webkit-transform-origin:bottom right;transform-origin:bottom right}.m-player .advertise-wrap{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:7;width:320px;height:240px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;overflow:hidden;background:rgba(0,0,0,.65);max-height:calc(100% - 40px);max-width:calc(100% - 40px);box-shadow:0 2px 5px 0 rgba(0,0,0,.16)}.m-player .advertise-wrap .ad-tip{position:absolute;bottom:3px;left:3px;display:inline-block;cursor:auto;height:20px;margin:0 2px 0 0;padding:0 4px;line-height:20px;font-size:12px;color:#fff;background:rgba(0,0,0,.5);border-radius:2px}.m-player .advertise-wrap .ad-close{position:absolute;right:4px;top:4px;cursor:pointer}.m-player .advertise-wrap .ad-close .ad-icon{width:18px;height:18px;padding:3px;border-radius:100%;vertical-align:middle;background:rgba(0,0,0,.5)}.m-player .advertise-wrap .ad-close .ad-icon path{transition:fill .3s}.m-player:-webkit-full-screen{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;box-sizing:border-box!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;width:100%!important;height:100%!important;-webkit-transform:none!important;transform:none!important;margin:0!important;padding:0!important;z-index:1000!important}.m-player:-webkit-full-screen uni-video{position:relative}.m-player.browser-fullscreen{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;box-sizing:border-box!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;width:100%!important;height:100%!important;-webkit-transform:none!important;transform:none!important;margin:0!important;padding:0!important;z-index:1000!important}.m-player.browser-fullscreen uni-video{position:relative}.m-player.page-fullscreen{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;box-sizing:border-box!important;min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;width:100%!important;height:100%!important;-webkit-transform:none!important;transform:none!important;margin:0!important;padding:0!important;z-index:1000!important}.m-player.page-fullscreen uni-video{position:relative}.m-player.mp-keyboard-focus .keyboard-input:focus,.m-player.mp-keyboard-focus .mp-menuitem:focus{box-shadow:inset 0 0 0 2px rgba(27,127,204,.8)}.m-player .player-wrapper{height:100%;width:100%;position:relative}.m-player .player-wrapper.mplayer-miniwindow{position:fixed;transition-property:width,height,opacity,bottom,right,border-radius;will-change:bottom,right,border-radius;overflow:hidden;z-index:1000;border-radius:0;opacity:1;background:#000;box-shadow:0 2px 5px 0 rgba(0,0,0,.16)}.m-player .player-wrapper.mplayer-miniwindow.transition-disable{transition-property:none;cursor:move}.m-player .player-wrapper.mplayer-miniwindow .element-hidden,.m-player .player-wrapper.mplayer-miniwindow .mp-popup{visibility:hidden}.m-player .player-wrapper.mplayer-miniwindow uni-video{width:100%!important;height:100%!important}.m-player .player-wrapper.mplayer-miniwindow .scrim-layer{position:absolute;height:100%;width:100%;top:0;z-index:7;background-color:initial;transition-property:background-color;transition-duration:.08s;transition-timing-function:linear}.m-player .player-wrapper .video-wrapper{height:100%;display:flex;justify-content:center;align-items:center}.m-player .player-wrapper .video-wrapper uni-video{-o-object-fit:contain;object-fit:contain;display:block;opacity:0}.m-player .player-wrapper .video-wrapper uni-video.covered{height:100%!important;width:100%!important;-o-object-fit:cover;object-fit:cover}.m-player .player-wrapper .video-wrapper uni-video::cue{color:#fff;background:transparent;text-shadow:0 0 1px #000}.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-text-track-display{margin-top:-5px}.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-controls-overlay-play-button,.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-controls-start-playback-button,.m-player .player-wrapper .video-wrapper uni-video::-webkit-media-controls-volume-slider,.m-player .player-wrapper .video-wrapper uni-video uni-video::-webkit-media-controls-mute-button{display:none}',""]),e.exports=t},bf15:function(module,exports,__webpack_require__){"use strict";(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__; -/*! -* Mui Player Javascript Library v1.8.1 @Professional edition -* Date:2023-01-28 -* Released under GPL-3.0 license -* https://muiplayer.js.org/ -*/function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0;t=function(){};return{s:t,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,n=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return n=e.done,e},e:function(e){a=!0,s=e},f:function(){try{n||null==r.return||r.return()}finally{if(a)throw s}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r',mplayerPoster:'
',mplayerCover:'\x3c!-- 媒体播放遮罩层 --\x3e
',mplayerLoading:'\x3c!-- Mplayer加载Loading --\x3e
',mplayerError:'\x3c!-- 视频加载错误显示 --\x3e
视频加载失败,点击刷新
',mplayerHeader:'\x3c!-- Mplayer 顶部导航 --\x3e
',mplayerFooter:'\x3c!-- Mplayer 底部操作控件 --\x3e',miniProgress:'\x3c!-- Mplayer 底部播放迷你进度条 --\x3e
\x3c!--加载进度条总长--\x3e
\x3c!--资源缓存进度--\x3e
\x3c!--播放进度--\x3e
'},$global=function(){return{first_authplay:!1,isReady:!1,webpagePlugin:{},mobilePlugin:{},cssAutoprefixer:["webkit","ms","moz","o"]}},element=function(){return{mPlayer:con,videoObject:con.querySelector("video"),mplayerCover:con.querySelector("#mplayer-cover"),mplayerPoster:con.querySelector("#mplayer-poster"),mplayerHeader:con.querySelector("#mplayer-header"),headerMenu:con.querySelector("#buttom-group"),backButton:con.querySelector("#back-button"),mplayerFooter:con.querySelector("#mplayer-footer"),progressContainer:con.querySelector("#progress-container"),playSwitch:con.querySelector("#play-switch"),fullSwitch:con.querySelector("#full-switch"),progressBall:con.querySelector("#progress-ball"),progressBegin:con.querySelector("#progress-begin"),progressLong:con.querySelector("#progress-long"),touchEffective:con.querySelector("#touch-effective"),progressBuffered:con.querySelector("#progress-buffered"),progressPlay:con.querySelector("#progress-play"),miniProgress:con.querySelector("#mini-progress"),miniBuffered:con.querySelector("#mini-buffered"),miniPlay:con.querySelector("#mini-play"),mplayerLoading:con.querySelector("#mplayer-loading"),mplayerError:con.querySelector("#mplayer-error")}},$el=new element,variable=function(){return{mediaPlayDirectives:0,isFullScreen:!1,showScreenControls:!1,ball_move_status:!1,isPlay:!1,mediaStatus:!1,duration:0,percentage:0,currentTime:0,playError:0,isDestroy:!1,isShowRightSidebar:!1,startX:null,startY:null,moveX:null,moveY:null,_defaultPlayProgressPro:null,isTouchMove:!1,isControlsTimer:!0}},$data=new variable,$method={getLanguageText:function(){return{"zh-cn":{srcNull:"视频地址为空",begin:"开始",end:"结束",live:"直播",settings:"设置",coveredPlay:"铺满播放",loopPlay:"循环播放",playbackSpeed:"播放速度",share:"分享",pictureInPicture:"画中画",exitPictureInPicture:"退出画中画",pageScreen:"网页全屏",exitPageScreen:"退出网页全屏",fullScreen:"全屏",exitFullScreen:"退出全屏",normal:"正常",open:"打开",subtitles:"字幕",selectLangage:"选择语言",dsps:"切换到默认倍速度播放",tsps:"切换到?倍速度播放",errorTip:"视频加载失败,点击刷新",shortcuts:"快捷键",shortcutsPanel:{title:"快捷功能",space:"空格",spaceAction:"播放/暂停",esc:"退出全屏",up:"音量增加5%",down:"音量减少5%",right:"快进5秒",left:"快退5秒"},advertise:"广告"},en:{srcNull:"Video address is empty",begin:"Begin",end:"End",live:"Live",settings:"Settings",coveredPlay:"Covered play",loopPlay:"Loop play",playbackSpeed:"Playback speed",share:"Share",pictureInPicture:"Picture in picture",exitPictureInPicture:"Exit picture in picture",pageScreen:"Page screen",exitPageScreen:"Exit page screen",fullScreen:"Full screen",exitFullScreen:"Exit full screen",normal:"Normal",open:"Open",subtitles:"Subtitles",selectLangage:"Select langage",dsps:"to default speed playback",tsps:"to ?x speed playback",errorTip:"Video failed to load, click refresh",shortcuts:"Shortcuts",shortcutsPanel:{title:"Shortcuts function",space:"Space",spaceAction:"play/pause",esc:"exit full screen",up:"voice increase 5%",down:"voice reduce 5%",right:"fast forward 5 seconds",left:"fast backward 5 seconds"},advertise:"Advertise"},"zh-tw":{srcNull:"視頻地址為空",begin:"開始",end:"結束",live:"直播",settings:"設置",coveredPlay:"鋪滿播放",loopPlay:"循環播放",playbackSpeed:"播放速度",share:"分享",pictureInPicture:"畫中畫",exitPictureInPicture:"退出畫中畫",pageScreen:"網頁全屏",exitPageScreen:"退出網頁全屏",fullScreen:"全屏",exitFullScreen:"退出全屏",normal:"正常",open:"打開",subtitles:"字幕",selectLangage:"選擇語言",dsps:"切換到默認倍速度播放",tsps:"切換到?倍速度播放",errorTip:"視頻加載失敗,點擊刷新",shortcuts:"快捷鍵",shortcutsPanel:{title:"快捷功能",space:"空格",spaceAction:"播放/暫停",esc:"退出全屏",up:"音量增加5%",down:"音量减少5%",right:"快進5秒",left:"快退5秒"},advertise:"廣告"}}},getLangObject:function(){var e=option.lang||navigator.language||navigator.browserLanguage||"zh-cn";return-1!=["zh-cn","en","zh-tw"].indexOf(e.toLowerCase())?$method.getLanguageText()[e.toLowerCase()]:$method.getLanguageText()["zh-cn"]},initCreateMplayer:function(e){for(var t=$node.video+$node.mplayerPoster+$node.mplayerCover+$node.mplayerLoading+$node.mplayerError+$node.mplayerHeader+$node.mplayerFooter+$node.miniProgress,r=(t=$node.logWrite?t+$node.logWrite:t,0);r/g,""),t=$method.createRangeIsDocFragment(t),t=$method.initConifgAttribute(t,e),t=$method.initConfigControl(t),t=$method.initConfigCustom(t),t=$method.initConfigTheme(t),e={option:option,_this:_this,$el:element,$data:$data,$method:$method,$habit:$habit,$CONSTANT:$CONSTANT},mobilePlugin&&(t=mobilePlugin.appendTemplate(t,e)),webpagePlugin&&(t=webpagePlugin.appendTemplate(t,e)),e=con.querySelector("#mplayer-media-wrapper"),e&&$method.removeNode(con,"#mplayer-media-wrapper"),(e=document.createElement("div")).setAttribute("id","mplayer-media-wrapper"),e.setAttribute("class","player-wrapper"),e.appendChild(t),$el.mPlayer.appendChild(e),option.src?($method.playerReady(),setTimeout((function(){_this._global_.isReady=!0,_this.emit("ready"),setTimeout((function(){$method.onScreenResize({type:"showControls"}),$method.removeOriginControls()}),10)}),100)):$method.showToast($method.getLangObject().srcNull)},onAction:function(){},removeOriginControls:function(){$el.videoObject.removeAttribute("controls")},playerReady:function(){$method.resetVariable(),!0===option.autoplay&&($data.mediaPlayDirectives=1,$method.onPlay()),$method.toggleEventListenerGlobal("add","playerReady"),$method.toggleEventListenerCustom("add"),$method.nodesObserver()},overloadingEl:function(){$el=new element;for(var e=0,t=Object.keys($el);es.toFixed(2)?(a.videoWidth=r.toFixed(),a.videoHeight=(r*s).toFixed()):(n.toFixed(2)$data.currentTime){r=r/$data.duration*100,$el.progressBuffered.style.width=r+"%",$el.miniBuffered.style.width=r+"%";break}}}},showLoading:function(){"inline-block"!=$el.mplayerLoading.style.display&&($el.mplayerLoading.style.display="inline-block")},hideLoading:function(){"none"!=$el.mplayerLoading.style.display&&($el.mplayerLoading.style.display="none")},showCover:function(){$el.mplayerCover.style.opacity<=0&&($el.mplayerCover.style.zIndex=8,$el.mplayerCover.style.opacity=.2)},hideCover:function(){"0"!=$el.mplayerCover.style.opacity&&($el.mplayerCover.style.opacity=0,$el.mplayerCover.style.zIndex=-1)},showToast:function(){var e=0=0;i--){var s=e[i];"."===s?e.splice(i,1):".."===s?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function i(e){"string"!==typeof e&&(e+="");var t,r=0,i=-1,s=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!s){r=t+1;break}}else-1===i&&(s=!1,i=t+1);return-1===i?"":e.slice(r,i)}function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;i=-1&&!i;n--){var a=n>=0?arguments[n]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=r(s(t.split("/"),(function(e){return!!e})),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===n(e,-1);return e=r(s(e.split("/"),(function(e){return!!e})),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(s(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function i(e){for(var t=0;t=0;r--)if(""!==e[r])break;return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var s=i(e.split("/")),n=i(r.split("/")),a=Math.min(s.length,n.length),o=a,l=0;l=1;--n)if(t=e.charCodeAt(n),47===t){if(!s){i=n;break}}else s=!1;return-1===i?r?"/":".":r&&1===i?"/":e.slice(0,i)},t.basename=function(e,t){var r=i(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,r=0,i=-1,s=!0,n=0,a=e.length-1;a>=0;--a){var o=e.charCodeAt(a);if(47!==o)-1===i&&(s=!1,i=a+1),46===o?-1===t?t=a:1!==n&&(n=1):-1!==t&&(n=-1);else if(!s){r=a+1;break}}return-1===t||-1===i||0===n||1===n&&t===i-1&&t===r+1?"":e.slice(t,i)};var n="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r("4362"))},e2e5:function(e,t,r){"use strict";r("7a82");var i=r("ee27").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r("3315");var s=i(r("bf15")),n=i(r("fc78")),a=i(r("a567"));t.default={props:{url:{type:String,default:null},type:{type:String}},mounted:function(){this.videoPlayer()},methods:{videoPlayer:function(){var e=this,t={};t="m3u8"==this.type?{type:"hls",loader:a.default,config:{debug:!1}}:{type:"flv",loader:n.default,config:{debug:!1}},this.mp=new s.default({container:this.$refs.muiPlayer,live:!0,src:this.url,autoplay:!0,muted:!0,parse:t,pageHead:!1,width:"100%",height:"100%",autoFit:!1,objectFit:"contain",videoAttribute:[{attrKey:"webkit-playsinline",attrValue:"webkit-playsinline"},{attrKey:"playsinline",attrValue:"playsinline"},{attrKey:"x5-video-player-type",attrValue:"h5-page"}],custom:{footerControls:[{style:{}}]}});var r=this.mp.video();this.$nextTick((function(){e.mp.on("ready",(function(t){r.play(),r.addEventListener("play",(function(t){e.$emit("onPlayFn")})),r.addEventListener("ended",(function(t){e.$emit("onEndedFn")}))}))}))}}}},e52e:function(e,t,r){"use strict";r.r(t);var i=r("d4f0"),s=r.n(i);for(var n in i)["default"].indexOf(n)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(n);t["default"]=s.a},fc78:function(e,t,r){(function(t){(function(t,r){e.exports=r()})(self,(function(){return function(){var e={"./node_modules/es6-promise/dist/es6-promise.js": -/*!******************************************************!*\ - !*** ./node_modules/es6-promise/dist/es6-promise.js ***! - \******************************************************/function(e,r,i){ -/*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ -(function(t,r){e.exports=r()})(0,(function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function r(e){return"function"===typeof e}var s=void 0;s=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var n=s,a=0,o=void 0,l=void 0,d=function(e,t){T[a]=e,T[a+1]=t,a+=2,2===a&&(l?l(S):A())};function h(e){l=e}function c(e){d=e}var u="undefined"!==typeof window?window:void 0,f=u||{},p=f.MutationObserver||f.WebKitMutationObserver,m="undefined"===typeof self&&"undefined"!==typeof t&&"[object process]"==={}.toString.call(t),g="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel;function y(){return function(){return t.nextTick(S)}}function v(){return"undefined"!==typeof o?function(){o(S)}:b()}function _(){var e=0,t=new p(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function E(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var T=new Array(1e3);function S(){for(var e=0;e0&&o.length>n&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,s(h)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=c.bind(i);return s.listener=r,i.wrapFn=s,s}function f(e,t,r){var i=e._events;if(void 0===i)return[];var s=i[t];return void 0===s?[]:"function"===typeof s?r?[s.listener||s]:[s]:r?y(s):m(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),i=0;i0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=n[e];if(void 0===l)return!1;if("function"===typeof l)i(l,this,t);else{var d=l.length,h=m(l,d);for(r=0;r=0;n--)if(r[n]===t||r[n].listener===t){a=r[n].listener,s=n;break}if(s<0)return this;0===s?r.shift():g(r,s),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,n=Object.keys(r);for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},"./node_modules/webworkify-webpack/index.js": -/*!**************************************************!*\ - !*** ./node_modules/webworkify-webpack/index.js ***! - \**************************************************/function(e,t,r){function i(e){var t={};function r(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var i=r(r.s=ENTRY_MODULE);return i.default||i}var s="[\\.|\\-|\\+|\\w|/|@]+",n="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+s+").*?\\)";function a(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function o(e){return!isNaN(1*e)}function l(e,t,i){var l={};l[i]=[];var d=t.toString(),h=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return l;var c,u=h[1],f=new RegExp("(\\\\n|\\W)"+a(u)+n,"g");while(c=f.exec(d))"dll-reference"!==c[3]&&l[i].push(c[3]);f=new RegExp("\\("+a(u)+'\\("(dll-reference\\s('+s+'))"\\)\\)'+n,"g");while(c=f.exec(d))e[c[2]]||(l[i].push(c[1]),e[c[2]]=r(c[1]).m),l[c[2]]=l[c[2]]||[],l[c[2]].push(c[4]);for(var p=Object.keys(l),m=0;m0}),!1)}function h(e,t){var r={main:[t]},i={main:[]},s={main:{}};while(d(r))for(var n=Object.keys(r),a=0;a=e[s]&&t0&&e[0].originalDts=t[s].dts&&et[i].lastSample.originalDts&&e=t[i].lastSample.originalDts&&(i===t.length-1||i0&&(s=this._searchNearestSegmentBefore(r.originalBeginDts)+1),this._lastAppendLocation=s,this._list.splice(s,0,r)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){var t=this._searchNearestSegmentBefore(e),r=this._list[t].syncPoints;while(0===r.length&&t>0)t--,r=this._list[t].syncPoints;return r.length>0?r[r.length-1]:null},e}()},"./src/core/mse-controller.js": -/*!************************************!*\ - !*** ./src/core/mse-controller.js ***! - \************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! ../utils/logger.js */"./src/utils/logger.js"),a=r(/*! ../utils/browser.js */"./src/utils/browser.js"),o=r(/*! ./mse-events.js */"./src/core/mse-events.js"),l=r(/*! ./media-segment-info.js */"./src/core/media-segment-info.js"),d=r(/*! ../utils/exception.js */"./src/utils/exception.js"),h=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(s()),this._config.isLive&&void 0==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new l.IDRSampleList}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new d.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var r=this._pendingSegments[t];r.splice(0,r.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var i=this._sourceBuffers[t];if(i){if("closed"!==e.readyState){try{e.removeSourceBuffer(i)}catch(s){n.default.e(this.TAG,s.message)}i.removeEventListener("error",this.e.onSourceBufferError),i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(s){n.default.e(this.TAG,s.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var r=e,i=""+r.container;r.codec&&r.codec.length>0&&(i+=";codecs="+r.codec);var s=!1;if(n.default.v(this.TAG,"Received Initialization Segment, mimeType: "+i),this._lastInitSegments[r.type]=r,i!==this._mimeTypes[r.type]){if(this._mimeTypes[r.type])n.default.v(this.TAG,"Notice: "+r.type+" mimeType changed, origin: "+this._mimeTypes[r.type]+", target: "+i);else{s=!0;try{var l=this._sourceBuffers[r.type]=this._mediaSource.addSourceBuffer(i);l.addEventListener("error",this.e.onSourceBufferError),l.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(d){return n.default.e(this.TAG,d.message),void this._emitter.emit(o.default.ERROR,{code:d.code,msg:d.message})}}this._mimeTypes[r.type]=i}t||this._pendingSegments[r.type].push(r),s||this._sourceBuffers[r.type]&&!this._sourceBuffers[r.type].updating&&this._doAppendSegments(),a.default.safari&&"audio/mpeg"===r.container&&r.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=r.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var r=this._sourceBuffers[t.type];!r||r.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var r=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{r.abort()}catch(h){n.default.e(this.TAG,h.message)}this._idrList.clear();var i=this._pendingSegments[t];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var s=0;s=1&&e-i.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var r=this._sourceBuffers[t];if(r){for(var i=r.buffered,s=!1,n=0;n=this._config.autoCleanupMaxBackwardDuration){s=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:l})}}else o0&&(isNaN(t)||r>t)&&(n.default.v(this.TAG,"Update MediaSource duration from "+t+" to "+r),this._mediaSource.duration=r),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating){var t=this._sourceBuffers[e],r=this._pendingRemoveRanges[e];while(r.length&&!t.updating){var i=r.shift();t.remove(i.start,i.end)}}},e.prototype._doAppendSegments=function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var r=e[t].shift();if(r.timestampOffset){var i=this._sourceBuffers[t].timestampOffset,s=r.timestampOffset/1e3,a=Math.abs(i-s);a>.1&&(n.default.v(this.TAG,"Update MPEG audio timestampOffset from "+i+" to "+s),this._sourceBuffers[t].timestampOffset=s),delete r.timestampOffset}if(!r.data||0===r.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(r.data),this._isBufferFull=!1,"video"===t&&r.hasOwnProperty("info")&&this._idrList.appendArray(r.info.syncPoints)}catch(l){this._pendingSegments[t].unshift(r),22===l.code?(this._isBufferFull||this._emitter.emit(o.default.BUFFER_FULL),this._isBufferFull=!0):(n.default.e(this.TAG,l.message),this._emitter.emit(o.default.ERROR,{code:l.code,msg:l.message}))}}},e.prototype._onSourceOpen=function(){if(n.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){var e=this._pendingSourceBufferInit;while(e.length){var t=e.shift();this.appendInitSegment(t,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(o.default.SOURCE_OPEN)},e.prototype._onSourceEnded=function(){n.default.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){n.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(o.default.UPDATE_END)},e.prototype._onSourceBufferError=function(e){n.default.e(this.TAG,"SourceBuffer Error: "+e)},e}();t["default"]=h},"./src/core/mse-events.js": -/*!********************************!*\ - !*** ./src/core/mse-events.js ***! - \********************************/function(e,t,r){"use strict";r.r(t);var i={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};t["default"]=i},"./src/core/transmuxer.js": -/*!********************************!*\ - !*** ./src/core/transmuxer.js ***! - \********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),a=r.n(n),o=r(/*! ../utils/logger.js */"./src/utils/logger.js"),l=r(/*! ../utils/logging-control.js */"./src/utils/logging-control.js"),d=r(/*! ./transmuxing-controller.js */"./src/core/transmuxing-controller.js"),h=r(/*! ./transmuxing-events.js */"./src/core/transmuxing-events.js"),c=r(/*! ./media-info.js */"./src/core/media-info.js"),u=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(s()),t.enableWorker&&"undefined"!==typeof Worker)try{this._worker=a()(/*! ./transmuxing-worker */"./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},l.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:l.default.getConfig()})}catch(i){o.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new d.default(e,t)}else this._controller=new d.default(e,t);if(this._controller){var r=this._controller;r.on(h.default.IO_ERROR,this._onIOError.bind(this)),r.on(h.default.DEMUX_ERROR,this._onDemuxError.bind(this)),r.on(h.default.INIT_SEGMENT,this._onInitSegment.bind(this)),r.on(h.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),r.on(h.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),r.on(h.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),r.on(h.default.MEDIA_INFO,this._onMediaInfo.bind(this)),r.on(h.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),r.on(h.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),r.on(h.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),r.on(h.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),l.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},e.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},e.prototype.seek=function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)},e.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},e.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},e.prototype._onInitSegment=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(h.default.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(h.default.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var r=this;Promise.resolve().then((function(){r._emitter.emit(h.default.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(h.default.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,r=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case h.default.INIT_SEGMENT:case h.default.MEDIA_SEGMENT:this._emitter.emit(t.msg,r.type,r.data);break;case h.default.LOADING_COMPLETE:case h.default.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case h.default.MEDIA_INFO:Object.setPrototypeOf(r,c.default.prototype),this._emitter.emit(t.msg,r);break;case h.default.METADATA_ARRIVED:case h.default.SCRIPTDATA_ARRIVED:case h.default.STATISTICS_INFO:this._emitter.emit(t.msg,r);break;case h.default.IO_ERROR:case h.default.DEMUX_ERROR:this._emitter.emit(t.msg,r.type,r.info);break;case h.default.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,r);break;case"logcat_callback":o.default.emitter.emit("log",r.type,r.logcat);break;default:break}},e}();t["default"]=u},"./src/core/transmuxing-controller.js": -/*!********************************************!*\ - !*** ./src/core/transmuxing-controller.js ***! - \********************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! ../utils/logger.js */"./src/utils/logger.js"),a=r(/*! ../utils/browser.js */"./src/utils/browser.js"),o=r(/*! ./media-info.js */"./src/core/media-info.js"),l=r(/*! ../demux/flv-demuxer.js */"./src/demux/flv-demuxer.js"),d=r(/*! ../remux/mp4-remuxer.js */"./src/remux/mp4-remuxer.js"),h=r(/*! ../demux/demux-errors.js */"./src/demux/demux-errors.js"),c=r(/*! ../io/io-controller.js */"./src/io/io-controller.js"),u=r(/*! ./transmuxing-events.js */"./src/core/transmuxing-events.js"),f=function(){function e(e,t){this.TAG="TransmuxingController",this._emitter=new(s()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!==typeof e.cors&&(e.cors=!0),"boolean"!==typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var r=0;this._mediaDataSource.segments.forEach((function(i){i.timestampBase=r,r+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(r)||this._mediaDataSource.duration===r||(this._mediaDataSource.duration=r),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){this._currentSegmentIndex=e;var r=this._mediaDataSource.segments[e],i=this._ioctl=new c.default(r,this._config,e);i.onError=this._onIOException.bind(this),i.onSeeked=this._onIOSeeked.bind(this),i.onComplete=this._onIOComplete.bind(this),i.onRedirect=this._onIORedirect.bind(this),i.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):i.onDataArrival=this._onInitChunkArrival.bind(this),i.open(t)},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var r=this._mediaInfo.segments[t];if(void 0==r)this._pendingSeekTime=e;else{var i=r.getNearestKeyframe(e);this._remuxer.seek(i.milliseconds),this._ioctl.seek(i.fileposition),this._pendingResolveSeekPoint=i.milliseconds}}else{var s=this._mediaInfo.segments[t];if(void 0==s)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{i=s.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,i.fileposition),this._pendingResolveSeekPoint=i.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,r=t.length-1,i=0;i0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,s=this._demuxer.parseChunks(e,t);else if((i=l.default.probe(e)).match){this._demuxer=new l.default(i,this._config),this._remuxer||(this._remuxer=new d.default(this._config));var a=this._mediaDataSource;void 0==a.duration||isNaN(a.duration)||(this._demuxer.overridedDuration=a.duration),"boolean"===typeof a.hasAudio&&(this._demuxer.overridedHasAudio=a.hasAudio),"boolean"===typeof a.hasVideo&&(this._demuxer.overridedHasVideo=a.hasVideo),this._demuxer.timestampBase=a.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),s=this._demuxer.parseChunks(e,t)}else i=null,n.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){r._internalAbort()})),this._emitter.emit(u.default.DEMUX_ERROR,h.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),s=0;return s},e.prototype._onMediaInfo=function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,o.default.prototype));var r=Object.assign({},e);Object.setPrototypeOf(r,o.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=r,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(u.default.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(u.default.SCRIPTDATA_ARRIVED,e)},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e,r=t+1;r0&&r[0].originalDts===i&&(i=r[0].pts),this._emitter.emit(u.default.RECOMMEND_SEEKPOINT,i)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t=this._mediaInfo.segments[e],r=Object.assign({},t);r.duration=this._mediaInfo.duration,r.segmentCount=this._mediaInfo.segmentCount,delete r.segments,delete r.keyframesIndex,this._emitter.emit(u.default.MEDIA_INFO,r)},e.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(u.default.STATISTICS_INFO,e)},e}();t["default"]=f},"./src/core/transmuxing-events.js": -/*!****************************************!*\ - !*** ./src/core/transmuxing-events.js ***! - \****************************************/function(e,t,r){"use strict";r.r(t);var i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};t["default"]=i},"./src/core/transmuxing-worker.js": -/*!****************************************!*\ - !*** ./src/core/transmuxing-worker.js ***! - \****************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logging-control.js */"./src/utils/logging-control.js"),s=r(/*! ../utils/polyfill.js */"./src/utils/polyfill.js"),n=r(/*! ./transmuxing-controller.js */"./src/core/transmuxing-controller.js"),a=r(/*! ./transmuxing-events.js */"./src/core/transmuxing-events.js"),o=function(e){var t=null,r=v.bind(this);function o(t,r){var i={msg:a.default.INIT_SEGMENT,data:{type:t,data:r}};e.postMessage(i,[r.data])}function l(t,r){var i={msg:a.default.MEDIA_SEGMENT,data:{type:t,data:r}};e.postMessage(i,[r.data])}function d(){var t={msg:a.default.LOADING_COMPLETE};e.postMessage(t)}function h(){var t={msg:a.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function c(t){var r={msg:a.default.MEDIA_INFO,data:t};e.postMessage(r)}function u(t){var r={msg:a.default.METADATA_ARRIVED,data:t};e.postMessage(r)}function f(t){var r={msg:a.default.SCRIPTDATA_ARRIVED,data:t};e.postMessage(r)}function p(t){var r={msg:a.default.STATISTICS_INFO,data:t};e.postMessage(r)}function m(t,r){e.postMessage({msg:a.default.IO_ERROR,data:{type:t,info:r}})}function g(t,r){e.postMessage({msg:a.default.DEMUX_ERROR,data:{type:t,info:r}})}function y(t){e.postMessage({msg:a.default.RECOMMEND_SEEKPOINT,data:t})}function v(t,r){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:r}})}s.default.install(),e.addEventListener("message",(function(s){switch(s.data.cmd){case"init":t=new n.default(s.data.param[0],s.data.param[1]),t.on(a.default.IO_ERROR,m.bind(this)),t.on(a.default.DEMUX_ERROR,g.bind(this)),t.on(a.default.INIT_SEGMENT,o.bind(this)),t.on(a.default.MEDIA_SEGMENT,l.bind(this)),t.on(a.default.LOADING_COMPLETE,d.bind(this)),t.on(a.default.RECOVERED_EARLY_EOF,h.bind(this)),t.on(a.default.MEDIA_INFO,c.bind(this)),t.on(a.default.METADATA_ARRIVED,u.bind(this)),t.on(a.default.SCRIPTDATA_ARRIVED,f.bind(this)),t.on(a.default.STATISTICS_INFO,p.bind(this)),t.on(a.default.RECOMMEND_SEEKPOINT,y.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(s.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var v=s.data.param;i.default.applyConfig(v),!0===v.enableCallback?i.default.addLogListener(r):i.default.removeLogListener(r);break}}))};t["default"]=o},"./src/demux/amf-parser.js": -/*!*********************************!*\ - !*** ./src/demux/amf-parser.js ***! - \*********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ../utils/utf8-conv.js */"./src/utils/utf8-conv.js"),n=r(/*! ../utils/exception.js */"./src/utils/exception.js"),a=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),o=function(){function e(){}return e.parseScriptData=function(t,r,s){var n={};try{var a=e.parseValue(t,r,s),o=e.parseValue(t,r+a.size,s-a.size);n[a.data]=o.data}catch(l){i.default.e("AMF",l.toString())}return n},e.parseObject=function(t,r,i){if(i<3)throw new n.IllegalStateException("Data not enough when parse ScriptDataObject");var s=e.parseString(t,r,i),a=e.parseValue(t,r+s.size,i-s.size),o=a.objectEnd;return{data:{name:s.data,value:a.data},size:s.size+a.size,objectEnd:o}},e.parseVariable=function(t,r,i){return e.parseObject(t,r,i)},e.parseString=function(e,t,r){if(r<2)throw new n.IllegalStateException("Data not enough when parse String");var i,o=new DataView(e,t,r),l=o.getUint16(0,!a);return i=l>0?(0,s.default)(new Uint8Array(e,t+2,l)):"",{data:i,size:2+l}},e.parseLongString=function(e,t,r){if(r<4)throw new n.IllegalStateException("Data not enough when parse LongString");var i,o=new DataView(e,t,r),l=o.getUint32(0,!a);return i=l>0?(0,s.default)(new Uint8Array(e,t+4,l)):"",{data:i,size:4+l}},e.parseDate=function(e,t,r){if(r<10)throw new n.IllegalStateException("Data size invalid when parse Date");var i=new DataView(e,t,r),s=i.getFloat64(0,!a),o=i.getInt16(8,!a);return s+=60*o*1e3,{data:new Date(s),size:10}},e.parseValue=function(t,r,s){if(s<1)throw new n.IllegalStateException("Data not enough when parse Value");var o,l=new DataView(t,r,s),d=1,h=l.getUint8(0),c=!1;try{switch(h){case 0:o=l.getFloat64(1,!a),d+=8;break;case 1:var u=l.getUint8(1);o=!!u,d+=1;break;case 2:var f=e.parseString(t,r+1,s-1);o=f.data,d+=f.size;break;case 3:o={};var p=0;9===(16777215&l.getUint32(s-4,!a))&&(p=3);while(d32)throw new i.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var r=this._current_word_bits_left?this._current_word:0;r>>>=32-this._current_word_bits_left;var s=e-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(s,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,r=r<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}();t["default"]=s},"./src/demux/flv-demuxer.js": -/*!**********************************!*\ - !*** ./src/demux/flv-demuxer.js ***! - \**********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ./amf-parser.js */"./src/demux/amf-parser.js"),n=r(/*! ./sps-parser.js */"./src/demux/sps-parser.js"),a=r(/*! ./demux-errors.js */"./src/demux/demux-errors.js"),o=r(/*! ../core/media-info.js */"./src/core/media-info.js"),l=r(/*! ../utils/exception.js */"./src/utils/exception.js");function d(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}var h=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new o.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e),r={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return r;var i=(4&t[4])>>>2!==0,s=0!==(1&t[4]),n=d(t,5);return n<9?r:{match:!0,consumed:n,dataOffset:n,hasAudioTrack:i,hasVideoTrack:s}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new o.default},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,r){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new l.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var s=0,n=this._littleEndian;if(0===r){if(!(t.byteLength>13))return 0;var a=e.probe(t);s=a.dataOffset}if(this._firstParse){this._firstParse=!1,r+s!==this._dataOffset&&i.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var o=new DataView(t,s),d=o.getUint32(0,!n);0!==d&&i.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),s+=4}while(st.byteLength)break;var h=o.getUint8(0),c=16777215&o.getUint32(0,!n);if(s+11+c+4>t.byteLength)break;if(8===h||9===h||18===h){var u=o.getUint8(4),f=o.getUint8(5),p=o.getUint8(6),m=o.getUint8(7),g=p|f<<8|u<<16|m<<24,y=16777215&o.getUint32(7,!n);0!==y&&i.default.w(this.TAG,"Meet tag which has StreamID != 0!");var v=s+11;switch(h){case 8:this._parseAudioData(t,v,c,g);break;case 9:this._parseVideoData(t,v,c,g,r+s);break;case 18:this._parseScriptData(t,v,c);break}var _=o.getUint32(11+c,!n);_!==11+c&&i.default.w(this.TAG,"Invalid PrevTagSize "+_),s+=11+c+4}else i.default.w(this.TAG,"Unsupported tag type "+h+", skipped"),s+=11+c+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),s},e.prototype._parseScriptData=function(e,t,r){var n=s.default.parseScriptData(e,t,r);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!==typeof n.onMetaData)return void i.default.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&i.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var a=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},a)),"boolean"===typeof a.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=a.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"===typeof a.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=a.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"===typeof a.audiodatarate&&(this._mediaInfo.audioDataRate=a.audiodatarate),"number"===typeof a.videodatarate&&(this._mediaInfo.videoDataRate=a.videodatarate),"number"===typeof a.width&&(this._mediaInfo.width=a.width),"number"===typeof a.height&&(this._mediaInfo.height=a.height),"number"===typeof a.duration){if(!this._durationOverrided){var o=Math.floor(a.duration*this._timescale);this._duration=o,this._mediaInfo.duration=o}}else this._mediaInfo.duration=0;if("number"===typeof a.framerate){var l=Math.floor(1e3*a.framerate);if(l>0){var d=l/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=d,this._referenceFrameRate.fps_num=l,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=d}}if("object"===typeof a.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var h=a.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h),a.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=a,i.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],r=[],i=1;i>>4;if(2===l||10===l){var d=0,h=(12&o)>>>2;if(h>=0&&h<=4){d=this._flvSoundRateTable[h];var c=1&o,u=this._audioMetadata,f=this._audioTrack;if(u||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),u=this._audioMetadata={},u.type="audio",u.id=f.id,u.timescale=this._timescale,u.duration=this._duration,u.audioSampleRate=d,u.channelCount=0===c?1:2),10===l){var p=this._parseAACAudioData(e,t+1,r-1);if(void 0==p)return;if(0===p.packetType){u.config&&i.default.w(this.TAG,"Found another AudioSpecificConfig!");var m=p.data;u.audioSampleRate=m.samplingRate,u.channelCount=m.channelCount,u.codec=m.codec,u.originalCodec=m.originalCodec,u.config=m.config,u.refSampleDuration=1024/u.audioSampleRate*u.timescale,i.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",u);var g=this._mediaInfo;g.audioCodec=u.originalCodec,g.audioSampleRate=u.audioSampleRate,g.audioChannelCount=u.channelCount,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}else if(1===p.packetType){var y=this._timestampBase+s,v={unit:p.data,length:p.data.byteLength,dts:y,pts:y};f.samples.push(v),f.length+=p.data.length}else i.default.e(this.TAG,"Flv: Unsupported AAC data type "+p.packetType)}else if(2===l){if(!u.codec){m=this._parseMP3AudioData(e,t+1,r-1,!0);if(void 0==m)return;u.audioSampleRate=m.samplingRate,u.channelCount=m.channelCount,u.codec=m.codec,u.originalCodec=m.originalCodec,u.refSampleDuration=1152/u.audioSampleRate*u.timescale,i.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",u);g=this._mediaInfo;g.audioCodec=u.codec,g.audioSampleRate=u.audioSampleRate,g.audioChannelCount=u.channelCount,g.audioDataRate=m.bitRate,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}var _=this._parseMP3AudioData(e,t+1,r-1,!1);if(void 0==_)return;y=this._timestampBase+s;var E={unit:_,length:_.byteLength,dts:y,pts:y};f.samples.push(E),f.length+=_.length}}else this._onError(a.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+h)}else this._onError(a.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+l)}},e.prototype._parseAACAudioData=function(e,t,r){if(!(r<=1)){var s={},n=new Uint8Array(e,t,r);return s.packetType=n[0],0===n[0]?s.data=this._parseAACAudioSpecificConfig(e,t+1,r-1):s.data=n.subarray(1),s}i.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,r){var i=new Uint8Array(e,t,r),s=null,n=0,o=0,l=0,d=null;if(n=o=i[0]>>>3,l=(7&i[0])<<1|i[1]>>>7,l<0||l>=this._mpegSamplingRates.length)this._onError(a.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var h=this._mpegSamplingRates[l],c=(120&i[1])>>>3;if(!(c<0||c>=8)){5===n&&(d=(7&i[1])<<1|i[2]>>>7,(124&i[2])>>>2);var u=self.navigator.userAgent.toLowerCase();return-1!==u.indexOf("firefox")?l>=6?(n=5,s=new Array(4),d=l-3):(n=2,s=new Array(2),d=l):-1!==u.indexOf("android")?(n=2,s=new Array(2),d=l):(n=5,d=l,s=new Array(4),l>=6?d=l-3:1===c&&(n=2,s=new Array(2),d=l)),s[0]=n<<3,s[0]|=(15&l)>>>1,s[1]=(15&l)<<7,s[1]|=(15&c)<<3,5===n&&(s[1]|=(15&d)>>>1,s[2]=(1&d)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:h,channelCount:c,codec:"mp4a.40."+n,originalCodec:"mp4a.40."+o}}this._onError(a.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,r,s){if(!(r<4)){this._littleEndian;var n=new Uint8Array(e,t,r),a=null;if(s){if(255!==n[0])return;var o=n[1]>>>3&3,l=(6&n[1])>>1,d=(240&n[2])>>>4,h=(12&n[2])>>>2,c=n[3]>>>6&3,u=3!==c?2:1,f=0,p=0,m="mp3";switch(o){case 0:f=this._mpegAudioV25SampleRateTable[h];break;case 2:f=this._mpegAudioV20SampleRateTable[h];break;case 3:f=this._mpegAudioV10SampleRateTable[h];break}switch(l){case 1:34,d>>4,d=15&o;7===d?this._parseAVCVideoPacket(e,t+1,r-1,s,n,l):this._onError(a.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+d)}},e.prototype._parseAVCVideoPacket=function(e,t,r,s,n,o){if(r<4)i.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,d=new DataView(e,t,r),h=d.getUint8(0),c=16777215&d.getUint32(0,!l),u=c<<8>>8;if(0===h)this._parseAVCDecoderConfigurationRecord(e,t+4,r-4);else if(1===h)this._parseAVCVideoData(e,t+4,r-4,s,n,o,u);else if(2!==h)return void this._onError(a.default.FORMAT_ERROR,"Flv: Invalid video packet type "+h)}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,r){if(r<7)i.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var s=this._videoMetadata,o=this._videoTrack,l=this._littleEndian,d=new DataView(e,t,r);s?"undefined"!==typeof s.avcc&&i.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),s=this._videoMetadata={},s.type="video",s.id=o.id,s.timescale=this._timescale,s.duration=this._duration);var h=d.getUint8(0),c=d.getUint8(1);d.getUint8(2),d.getUint8(3);if(1===h&&0!==c)if(this._naluLengthSize=1+(3&d.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var u=31&d.getUint8(5);if(0!==u){u>1&&i.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+u);for(var f=6,p=0;p1&&i.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+A),f++;for(p=0;p=r){i.default.w(this.TAG,"Malformed Nalu near timestamp "+p+", offset = "+u+", dataSize = "+r);break}var g=d.getUint32(u,!l);if(3===f&&(g>>>=8),g>r-f)return void i.default.w(this.TAG,"Malformed Nalus near timestamp "+p+", NaluSize > DataSize!");var y=31&d.getUint8(u+f);5===y&&(m=!0);var v=new Uint8Array(e,t+u,f+g),_={type:y,data:v};h.push(_),c+=v.byteLength,u+=f+g}if(h.length){var E=this._videoTrack,b={units:h,length:c,isKeyframe:m,dts:p,cts:o,pts:p+o};m&&(b.fileposition=n),E.samples.push(b),E.length+=c}},e}();t["default"]=h},"./src/demux/sps-parser.js": -/*!*********************************!*\ - !*** ./src/demux/sps-parser.js ***! - \*********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ./exp-golomb.js */"./src/demux/exp-golomb.js"),s=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,r=t.byteLength,i=new Uint8Array(r),s=0,n=0;n=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(i[s]=t[n],s++);return new Uint8Array(i.buffer,0,s)},e.parseSPS=function(t){var r=e._ebsp2rbsp(t),s=new i.default(r);s.readByte();var n=s.readByte();s.readByte();var a=s.readByte();s.readUEG();var o=e.getProfileString(n),l=e.getLevelString(a),d=1,h=420,c=[0,420,422,444],u=8;if((100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n)&&(d=s.readUEG(),3===d&&s.readBits(1),d<=3&&(h=c[d]),u=s.readUEG()+8,s.readUEG(),s.readBits(1),s.readBool()))for(var f=3!==d?8:12,p=0;p0&&P<16?(w=O[P-1],R=M[P-1]):255===P&&(w=s.readByte()<<8|s.readByte(),R=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var F=s.readBits(32),N=s.readBits(32);I=s.readBool(),D=N,x=2*F,k=D/x}}var U=1;1===w&&1===R||(U=w/R);var B=0,$=0;if(0===d)B=1,$=2-E;else{var G=3===d?1:2,j=1===d?2:1;B=G,$=j*(2-E)}var K=16*(v+1),V=16*(_+1)*(2-E);K-=(b+T)*B,V-=(S+L)*$;var H=Math.ceil(K*U);return s.destroy(),s=null,{profile_string:o,level_string:l,bit_depth:u,ref_frames:y,chroma_format:h,chroma_format_string:e.getChromaFormatString(h),frame_rate:{fixed:I,fps:k,fps_den:x,fps_num:D},sar_ratio:{width:w,height:R},codec_size:{width:K,height:V},present_size:{width:H,height:V}}},e._skipScalingList=function(e,t){for(var r=8,i=8,s=0,n=0;n=15048,t=!i.default.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(r){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var r=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);var a=this._seekHandler.getConfig(i,t),o=new self.Headers;if("object"===typeof a.headers){var l=a.headers;for(var d in l)l.hasOwnProperty(d)&&o.append(d,l[d])}var h={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===typeof this._config.headers)for(var d in this._config.headers)o.append(d,this._config.headers[d]);!1===e.cors&&(h.mode="same-origin"),e.withCredentials&&(h.credentials="include"),e.referrerPolicy&&(h.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,h.signal=this._abortController.signal),this._status=s.LoaderStatus.kConnecting,self.fetch(a.url,h).then((function(e){if(r._requestAbort)return r._status=s.LoaderStatus.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.url&&r._onURLRedirect){var t=r._seekHandler.removeURLParameters(e.url);r._onURLRedirect(t)}var i=e.headers.get("Content-Length");return null!=i&&(r._contentLength=parseInt(i),0!==r._contentLength&&r._onContentLengthKnown&&r._onContentLengthKnown(r._contentLength)),r._pump.call(r,e.body.getReader())}if(r._status=s.LoaderStatus.kError,!r._onError)throw new n.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);r._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!r._abortController||!r._abortController.signal.aborted){if(r._status=s.LoaderStatus.kError,!r._onError)throw e;r._onError(s.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==s.LoaderStatus.kBuffering||!i.default.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(r){if(r.done)if(null!==t._contentLength&&t._receivedLength0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new s.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||void 0!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===l.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new h.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",r=e.seekParamEnd||"bend";this._seekHandler=new c.default(t,r)}else{if("custom"!==e.seekType)throw new u.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!==typeof e.customSeekHandler)throw new u.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=d.default;else if(a.default.isSupported())this._loaderClass=a.default;else if(o.default.isSupported())this._loaderClass=o.default;else{if(!l.default.isSupported())throw new u.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=l.default}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},e.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var r={from:e,to:-1};this._currentRange={from:r.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,r),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!==typeof e||0===e.length)throw new u.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){var t=this._stashSize;while(t+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed),s=new Uint8Array(r,0,t);s.set(i,0)}this._stashBuffer=r,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,r=t.length-1,i=0,s=0,n=r;if(e=t[i]&&e=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);var r=1024*t+1048576;this._bufferSize0){var n=this._stashBuffer.slice(0,this._stashUsed);a=this._dispatchChunks(n,this._stashByteStart);if(a0){d=new Uint8Array(n,a);l.set(d,0),this._stashUsed=d.byteLength,this._stashByteStart+=a}}else this._stashUsed=0,this._stashByteStart+=a;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),l=new Uint8Array(this._stashBuffer,0,this._bufferSize)),l.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{a=this._dispatchChunks(e,t);if(athis._bufferSize&&(this._expandBuffer(o),l=new Uint8Array(this._stashBuffer,0,this._bufferSize)),l.set(new Uint8Array(e,a),0),this._stashUsed+=o,this._stashByteStart=t+a}}}else if(0===this._stashUsed){var a=this._dispatchChunks(e,t);if(athis._bufferSize&&this._expandBuffer(o);var l=new Uint8Array(this._stashBuffer,0,this._bufferSize);l.set(new Uint8Array(e,a),0),this._stashUsed+=o,this._stashByteStart=t+a}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var l=new Uint8Array(this._stashBuffer,0,this._bufferSize);l.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var a=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(a0){var d=new Uint8Array(this._stashBuffer,a);l.set(d,0)}this._stashUsed-=a,this._stashByteStart+=a}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),r=this._dispatchChunks(t,this._stashByteStart),s=t.byteLength-r;if(r0){var n=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,r);n.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=r}return 0}i.default.w(this.TAG,s+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,s}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(i.default.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=n.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case n.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var r=this._currentRange.to+1;return void(r0)for(var n=r.split("&"),a=0;a0;o[0]!==this._startName&&o[0]!==this._endName&&(l&&(s+="&"),s+=n[a])}return 0===s.length?t:t+"?"+s},e}();t["default"]=i},"./src/io/range-seek-handler.js": -/*!**************************************!*\ - !*** ./src/io/range-seek-handler.js ***! - \**************************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var r={};if(0!==t.from||-1!==t.to){var i=void 0;i=-1!==t.to?"bytes="+t.from.toString()+"-"+t.to.toString():"bytes="+t.from.toString()+"-",r["Range"]=i}else this._zeroStart&&(r["Range"]="bytes=0-");return{url:e,headers:r}},e.prototype.removeURLParameters=function(e){return e},e}();t["default"]=i},"./src/io/speed-sampler.js": -/*!*********************************!*\ - !*** ./src/io/speed-sampler.js ***! - \*********************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();t["default"]=i},"./src/io/websocket-loader.js": -/*!************************************!*\ - !*** ./src/io/websocket-loader.js ***! - \************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ./loader.js */"./src/io/loader.js"),s=r(/*! ../utils/exception.js */"./src/utils/exception.js"),n=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),a=function(e){function t(){var t=e.call(this,"websocket-loader")||this;return t.TAG="WebSocketLoader",t._needStash=!0,t._ws=null,t._requestAbort=!1,t._receivedLength=0,t}return n(t,e),t.isSupported=function(){try{return"undefined"!==typeof self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=i.LoaderStatus.kConnecting}catch(n){this._status=i.LoaderStatus.kError;var r={code:n.code,msg:n.message};if(!this._onError)throw new s.RuntimeException(r.msg);this._onError(i.LoaderErrors.EXCEPTION,r)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=i.LoaderStatus.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=i.LoaderStatus.kBuffering},t.prototype._onWebSocketClose=function(e){!0!==this._requestAbort?(this._status=i.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var r=new FileReader;r.onload=function(){t._dispatchArrayBuffer(r.result)},r.readAsArrayBuffer(e.data)}else{this._status=i.LoaderStatus.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new s.RuntimeException(n.msg);this._onError(i.LoaderErrors.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,r=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,r,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=i.LoaderStatus.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new s.RuntimeException(t.msg);this._onError(i.LoaderErrors.EXCEPTION,t)},t}(i.BaseLoader);t["default"]=a},"./src/io/xhr-moz-chunked-loader.js": -/*!******************************************!*\ - !*** ./src/io/xhr-moz-chunked-loader.js ***! - \******************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ./loader.js */"./src/io/loader.js"),n=r(/*! ../utils/exception.js */"./src/utils/exception.js"),a=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),o=function(e){function t(t,r){var i=e.call(this,"xhr-moz-chunked-loader")||this;return i.TAG="MozChunkedLoader",i._seekHandler=t,i._config=r,i._needStash=!0,i._xhr=null,i._requestAbort=!1,i._contentLength=null,i._receivedLength=0,i}return a(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(t){return i.default.w("MozChunkedLoader",t.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(r=e.redirectedURL);var i=this._seekHandler.getConfig(r,t);this._requestURL=i.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",i.url,!0),n.responseType="moz-chunked-arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onloadend=this._onLoadEnd.bind(this),n.onerror=this._onXhrError.bind(this),e.withCredentials&&(n.withCredentials=!0),"object"===typeof i.headers){var a=i.headers;for(var o in a)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o])}if("object"===typeof this._config.headers){a=this._config.headers;for(var o in a)a.hasOwnProperty(o)&&n.setRequestHeader(o,a[o])}this._status=s.LoaderStatus.kConnecting,n.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=s.LoaderStatus.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var r=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(r)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=s.LoaderStatus.kError,!this._onError)throw new n.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=s.LoaderStatus.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==s.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,r,this._receivedLength)}},t.prototype._onLoadEnd=function(e){!0!==this._requestAbort?this._status!==s.LoaderStatus.kError&&(this._status=s.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=s.LoaderStatus.kError;var t=0,r=null;if(this._contentLength&&e.loaded=this._contentLength&&(r=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:r},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var r=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?r=this._currentRedirectedURL:void 0!=e.redirectedURL&&(r=e.redirectedURL));var i=this._seekHandler.getConfig(r,t);this._currentRequestURL=i.url;var s=this._xhr=new XMLHttpRequest;if(s.open("GET",i.url,!0),s.responseType="arraybuffer",s.onreadystatechange=this._onReadyStateChange.bind(this),s.onprogress=this._onProgress.bind(this),s.onload=this._onLoad.bind(this),s.onerror=this._onXhrError.bind(this),e.withCredentials&&(s.withCredentials=!0),"object"===typeof i.headers){var n=i.headers;for(var a in n)n.hasOwnProperty(a)&&s.setRequestHeader(a,n[a])}if("object"===typeof this._config.headers){n=this._config.headers;for(var a in n)n.hasOwnProperty(a)&&s.setRequestHeader(a,n[a])}s.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=n.LoaderStatus.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){var r=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&r!==this._currentRedirectedURL&&(this._currentRedirectedURL=r,this._onURLRedirect&&this._onURLRedirect(r))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=n.LoaderStatus.kBuffering}else{if(this._status=n.LoaderStatus.kError,!this._onError)throw new a.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(n.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==n.LoaderStatus.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var r=e.total;this._internalAbort(),null!=r&0!==r&&(this._totalLength=r)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,r=t.length-1,i=0,s=0,n=r;if(e=t[i]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var r=this._normalizeSpeed(t);this._currentSpeedNormalized!==r&&(this._currentSpeedNormalized=r,this._currentChunkSizeKB=r)}var i=e.target.response,s=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new l.default(this._mediaDataSource,this._config),this._transmuxer.on(d.default.INIT_SEGMENT,(function(t,r){e._msectl.appendInitSegment(r)})),this._transmuxer.on(d.default.MEDIA_SEGMENT,(function(t,r){if(e._msectl.appendMediaSegment(r),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;r.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(n.default.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(d.default.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(o.default.LOADING_COMPLETE)})),this._transmuxer.on(d.default.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(o.default.RECOVERED_EARLY_EOF)})),this._transmuxer.on(d.default.IO_ERROR,(function(t,r){e._emitter.emit(o.default.ERROR,u.ErrorTypes.NETWORK_ERROR,t,r)})),this._transmuxer.on(d.default.DEMUX_ERROR,(function(t,r){e._emitter.emit(o.default.ERROR,u.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:r})})),this._transmuxer.on(d.default.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(o.default.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(d.default.METADATA_ARRIVED,(function(t){e._emitter.emit(o.default.METADATA_ARRIVED,t)})),this._transmuxer.on(d.default.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(o.default.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(d.default.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(o.default.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(d.default.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,r=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var s=this._mediaElement.getVideoPlaybackQuality();r=s.totalVideoFrames,i=s.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(r=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=r,e.droppedFrames=i),e},e.prototype._onmseUpdateEnd=function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,r=0,i=0;i=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(n.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){n.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,r=!1,i=0;i=s&&e=a-this._config.lazyLoadRecoverDuration&&(r=!0);break}}r&&(window.clearInterval(this._progressChecker),this._progressChecker=null,r&&(n.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t=this._mediaElement.buffered,r=0;r=i&&e0){var s=this._mediaElement.buffered.start(0);(s<1&&e0&&t.currentTime0){var i=r.start(0);if(i<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",t={mimeType:e+this._mediaDataSource.type};return this._mediaElement&&(t.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(t.width=this._mediaElement.videoWidth,t.height=this._mediaElement.videoHeight)),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,r=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var s=this._mediaElement.getVideoPlaybackQuality();r=s.totalVideoFrames,i=s.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(r=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=r,e.droppedFrames=i),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(n.default.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(n.default.STATISTICS_INFO,this.statisticsInfo)},e}();t["default"]=l},"./src/player/player-errors.js": -/*!*************************************!*\ - !*** ./src/player/player-errors.js ***! - \*************************************/function(e,t,r){"use strict";r.r(t),r.d(t,{ErrorTypes:function(){return n},ErrorDetails:function(){return a}});var i=r(/*! ../io/loader.js */"./src/io/loader.js"),s=r(/*! ../demux/demux-errors.js */"./src/demux/demux-errors.js"),n={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},a={NETWORK_EXCEPTION:i.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:i.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:i.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:i.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:s.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:s.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:s.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js": -/*!*************************************!*\ - !*** ./src/player/player-events.js ***! - \*************************************/function(e,t,r){"use strict";r.r(t);var i={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};t["default"]=i},"./src/remux/aac-silent.js": -/*!*********************************!*\ - !*** ./src/remux/aac-silent.js ***! - \*********************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();t["default"]=i},"./src/remux/mp4-generator.js": -/*!************************************!*\ - !*** ./src/remux/mp4-generator.js ***! - \************************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=e.constants={};r.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),r.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),r.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),r.STSC=r.STCO=r.STTS,r.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),r.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),r.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),r.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,r=null,i=Array.prototype.slice.call(arguments,1),s=i.length,n=0;n>>24&255,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r.set(e,4);var a=8;for(n=0;n>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var r=t.id,i=t.duration,s=t.presentWidth,n=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,s>>>8&255,255&s,0,0,n>>>8&255,255&n,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var r=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))},e.hdlr=function(t){var r=null;return r="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,r)},e.minf=function(t){var r=null;return r="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,r,e.dinf(),e.stbl(t))},e.dinf=function(){var t=e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF));return t},e.stbl=function(t){var r=e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO));return r},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var r=t.channelCount,i=t.audioSampleRate,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],s)},e.mp4a=function(t){var r=t.channelCount,i=t.audioSampleRate,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,r,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,s,e.esds(t))},e.esds=function(t){var r=t.config||[],i=r.length,s=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(r).concat([6,1,2]));return e.box(e.types.esds,s)},e.avc1=function(t){var r=t.avcc,i=t.codecWidth,s=t.codecHeight,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,s>>>8&255,255&s,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,n,e.box(e.types.avcC,r))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var r=t.id,i=new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)},e.moof=function(t,r){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,r))},e.mfhd=function(t){var r=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,r)},e.traf=function(t,r){var i=t.id,s=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),n=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),a=e.sdtp(t),o=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,s,n,o,a)},e.sdtp=function(t){for(var r=t.samples||[],i=r.length,s=new Uint8Array(4+i),n=0;n>>24&255,s>>>16&255,s>>>8&255,255&s,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0);for(var o=0;o>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.isNonSync,0,0,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*o)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();i.init(),t["default"]=i},"./src/remux/mp4-remuxer.js": -/*!**********************************!*\ - !*** ./src/remux/mp4-remuxer.js ***! - \**********************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger.js */"./src/utils/logger.js"),s=r(/*! ./mp4-generator.js */"./src/remux/mp4-generator.js"),n=r(/*! ./aac-silent.js */"./src/remux/aac-silent.js"),a=r(/*! ../utils/browser.js */"./src/utils/browser.js"),o=r(/*! ../core/media-segment-info.js */"./src/core/media-segment-info.js"),l=r(/*! ../utils/exception.js */"./src/utils/exception.js"),d=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new o.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new o.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.default.chrome||!(a.default.version.major<50||50===a.default.version.major&&a.default.version.build<2661)),this._fillSilentAfterSeek=a.default.msedge||a.default.msie,this._mp3UseMpegAudio=!a.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new l.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var r=null,i="mp4",n=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(i="mpeg",n="",r=new Uint8Array):r=s.default.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,r=s.default.generateInitSegment(t)}if(!this._onInitSegment)throw new l.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:r.buffer,codec:n,container:e+"/"+i,mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,r={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(r.samples.push(e),r.length=e.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(i.samples.push(t),i.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(r,!0),this._remuxAudio(i,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var r=e,l=r.samples,d=void 0,h=-1,c=-1,u=this._audioMeta.refSampleDuration,f="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,p=this._dtsBaseInited&&void 0===this._audioNextDts,m=!1;if(l&&0!==l.length&&(1!==l.length||t)){var g=0,y=null,v=0;f?(g=0,v=r.length):(g=8,v=8+r.length);var _=null;if(l.length>1&&(_=l.pop(),v-=_.length),null!=this._audioStashedLastSample){var E=this._audioStashedLastSample;this._audioStashedLastSample=null,l.unshift(E),v+=E.length}null!=_&&(this._audioStashedLastSample=_);var b=l[0].dts-this._dtsBase;if(this._audioNextDts)d=b-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())d=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(m=!0);else{var T=this._audioSegmentInfoList.getLastSampleBefore(b);if(null!=T){var S=b-(T.originalDts+T.duration);S<=3&&(S=0);var L=T.dts+T.duration+S;d=b-L}else d=0}if(m){var A=b-d,w=this._videoSegmentInfoList.getLastSegmentBefore(b);if(null!=w&&w.beginDts=U*u&&this._fillAudioTimestampGap&&!a.default.safari){O=!0;var B=Math.floor(d/u);i.default.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: "+P+" ms, curRefDts: "+N+" ms, dtsCorrection: "+Math.round(d)+" ms, generate: "+B+" frames"),k=Math.floor(N),F=Math.floor(N+u)-k;R=n.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==R&&(i.default.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),R=C),M=[];for(var $=0;$=1?D[D.length-1].duration:Math.floor(u);this._audioNextDts=k+F}-1===h&&(h=k),D.push({dts:k,pts:k,cts:0,unit:E.unit,size:E.unit.byteLength,duration:F,originalDts:P,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),O&&D.push.apply(D,M)}}if(0===D.length)return r.samples=[],void(r.length=0);f?y=new Uint8Array(v):(y=new Uint8Array(v),y[0]=v>>>24&255,y[1]=v>>>16&255,y[2]=v>>>8&255,y[3]=255&v,y.set(s.default.types.mdat,4));for(x=0;x1&&(p=i.pop(),f-=p.length),null!=this._videoStashedLastSample){var m=this._videoStashedLastSample;this._videoStashedLastSample=null,i.unshift(m),f+=m.length}null!=p&&(this._videoStashedLastSample=p);var g=i[0].dts-this._dtsBase;if(this._videoNextDts)n=g-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var y=this._videoSegmentInfoList.getLastSampleBefore(g);if(null!=y){var v=g-(y.originalDts+y.duration);v<=3&&(v=0);var _=y.dts+y.duration+v;n=g-_}else n=0}for(var E=new o.MediaSegmentInfo,b=[],T=0;T=1?b[b.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(L){var D=new o.SampleInfo(A,R,k,m.dts,!0);D.fileposition=m.fileposition,E.appendSyncPoint(D)}b.push({dts:A,pts:R,cts:w,units:m.units,size:m.length,isKeyframe:L,duration:k,originalDts:S,flags:{isLeading:0,dependsOn:L?2:1,isDependedOn:L?1:0,hasRedundancy:0,isNonSync:L?0:1}})}u=new Uint8Array(f),u[0]=f>>>24&255,u[1]=f>>>16&255,u[2]=f>>>8&255,u[3]=255&f,u.set(s.default.types.mdat,4);for(T=0;T=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],r=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],s={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:r[0]||""},n={};if(s.browser){n[s.browser]=!0;var a=s.majorVersion.split(".");n.version={major:parseInt(s.majorVersion,10),string:s.version},a.length>1&&(n.version.minor=parseInt(a[1],10)),a.length>2&&(n.version.build=parseInt(a[2],10))}if(s.platform&&(n[s.platform]=!0),(n.chrome||n.opr||n.safari)&&(n.webkit=!0),n.rv||n.iemobile){n.rv&&delete n.rv;var o="msie";s.browser=o,n[o]=!0}if(n.edge){delete n.edge;var l="msedge";s.browser=l,n[l]=!0}if(n.opr){var d="opera";s.browser=d,n[d]=!0}if(n.safari&&n.android){var h="android";s.browser=h,n[h]=!0}for(var c in n.name=s.browser,n.platform=s.platform,i)i.hasOwnProperty(c)&&delete i[c];Object.assign(i,n)}s(),t["default"]=i},"./src/utils/exception.js": -/*!********************************!*\ - !*** ./src/utils/exception.js ***! - \********************************/function(e,t,r){"use strict";r.r(t),r.d(t,{RuntimeException:function(){return s},IllegalStateException:function(){return n},InvalidArgumentException:function(){return a},NotImplementedException:function(){return o}});var i=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),s=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),n=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(s),a=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(s),o=function(e){function t(t){return e.call(this,t)||this}return i(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(s)},"./src/utils/logger.js": -/*!*****************************!*\ - !*** ./src/utils/logger.js ***! - \*****************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=function(){function e(){}return e.e=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",i),e.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))},e.i=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))},e.w=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))},e.d=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",i),e.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))},e.v=function(t,r){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+r;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",i),e.ENABLE_VERBOSE&&console.log(i)},e}();n.GLOBAL_TAG="flv.js",n.FORCE_GLOBAL_TAG=!1,n.ENABLE_ERROR=!0,n.ENABLE_INFO=!0,n.ENABLE_WARN=!0,n.ENABLE_DEBUG=!0,n.ENABLE_VERBOSE=!0,n.ENABLE_CALLBACK=!1,n.emitter=new(s()),t["default"]=n},"./src/utils/logging-control.js": -/*!**************************************!*\ - !*** ./src/utils/logging-control.js ***! - \**************************************/function(e,t,r){"use strict";r.r(t);var i=r(/*! events */"./node_modules/events/events.js"),s=r.n(i),n=r(/*! ./logger.js */"./src/utils/logger.js"),a=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return n.default.FORCE_GLOBAL_TAG},set:function(t){n.default.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return n.default.GLOBAL_TAG},set:function(t){n.default.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return n.default.ENABLE_VERBOSE&&n.default.ENABLE_DEBUG&&n.default.ENABLE_INFO&&n.default.ENABLE_WARN&&n.default.ENABLE_ERROR},set:function(t){n.default.ENABLE_VERBOSE=t,n.default.ENABLE_DEBUG=t,n.default.ENABLE_INFO=t,n.default.ENABLE_WARN=t,n.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return n.default.ENABLE_DEBUG},set:function(t){n.default.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return n.default.ENABLE_VERBOSE},set:function(t){n.default.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return n.default.ENABLE_INFO},set:function(t){n.default.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return n.default.ENABLE_WARN},set:function(t){n.default.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return n.default.ENABLE_ERROR},set:function(t){n.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:n.default.GLOBAL_TAG,forceGlobalTag:n.default.FORCE_GLOBAL_TAG,enableVerbose:n.default.ENABLE_VERBOSE,enableDebug:n.default.ENABLE_DEBUG,enableInfo:n.default.ENABLE_INFO,enableWarn:n.default.ENABLE_WARN,enableError:n.default.ENABLE_ERROR,enableCallback:n.default.ENABLE_CALLBACK}},e.applyConfig=function(e){n.default.GLOBAL_TAG=e.globalTag,n.default.FORCE_GLOBAL_TAG=e.forceGlobalTag,n.default.ENABLE_VERBOSE=e.enableVerbose,n.default.ENABLE_DEBUG=e.enableDebug,n.default.ENABLE_INFO=e.enableInfo,n.default.ENABLE_WARN=e.enableWarn,n.default.ENABLE_ERROR=e.enableError,n.default.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var r=e.getConfig();t.emit("change",r)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){n.default.emitter.addListener("log",t),n.default.emitter.listenerCount("log")>0&&(n.default.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){n.default.emitter.removeListener("log",t),0===n.default.emitter.listenerCount("log")&&(n.default.ENABLE_CALLBACK=!1,e._notifyChange())},e}();a.emitter=new(s()),t["default"]=a},"./src/utils/polyfill.js": -/*!*******************************!*\ - !*** ./src/utils/polyfill.js ***! - \*******************************/function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r=128){t.push(String.fromCharCode(65535&a)),s+=2;continue}}}else if(r[s]<240){if(i(r,s,2)){a=(15&r[s])<<12|(63&r[s+1])<<6|63&r[s+2];if(a>=2048&&55296!==(63488&a)){t.push(String.fromCharCode(65535&a)),s+=3;continue}}}else if(r[s]<248&&i(r,s,3)){a=(7&r[s])<<18|(63&r[s+1])<<12|(63&r[s+2])<<6|63&r[s+3];if(a>65536&&a<1114112){a-=65536,t.push(String.fromCharCode(a>>>10|55296)),t.push(String.fromCharCode(1023&a|56320)),s+=4;continue}}t.push(String.fromCharCode(65533)),++s}return t.join("")}r.r(t),t["default"]=s}},r={};function i(t){var s=r[t];if(void 0!==s)return s.exports;var n=r[t]={exports:{}};return e[t].call(n.exports,n,n.exports,i),n.exports}i.m=e,function(){i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,{a:t}),t}}(),function(){i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}}(),function(){i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}();var s=i("./src/index.js");return s}()}))}).call(this,r("4362"))}}]); \ No newline at end of file diff --git a/dist/build/h5/static/js/pages-basics-profile.74500594.js b/dist/build/h5/static/js/pages-basics-profile.4e333709.js similarity index 90% rename from dist/build/h5/static/js/pages-basics-profile.74500594.js rename to dist/build/h5/static/js/pages-basics-profile.4e333709.js index 3672cff..f45ca53 100644 --- a/dist/build/h5/static/js/pages-basics-profile.74500594.js +++ b/dist/build/h5/static/js/pages-basics-profile.4e333709.js @@ -16,4 +16,4 @@ * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */},"58e0":function(t,e,n){"use strict";(function(t){var r=n("26ee"),i=n("2f74"),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=a&&a.exports===o,c=u?r["a"].Buffer:void 0,s=c?c.isBuffer:void 0,l=s||i["a"];e["a"]=l}).call(this,n("dd40")(t))},"5e8e":function(t,e,n){"use strict";var r=n("83cc"),i=n.n(r);i.a},"5ea3":function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e["a"]=n}).call(this,n("c8ba"))},"5f04":function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("13d5"),n("d3b7"),n("14d9"),n("4de4");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},label:{type:String,default:""},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"}},computed:{status:{get:function(){return this.value},set:function(t){this.$emit("change",t),this.$emit("input",t)}},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},data:function(){return{options:[],emitData:null,isFirstLoad:!0}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleChange:function(t){var e=this.getOptions.filter((function(e){return e.value==t}));this.emitData=e},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},"5fea":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-checkbox[data-v-7e6e0538]{display:inline-flex;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none;line-height:1.8}.u-checkbox__icon-wrap[data-v-7e6e0538]{color:#606266;flex:none;display:-webkit-flex;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;width:%?42?%;height:%?42?%;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;border:1px solid #c8c9cc;transition-duration:.2s}.u-checkbox__icon-wrap--circle[data-v-7e6e0538]{border-radius:100%}.u-checkbox__icon-wrap--square[data-v-7e6e0538]{border-radius:%?6?%}.u-checkbox__icon-wrap--checked[data-v-7e6e0538]{color:#fff;background-color:#2979ff;border-color:#2979ff}.u-checkbox__icon-wrap--disabled[data-v-7e6e0538]{background-color:#ebedf0;border-color:#c8c9cc}.u-checkbox__icon-wrap--disabled--checked[data-v-7e6e0538]{color:#c8c9cc!important}.u-checkbox__label[data-v-7e6e0538]{word-wrap:break-word;margin-left:%?10?%;margin-right:%?24?%;color:#606266;font-size:%?30?%}.u-checkbox__label--disabled[data-v-7e6e0538]{color:#c8c9cc}',""]),t.exports=e},"62be":function(t,e,n){var r=n("cc76");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("532536c8",r,!0,{sourceMap:!1,shadowMode:!1})},"62f2":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var r=uni.getSystemInfoSync(),i={};e.default={name:"u-navbar",props:{height:{type:[String,Number],default:""},backIconColor:{type:String,default:"#606266"},backIconName:{type:String,default:"nav-back"},backIconSize:{type:[String,Number],default:"44"},backText:{type:String,default:""},backTextStyle:{type:Object,default:function(){return{color:"#606266"}}},title:{type:String,default:""},titleWidth:{type:[String,Number],default:"250"},titleColor:{type:String,default:"#606266"},titleBold:{type:Boolean,default:!1},titleSize:{type:[String,Number],default:32},isBack:{type:[Boolean,String],default:!0},background:{type:Object,default:function(){return{background:"#ffffff"}}},isFixed:{type:Boolean,default:!0},immersive:{type:Boolean,default:!1},borderBottom:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:""},customBack:{type:Function,default:null}},data:function(){return{menuButtonInfo:i,statusBarHeight:r.statusBarHeight}},computed:{navbarInnerStyle:function(){var t={};return t.height=this.navbarHeight+"px",t},navbarStyle:function(){var t={};return t.zIndex=this.zIndex?this.zIndex:this.$u.zIndex.navbar,Object.assign(t,this.background),t},titleStyle:function(){var t={};return t.left=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.right=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.width=uni.upx2px(this.titleWidth)+"px",t},navbarHeight:function(){return this.height?this.height:44}},created:function(){},methods:{goBack:function(){"function"===typeof this.customBack?this.customBack.bind(this.$u.$parent.call(this))():uni.navigateBack()}}}},"66f6":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,".mescroll-body[data-v-6b5ff080]{position:relative; /* 下拉刷新区域相对自身定位 */height:auto; /* 不可固定高度,否则overflow:hidden导致无法滑动; 同时使设置的最小高生效,实现列表不满屏仍可下拉*/overflow:hidden; /* 当有元素写在mescroll-body标签前面时,可遮住下拉刷新区域 */box-sizing:border-box /* 避免设置padding出现双滚动条的问题 */}\r\n\r\n/* 使sticky生效: 父元素不能overflow:hidden或者overflow:auto属性 */.mescroll-body.mescorll-sticky[data-v-6b5ff080]{overflow:unset!important}\r\n\r\n/* 适配 iPhoneX */@supports (bottom:constant(safe-area-inset-bottom)) or (bottom:env(safe-area-inset-bottom)){.mescroll-safearea[data-v-6b5ff080]{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}}\r\n\r\n/* 下拉刷新区域 */.mescroll-downwarp[data-v-6b5ff080]{position:absolute;top:-100%;left:0;width:100%;height:100%;text-align:center}\r\n\r\n/* 下拉刷新--内容区,定位于区域底部 */.mescroll-downwarp .downwarp-content[data-v-6b5ff080]{position:absolute;left:0;bottom:0;width:100%;min-height:%?60?%;padding:%?20?% 0;text-align:center}\r\n\r\n/* 下拉刷新--提示文本 */.mescroll-downwarp .downwarp-tip[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle;margin-left:%?16?%\r\n\t/* color: gray; 已在style设置color,此处删去*/}\r\n\r\n/* 下拉刷新--旋转进度条 */.mescroll-downwarp .downwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-downwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}\r\n\r\n/* 上拉加载区域 */.mescroll-upwarp[data-v-6b5ff080]{box-sizing:border-box;min-height:%?110?%;padding:%?30?% 0;text-align:center;clear:both}\r\n\r\n/*提示文本 */.mescroll-upwarp .upwarp-tip[data-v-6b5ff080],\r\n.mescroll-upwarp .upwarp-nodata[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle\r\n\t/* color: gray; 已在style设置color,此处删去*/}.mescroll-upwarp .upwarp-tip[data-v-6b5ff080]{margin-left:%?16?%}\r\n\r\n/*旋转进度条 */.mescroll-upwarp .upwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-upwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}",""]),t.exports=e},"680e":function(t,e,n){"use strict";n.r(e);var r=n("8cc1"),i=n("0f4f");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("5e8e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"adf85ec2",null,!1,r["a"],a);e["default"]=c.exports},"6a1a":function(t,e,n){var r=n("c35c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("221bf9c5",r,!0,{sourceMap:!1,shadowMode:!1})},"6ccf":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-calendar[data-v-7de526b6]{color:#606266}.u-calendar__header[data-v-7de526b6]{width:100%;box-sizing:border-box;font-size:%?30?%;background-color:#fff;color:#303133}.u-calendar__header__text[data-v-7de526b6]{margin-top:%?30?%;padding:0 %?60?%;display:flex;flex-direction:row;justify-content:center;align-items:center}.u-calendar__action[data-v-7de526b6]{padding:%?40?% 0 %?40?% 0}.u-calendar__action__icon[data-v-7de526b6]{margin:0 %?16?%}.u-calendar__action__text[data-v-7de526b6]{padding:0 %?16?%;color:#303133;font-size:%?32?%;line-height:%?32?%;font-weight:700}.u-calendar__week-day[data-v-7de526b6]{display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden}.u-calendar__week-day__text[data-v-7de526b6]{flex:1;text-align:center}.u-calendar__content[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;padding:6px 0;box-sizing:border-box;background-color:#fff;position:relative}.u-calendar__content--end-date[data-v-7de526b6]{border-top-right-radius:%?8?%;border-bottom-right-radius:%?8?%}.u-calendar__content--start-date[data-v-7de526b6]{border-top-left-radius:%?8?%;border-bottom-left-radius:%?8?%}.u-calendar__content__item[data-v-7de526b6]{width:14.2857%;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden;position:relative;z-index:2}.u-calendar__content__item__inner[data-v-7de526b6]{height:%?84?%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;font-size:%?32?%;position:relative;border-radius:50%}.u-calendar__content__item__inner__desc[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:center center;transform-origin:center center;position:absolute;left:0;text-align:center;bottom:%?2?%}.u-calendar__content__item__tips[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;position:absolute;left:0;-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;text-align:center;bottom:%?8?%;z-index:2}.u-calendar__content__bg-month[data-v-7de526b6]{position:absolute;font-size:130px;line-height:130px;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#e4e7ed;z-index:1}.u-calendar__bottom[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;background-color:#fff;padding:0 %?40?% %?30?%;box-sizing:border-box;font-size:%?24?%;color:#909399}.u-calendar__bottom__choose[data-v-7de526b6]{height:%?50?%}.u-calendar__bottom__btn[data-v-7de526b6]{width:100%}',""]),t.exports=e},"6e0a":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={data:function(){return{wxsProp:{optDown:{},scrollTop:0,bodyHeight:0,isDownScrolling:!1,isUpScrolling:!1,isScrollBody:!0,isUpBoth:!0,t:0},callProp:{callType:"",t:0}}},methods:{wxsCall:function(t){"setWxsProp"===t.type?this.wxsProp={optDown:this.mescroll.optDown,scrollTop:this.mescroll.getScrollTop(),bodyHeight:this.mescroll.getBodyHeight(),isDownScrolling:this.mescroll.isDownScrolling,isUpScrolling:this.mescroll.isUpScrolling,isUpBoth:this.mescroll.optUp.isBoth,isScrollBody:this.mescroll.isScrollBody,t:Date.now()}:"setLoadType"===t.type?(this.downLoadType=t.downLoadType,this.$set(this.mescroll,"downLoadType",this.downLoadType),this.$set(this.mescroll,"isDownEndSuccess",null)):"triggerDownScroll"===t.type?this.mescroll.triggerDownScroll():"endDownScroll"===t.type?this.mescroll.endDownScroll():"triggerUpScroll"===t.type&&this.mescroll.triggerUpScroll(!0)}},mounted:function(){var t=this;this.mescroll.optDown.afterLoading=function(){t.callProp={callType:"showLoading",t:Date.now()}},this.mescroll.optDown.afterEndDownScroll=function(){t.callProp={callType:"endDownScroll",t:Date.now()};var e=300+(t.mescroll.optDown.beforeEndDelay||0);setTimeout((function(){4!==t.downLoadType&&0!==t.downLoadType||(t.callProp={callType:"clearTransform",t:Date.now()}),t.$set(t.mescroll,"downLoadType",t.downLoadType)}),e)},this.wxsCall({type:"setWxsProp"})}};e.default=r},"6eaa":function(t,e,n){"use strict";n.r(e);var r=n("1078"),i=n("9ac8");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},"6ef1":function(t,e,n){"use strict";n.r(e);var r=n("0416"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"6f5a":function(t,e,n){var r=n("66f6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("704c32ba",r,!0,{sourceMap:!1,shadowMode:!1})},"71e9":function(t,e,n){var r=n("3f29");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("577b2531",r,!0,{sourceMap:!1,shadowMode:!1})},"73cb":function(t,e,n){"use strict";n.r(e);var r=n("24c0"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"752f":function(t,e,n){"use strict";var r=function(t){(t.options.wxs||(t.options.wxs={}))["wxsBiz"]=function(t){var e={};function n(t){t&&(e.optDown=t.optDown,e.scrollTop=t.scrollTop,e.bodyHeight=t.bodyHeight,e.isDownScrolling=t.isDownScrolling,e.isUpScrolling=t.isUpScrolling,e.isUpBoth=t.isUpBoth,e.isScrollBody=t.isScrollBody,e.startTop=t.scrollTop)}function r(t,n,r){e.disabled()||t.callType&&("showLoading"===t.callType?e.showLoading(r):"endDownScroll"===t.callType?e.endDownScroll(r):"clearTransform"===t.callType&&e.clearTransform(r))}function i(t,n){e.downHight=0,e.startPoint=e.getPoint(t),e.startTop=e.getScrollTop(),e.startAngle=0,e.lastPoint=e.startPoint,e.maxTouchmoveY=e.getBodyHeight()-e.optDown.bottomOffset,e.inTouchend=!1,e.callMethod(n,{type:"setWxsProp"})}function o(t,n){var r=!0;if(e.disabled())return r;var i=e.getScrollTop(),o=e.getPoint(t),u=o.y-e.startPoint.y;if(u>0&&(e.isScrollBody&&i<=0||!e.isScrollBody&&(i<=0||i<=e.optDown.startTop&&i===e.startTop))&&!e.inTouchend&&!e.isDownScrolling&&!e.optDown.isLock&&(!e.isUpScrolling||e.isUpScrolling&&e.isUpBoth)){if(e.startAngle||(e.startAngle=e.getAngle(e.lastPoint,o)),e.startAngle0&&o.y>=e.maxTouchmoveY)return e.inTouchend=!0,a(t,n),r;r=!1;var c=o.y-e.lastPoint.y;e.downHight0?c*e.optDown.outOffsetRate:c),e.downHight=Math.round(e.downHight);var s=e.downHight/e.optDown.offset;e.onMoving(n,s,e.downHight)}return e.lastPoint=o,r}function a(t,n){if(e.isMoveDown)e.downHight>=e.optDown.offset?(e.downHight=e.optDown.offset,e.callMethod(n,{type:"triggerDownScroll"})):(e.downHight=0,e.callMethod(n,{type:"endDownScroll"})),e.movetype=0,e.isMoveDown=!1;else if(!e.isScrollBody&&e.getScrollTop()===e.startTop){var r=e.getPoint(t).y-e.startPoint.y<0;if(r){var i=e.getAngle(e.getPoint(t),e.startPoint);i>80&&e.callMethod(n,{type:"triggerUpScroll"})}}e.callMethod(n,{type:"setWxsProp"})}return e.onMoving=function(t,e,n){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"transform",transform:"translateY("+n+"px)",transition:""});var r=t.selectComponent(".mescroll-wxs-progress");r&&r.setStyle({transform:"rotate("+360*e+"deg)"})}))},e.showLoading=function(t){e.downHight=e.optDown.offset,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY("+e.downHight+"px)",transition:"transform 300ms"})}))},e.endDownScroll=function(t){e.downHight=0,e.isDownScrolling=!1,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY(0)",transition:"transform 300ms"})}))},e.clearTransform=function(t){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"",transform:"",transition:""})}))},e.disabled=function(){return!e.optDown||!e.optDown.use||e.optDown.native},e.getPoint=function(t){return t?t.touches&&t.touches[0]?{x:t.touches[0].pageX,y:t.touches[0].pageY}:t.changedTouches&&t.changedTouches[0]?{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY}:{x:t.clientX,y:t.clientY}:{x:0,y:0}},e.getAngle=function(t,e){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=Math.sqrt(n*n+r*r),o=0;return 0!==i&&(o=Math.asin(r/i)/Math.PI*180),o},e.getScrollTop=function(){return e.scrollTop||0},e.getBodyHeight=function(){return e.bodyHeight||0},e.callMethod=function(t,e){t&&t.callMethod("wxsCall",e)},t.exports={propObserver:n,callObserver:r,touchstartEvent:i,touchmoveEvent:o,touchendEvent:a},t.exports}({exports:{}})};e["a"]=r},"75c4":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-select__action[data-v-70094335]{position:relative;line-height:%?70?%;height:%?70?%}.u-select__action__icon[data-v-70094335]{position:absolute;right:%?20?%;top:50%;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:1}.u-select__action__icon--reverse[data-v-70094335]{-webkit-transform:rotate(-180deg) translateY(50%);transform:rotate(-180deg) translateY(50%)}.u-select__hader__title[data-v-70094335]{color:#606266}.u-select--border[data-v-70094335]{border-radius:%?6?%;border-radius:4px;border:1px solid #dcdfe6}.u-select__header[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:%?80?%;padding:0 %?40?%}.u-select__body[data-v-70094335]{width:100%;height:%?500?%;overflow:hidden;background-color:#fff}.u-select__body__picker-view[data-v-70094335]{height:100%;box-sizing:border-box}.u-select__body__picker-view__item[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:%?32?%;color:#303133;padding:0 %?8?%}',""]),t.exports=e},"76db":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-select"},[n("u-popup",{attrs:{maskCloseAble:t.maskCloseAble,mode:"bottom",popup:!1,length:"auto",safeAreaInsetBottom:t.safeAreaInsetBottom,"z-index":t.uZIndex},on:{close:function(e){arguments[0]=e=t.$handleEvent(e),t.close.apply(void 0,arguments)}},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[n("v-uni-view",{staticClass:"u-select"},[n("v-uni-view",{staticClass:"u-select__header",on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e)}}},[n("v-uni-view",{staticClass:"u-select__header__cancel u-select__header__btn",style:{color:t.cancelColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getResult("cancel")}}},[t._v(t._s(t.cancelText))]),n("v-uni-view",{staticClass:"u-select__header__title"},[t._v(t._s(t.title))]),n("v-uni-view",{staticClass:"u-select__header__confirm u-select__header__btn",style:{color:t.moving?t.cancelColor:t.confirmColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{touchmove:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.getResult("confirm")}}},[t._v(t._s(t.confirmText))])],1),n("v-uni-view",{staticClass:"u-select__body"},[t.value?n("v-uni-picker-view",{staticClass:"u-select__body__picker-view",attrs:{value:t.defaultSelector},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.columnChange.apply(void 0,arguments)},pickstart:function(e){arguments[0]=e=t.$handleEvent(e),t.pickstart.apply(void 0,arguments)},pickend:function(e){arguments[0]=e=t.$handleEvent(e),t.pickend.apply(void 0,arguments)}}},t._l(t.columnData,(function(e,r){return n("v-uni-picker-view-column",{key:r},t._l(e,(function(e,r){return n("v-uni-view",{key:r,staticClass:"u-select__body__picker-view__item"},[n("v-uni-view",{staticClass:"u-line-1"},[t._v(t._s(e[t.labelName]))])],1)})),1)})),1):t._e()],1)],1)],1)],1)},o=[]},7860:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("99af"),n("ac1f"),n("5319"),n("fb6a"),n("a630"),n("3ca3"),n("d3b7"),n("ddb0");e.default={name:"u-calendar",props:{safeAreaInsetBottom:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},value:{type:Boolean,default:!1},zIndex:{type:[String,Number],default:0},changeYear:{type:Boolean,default:!0},changeMonth:{type:Boolean,default:!0},mode:{type:String,default:"date"},maxYear:{type:[Number,String],default:2050},minYear:{type:[Number,String],default:1950},minDate:{type:[Number,String],default:"1950-01-01"},maxDate:{type:[Number,String],default:""},borderRadius:{type:[String,Number],default:20},monthArrowColor:{type:String,default:"#606266"},yearArrowColor:{type:String,default:"#909399"},color:{type:String,default:"#303133"},activeBgColor:{type:String,default:"#2979ff"},activeColor:{type:String,default:"#ffffff"},rangeBgColor:{type:String,default:"rgba(41,121,255,0.13)"},rangeColor:{type:String,default:"#2979ff"},startText:{type:String,default:"开始"},endText:{type:String,default:"结束"},btnType:{type:String,default:"primary"},isActiveCurrent:{type:Boolean,default:!0},isChange:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},toolTip:{type:String,default:"选择日期"}},data:function(){return{weekday:1,weekdayArr:[],days:0,daysArr:[],showTitle:"",year:2020,month:0,day:0,startYear:0,startMonth:0,startDay:0,endYear:0,endMonth:0,endDay:0,today:"",activeDate:"",startDate:"",endDate:"",isStart:!0,min:null,max:null,weekDayZh:["日","一","二","三","四","五","六"]}},computed:{dataChange:function(){return"".concat(this.mode,"-").concat(this.minDate,"-").concat(this.maxDate)},uZIndex:function(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},watch:{dataChange:function(t){this.init()}},created:function(){this.init()},methods:{getColor:function(t,e){var n=1==e?"":this.color,r=t+1,i="".concat(this.year,"-").concat(this.month,"-").concat(r),o=new Date(i.replace(/\-/g,"/")).getTime(),a=this.startDate.replace(/\-/g,"/"),u=this.endDate.replace(/\-/g,"/");return this.isActiveCurrent&&this.activeDate==i||this.startDate==i||this.endDate==i?n=1==e?this.activeBgColor:this.activeColor:this.endDate&&o>new Date(a).getTime()&&on&&(t=n),this.year=t.getFullYear(),this.month=t.getMonth()+1,this.day=t.getDate(),this.today="".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()),this.activeDate=this.today,this.min=this.initDate(this.minDate),this.max=this.initDate(this.maxDate||this.today),this.startDate="",this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.endDate="",this.isStart=!0,this.changeData()},initDate:function(t){var e=t.split("-");return{year:Number(e[0]||1920),month:Number(e[1]||1),day:Number(e[2]||1)}},openDisAbled:function(t,e,n){var r=!0,i="".concat(t,"/").concat(e,"/").concat(n),o="".concat(this.min.year,"/").concat(this.min.month,"/").concat(this.min.day),a="".concat(this.max.year,"/").concat(this.max.month,"/").concat(this.max.day),u=new Date(i).getTime();return u>=new Date(o).getTime()&&u<=new Date(a).getTime()&&(r=!1),r},generateArray:function(t,e){return Array.from(new Array(e+1).keys()).slice(t)},formatNum:function(t){return t<10?"0"+t:t+""},getMonthDay:function(t,e){var n=new Date(t,e,0).getDate();return n},getWeekday:function(t,e){var n=new Date("".concat(t,"/").concat(e,"/01 00:00:00"));return n.getDay()},checkRange:function(t){var e=!1;return(tthis.maxYear)&&(uni.showToast({title:"日期超出范围啦~",icon:"none"}),e=!0),e},changeMonthHandler:function(t){if(t){var e=this.month+1,n=e>12?this.year+1:this.year;this.checkRange(n)||(this.month=e>12?1:e,this.year=n,this.changeData())}else{var r=this.month-1,i=r<1?this.year-1:this.year;this.checkRange(i)||(this.month=r<1?12:r,this.year=i,this.changeData())}},changeYearHandler:function(t){var e=t?this.year+1:this.year-1;this.checkRange(e)||(this.year=e,this.changeData())},changeData:function(){this.days=this.getMonthDay(this.year,this.month),this.daysArr=this.generateArray(1,this.days),this.weekday=this.getWeekday(this.year,this.month),this.weekdayArr=this.generateArray(1,this.weekday),this.showTitle="".concat(this.year,"年").concat(this.month,"月"),this.isChange&&"date"==this.mode&&this.btnFix(!0)},dateClick:function(t){if(t+=1,!this.openDisAbled(this.year,this.month,t)){this.day=t;var e="".concat(this.year,"-").concat(this.month,"-").concat(t);if("date"==this.mode)this.activeDate=e;else{var n=new Date(e.replace(/\-/g,"/")).getTime()0?n("v-uni-view",{staticClass:"mescroll-bottombar",style:{height:t.windowBottom+"px"}}):t._e(),t.safearea?n("v-uni-view",{staticClass:"mescroll-safearea"}):t._e(),n("mescroll-top",{attrs:{option:t.mescroll.optUp.toTop},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}},model:{value:t.isShowToTop,callback:function(e){t.isShowToTop=e},expression:"isShowToTop"}}),n("v-uni-view",{wxsProps:{"change:prop":"wxsProp"},attrs:{"change:prop":t.renderBiz.propObserver,prop:t.wxsProp}})],1)},o=[]},"980a":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-swipe-action[data-v-1adff301]{width:auto;height:auto;position:relative;overflow:hidden}.u-swipe-view[data-v-1adff301]{display:flex;flex-direction:row;height:auto;position:relative\n /* 这一句很关键,覆盖默认的绝对定位 */}.u-swipe-content[data-v-1adff301]{flex:1}.u-swipe-del[data-v-1adff301]{position:relative;font-size:%?30?%;color:#fff}.u-btn-text[data-v-1adff301]{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}',""]),t.exports=e},9971:function(module,exports,__webpack_require__){"use strict";__webpack_require__("7a82");var _interopRequireDefault=__webpack_require__("ee27").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _slicedToArray2=_interopRequireDefault(__webpack_require__("d0af")),_typeof2=_interopRequireDefault(__webpack_require__("0122")),_createForOfIteratorHelper2=_interopRequireDefault(__webpack_require__("54f8"));__webpack_require__("4de4"),__webpack_require__("d3b7"),__webpack_require__("d81d"),__webpack_require__("c975"),__webpack_require__("159b"),__webpack_require__("b64b"),__webpack_require__("7db0"),__webpack_require__("c760"),__webpack_require__("f8c9"),__webpack_require__("caad"),__webpack_require__("2532"),__webpack_require__("14d9"),__webpack_require__("4fadc"),__webpack_require__("ac1f"),__webpack_require__("00b4"),__webpack_require__("466d"),__webpack_require__("498a");var _SearchItem=_interopRequireDefault(__webpack_require__("c881")),_lodashEs=__webpack_require__("4fcf6"),_default2=exports.default={props:{schemas:{type:Array,default:function(){return[]}}},components:{SearchItem:_SearchItem.default},computed:{formActionType:function formActionType(){var _this=this;return{setFieldsValue:function setFieldsValue(values){var fields=_this.getSchema.map((function(t){return t.field})).filter(Boolean),delimiter=".",nestKeyArray=fields.filter((function(t){return t.indexOf(delimiter)>=0})),validKeys=[];Object.keys(values).forEach((function(key){var schema=_this.getSchema.find((function(t){return t.field===key})),value=values[key],hasKey=Reflect.has(values,key);hasKey&&fields.includes(key)?(_this.formModel[key]=value,validKeys.push(key)):nestKeyArray.forEach((function(nestKey){try{var _value=eval("values"+delimiter+nestKey);_this.isDef(_value)&&(_this.formModel[nestKey]=_value,validKeys.push(nestKey))}catch(e){_this.isDef(defaultValueRef.value[nestKey])&&(_this.formModel[nestKey]=(0,_lodashEs.cloneDeep)(defaultValueRef.value[nestKey]))}}))}))}}},getSchema:function(){var t,e=this.schemas,n=(0,_createForOfIteratorHelper2.default)(e);try{for(n.s();!(t=n.n()).done;)t.value}catch(r){n.e(r)}finally{n.f()}return(0,_lodashEs.cloneDeep)(e)}},data:function(){return{isOpen:!1,formModel:{}}},created:function(){this.initFormModel()},methods:{handleOpen:function(){console.log("====")},handleCloseDropdown:function(){var t;null===(t=this.$refs.dropdownRef)||void 0===t||t.close()},initFormModel:function(){var t=this.schemas,e={};t.forEach((function(t){var n=t.field,r=t.defaultValue;n&&(e[n]=r)})),this.formModel=e},handleInputNumberValue:function(t,e){return t&&["Input","InputPassword","InputSearch","InputTextArea"].includes(t)&&e&&this.isNumber(e)?"".concat(e):e},isDef:function(t){return"undefined"!==typeof t},isNumber:function(t){return"number"===typeof t&&!isNaN(t)},isArray:function(t){return Array.isArray(t)},isObject:function(t){return"object"===(0,_typeof2.default)(t)&&null!==t},isFunction:function(t){return"function"===typeof t},setFormModel:function(t,e){this.formModel[t]=e,this.$emit("field-value-change",t,e)},handleFormValues:function(t){if(!this.isObject(t))return{};for(var e={},n=function(){var t=i[r],n=(0,_slicedToArray2.default)(t,2),o=n[1],a=(0,_slicedToArray2.default)(t,1),u=a[0],c=/^\[(.+)\]$/;if(c.test(u)){var s=u.match(c)[1].split(",");s.forEach((function(t,n){var r,i=null!==(r=null===o||void 0===o?void 0:o[n])&&void 0!==r?r:"";i&&(e[t.trim()]=i)}))}else o&&(e[u]=o)},r=0,i=Object.entries(t);r=this.parent.max)return this.$u.toast("最多可选".concat(this.parent.max,"项"));this.emitEvent(),this.$emit("input",!this.value)}}}}},a96b:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{value:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"100%"},height:{type:String,default:"100%"}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}},data:function(){return{}}}},adb4:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{option:{type:Object,default:function(){return{}}},value:!1,modelValue:!1},computed:{left:function(){return this.option.left?this.addUnit(this.option.left):"auto"},right:function(){return this.option.left?"auto":this.addUnit(this.option.right)},isShow:function(){return this.value}},methods:{addUnit:function(t){return t?"number"===typeof t?t+"rpx":t:0},toTopClick:function(){this.$emit("input",!1),this.$emit("click")}}}},add5:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请选择日期"},params:{type:Object,default:function(){return{}}},mode:{type:String,default:"date"}},computed:{isRange:function(){return"range"===this.mode},placeholderStr:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.placeholder)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.placeholder)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.placeholder},status:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.date)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.date)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.date}},data:function(){return{show:!1,date:null}},methods:{openCalendar:function(){this.show=!0},handleChange:function(t){var e;if(this.isRange){var n=t.startDate,r=t.endDate;e=[n,r]}else e=t.result;this.$emit("change",e),this.$emit("input",e),this.date=e,this.$emit("close-dropdown",e)}},watch:{value:{handler:function(t){this.date=t},immediate:!0,deep:!0}}}},aec2:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("7db0"),n("d3b7"),n("c740"),n("13d5"),n("14d9");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},placeholder:{type:String,default:"请选择"}},data:function(){return{show:!1,isFirstLoad:!0,options:[]}},computed:{currentOption:function(){var t=this,e=this.getOptions.find((function(e){return e.value==t.value}));return null!==e&&void 0!==e?e:{}},showText:function(){var t,e;return null!==(t=null===(e=this.currentOption)||void 0===e?void 0:e.label)&&void 0!==t?t:this.value},defaultValue:function(){var t=this,e=this.getOptions.findIndex((function(e){return e.value==t.value}));return[e>-1?e:0]},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleConfirm:function(t){if(t.length){var e=t[0].value;null!=e&&(this.$emit("change",e),this.$emit("input",e))}},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},aecc:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("component",t._g(t._b({},"component",t.getBindValue.bind,!1),t.getBindValue.on))},o=[]},b14d:function(t,e,n){var r=n("86cb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("6d1ac5d2",r,!0,{sourceMap:!1,shadowMode:!1})},b471:function(t,e,n){"use strict";n.r(e);var r=n("fe9d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},b53f:function(t,e,n){"use strict";n.r(e);var r=n("f940"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},baac:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-line",style:[t.lineStyle]})},o=[]},bade:function(t,e,n){"use strict";n.r(e);var r=n("7860"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},bd0a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3"));n("d3b7"),n("159b"),n("14d9");var o=r(n("e350"));e.default={props:{value:{type:Boolean,default:!1},data:{type:Object,default:function(){}},colums:{type:Array,default:function(){return[]}},editAuth:{type:Array,default:function(){return[]}},delAuth:{type:Array,default:function(){return[]}}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}},isEdit:function(){return!!this.$listeners.onEdit&&(0,o.default)(this.editAuth)},isDel:function(){return!!this.$listeners.onDel&&(0,o.default)(this.delAuth)},columsList:function(){var t=this,e=[];return this.colums.forEach((function(n){var r=n.dataIndex,o=n.format,a=t.data[r];t.isFunction(o)&&(a=o(a)),e.push((0,i.default)((0,i.default)({},n),{},{value:a}))})),e}},methods:{isFunction:function(t){return"function"===typeof t},handleEdit:function(){this.$emit("onEdit",this.data)},handleDel:function(){this.$emit("onDel",this.data)}}}},bd58:function(t,e,n){"use strict";var r=n("b14d"),i=n.n(r);i.a},be8c:function(t,e,n){"use strict";n.r(e);var r=n("849d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},becc:function(t,e,n){"use strict";var r=n("6a1a"),i=n.n(r);i.a},c17b:function(t,e,n){"use strict";n.r(e);var r=n("2a6c"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},c35c:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-loading-circle[data-v-19cf7fca]{display:inline-flex;vertical-align:middle;width:%?28?%;height:%?28?%;background:0 0;border-radius:50%;border:2px solid;border-color:#e5e5e5 #e5e5e5 #e5e5e5 #8f8d8e;-webkit-animation:u-circle-data-v-19cf7fca 1s linear infinite;animation:u-circle-data-v-19cf7fca 1s linear infinite}.u-loading-flower[data-v-19cf7fca]{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}@-webkit-keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes u-circle-data-v-19cf7fca{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}',""]),t.exports=e},c4af:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3")),o=r(n("f07e")),a=r(n("c964"));n("d81d"),n("4de4"),n("d3b7"),n("99af");var u=r(n("d2f3")),c=r(n("02cd")),s=n("365c"),l=r(n("0b61")),f=r(n("0453")),d=r(n("12df")),p=r(n("4c48")),h=r(n("e350")),v=[{title:"基地名称",dataIndex:"name"},{title:"农业类型",dataIndex:"industry_label"},{title:"是否外部链接",dataIndex:"is_blank",format:function(t){return t?"是":"否"}},{title:"排序",dataIndex:"sort"},{title:"基地负责人",dataIndex:"person"},{title:"基地农作物",dataIndex:"crops",format:function(t){var e;return null!==(e=null===t||void 0===t?void 0:t.map((function(t){return t.name})).join(","))&&void 0!==e?e:""}},{title:"基地经度",dataIndex:"address_lng"},{title:"基地纬度",dataIndex:"address_lat"},{title:"基地地址",dataIndex:"address"},{title:"基地面积",dataIndex:"areas"},{title:"种养殖面积",dataIndex:"cultivated"},{title:"基地就业人数",dataIndex:"workforce"},{title:"基地描述",dataIndex:"description"}];e.default={mixins:[l.default],components:{SearchForm:c.default,Appbar:u.default,cuPopup:f.default,BaseTablePopup:d.default,BasicsEdit:p.default},data:function(){return{baseTableColums:v,currentData:null,filterParmas:{},downOption:{use:!1},upOption:{auto:!1,page:{size:20}},dataList:[],formShow:!1,baseShow:!1,searchFormSchema:[{field:"name",label:"名称",component:"Input",componentProps:{placeholder:"请输入名称"}},{field:"type",label:"农业类型",component:"ApiSelect",componentProps:function(t){t.formActionType;return{api:function(){var t=(0,a.default)((0,o.default)().mark((function t(e){var n,r;return(0,o.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s.http.get("/api/keywords-industry",{params:e});case 2:return n=t.sent,r=n.data,t.abrupt("return",r.data);case 5:case"end":return t.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}(),labelField:"name",valueField:"id"}}}]}},computed:{options:function(){return[].filter((function(t){return(0,h.default)(t.permission)}))}},methods:{handleSubmit:function(t){this.filterParmas=t,this.mescroll.resetUpScroll()},upCallback:function(t){var e=t.num,n=t.size;this.getData((0,i.default)((0,i.default)({},this.filterParmas),{},{page:e,per_page:n,type:1}))},getData:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){var r,i,a,u;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,s.http.get("/api/agricultural-basic",{params:t});case 3:r=n.sent,i=r.data,1==t.page&&(e.dataList=[]),a=i.data,u=i.meta,e.dataList=e.dataList.concat(a.map((function(t){return Object.assign({show:!1},t)}))),e.mescroll.endByPage(a.length,u.total),n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](0),e.mescroll.endErr();case 14:case"end":return n.stop()}}),n,null,[[0,11]])})))()},handleClick:function(t,e){var n=this.options[e].opt,r=this.dataList[t];this.currentData=r,"edit"==n?this.handleEdit(r):"delete"==n&&this.handleDel(r)},handleContentClick:function(t){this.currentData=this.dataList[t],uni.navigateTo({url:"/pages/basics/profile-detail?id=".concat(this.currentData.id)})},handleEdit:function(t){this.currentData=t,this.formShow=!0,this.baseShow=!1},handleDel:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:uni.showModal({title:"提示",content:"是否确定删除?",success:function(){var n=(0,a.default)((0,o.default)().mark((function n(r){var i;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!r.confirm){n.next=12;break}return n.prev=1,n.next=4,e.$http.delete("/api/agricultural-basic/".concat(t.id));case 4:e.mescroll.resetUpScroll(),e.baseShow=!1,n.next=12;break;case 8:n.prev=8,n.t0=n["catch"](1),i=n.t0.data,e.$u.toast(i.message);case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));function r(t){return n.apply(this,arguments)}return r}()});case 1:case"end":return n.stop()}}),n)})))()},handleCreate:function(){var t=this;return(0,a.default)((0,o.default)().mark((function e(){return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.currentData=null,t.formShow=!0,t.baseShow=!1;case 3:case"end":return e.stop()}}),e)})))()},handleEditConfirm:function(){this.mescroll.resetUpScroll(),this.formShow=!1}}}},c6c9:function(t,e,n){"use strict";n.r(e);var r=n("1794"),i=n("bade");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("cb36");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"7de526b6",null,!1,r["a"],a);e["default"]=c.exports},c6eb:function(t,e,n){"use strict";(function(t){var r=n("5ea3"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a&&r["a"].process,c=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(e){}}();e["a"]=c}).call(this,n("dd40")(t))},c760:function(t,e,n){"use strict";var r=n("23e7");r({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},c86e:function(t,e,n){"use strict";var r=n("353f"),i=n.n(r);i.a},c881:function(t,e,n){"use strict";n.r(e);var r=n("aecc"),i=n("338d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},c892:function(t,e,n){"use strict";n.r(e);var r=n("82d3"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},cb29:function(t,e,n){"use strict";var r=n("23e7"),i=n("81d5"),o=n("44d2");r({target:"Array",proto:!0},{fill:i}),o("fill")},cb36:function(t,e,n){"use strict";var r=n("7b18"),i=n.n(r);i.a},cc76:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-navbar[data-v-2920cc37]{width:100%}.u-navbar-fixed[data-v-2920cc37]{position:fixed;left:0;right:0;top:0;z-index:991}.u-status-bar[data-v-2920cc37]{width:100%}.u-navbar-inner[data-v-2920cc37]{display:flex;flex-direction:row;justify-content:space-between;position:relative;align-items:center}.u-back-wrap[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;flex:1;flex-grow:0;padding:%?14?% %?14?% %?14?% %?24?%}.u-back-text[data-v-2920cc37]{padding-left:%?4?%;font-size:%?30?%}.u-navbar-content-title[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;justify-content:center;flex:1;position:absolute;left:0;right:0;height:%?60?%;text-align:center;flex-shrink:0}.u-navbar-centent-slot[data-v-2920cc37]{flex:1}.u-title[data-v-2920cc37]{line-height:%?60?%;font-size:%?32?%;flex:1}.u-navbar-right[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.u-slot-content[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center}',""]),t.exports=e},d2f3:function(t,e,n){"use strict";n.r(e);var r=n("1744"),i=n("f14d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},d3c3:function(t,e,n){"use strict";n.r(e);var r=n("0084"),i=n("24fe");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("05d7");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"30d8d7e6",null,!1,r["a"],a);e["default"]=c.exports},d50a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("2ca0"),n("ac1f"),n("5319");var i=r(n("fc11")),o=r(n("f3f3")),a=r(n("9c49")),u=r(n("6eaa")),c=r(n("d3c3")),s=r(n("2fed")),l=n("4fcf6");e.default={props:{schema:{type:Object,default:function(){}},setFormModel:{type:Function,default:function(){}},formModel:{type:Object,default:function(){}},formActionType:{type:Object,default:function(){}},isOpen:{type:Boolean}},components:{ApiSelect:a.default,Select:u.default,Calendar:c.default,Input:s.default},created:function(){},computed:{getValues:function(){this.allDefaultValues;var t=this.formModel,e=this.schema;return{field:e.field,model:t,values:(0,o.default)({},t),schema:e}},getComponentsProps:function(){var t,e=this.schema,n=this.formModel,r=this.formActionType,i=e.componentProps,o=void 0===i?{}:i;this.isFunction(o)&&(o=null!==(t=o({schema:e,formModel:n,formActionType:r}))&&void 0!==t?t:{});return o},getBindValue:function(){var t,e=this,n=this.schema,r=n.component,a=n.field,u=n.changeEvent,c=void 0===u?"change":u,s=n.valueField,f=n.label,d="on".concat((0,l.upperFirst)(c)),p=(t={},(0,i.default)(t,d,(function(t){e.setFormModel(a,t)})),(0,i.default)(t,"onCloseDropdown",(function(){e.$emit("close-dropdown")})),t),h=(0,o.default)((0,o.default)({},this.getComponentsProps),{},{label:f});h.codeField=a,h.formValues=this.getValues;var v=(0,i.default)({},s||"value",this.formModel[a]),m=(0,o.default)((0,o.default)((0,o.default)((0,o.default)({is:r},h),v),p),{},{isOpen:this.isOpen}),g={},b={};for(var y in m)if(y.startsWith("on")&&"function"===typeof m[y]){var w=(0,l.kebabCase)(y.replace("on",""));g[w]=m[y]}else b[y]=m[y];return{bind:b,on:g}}},methods:{isFunction:function(t){return"function"===typeof t&&null!==t},fetch:function(){var t=this.formModel,e=this.schema,n=e.componentProps,r=void 0===n?{}:n,i=e.components;if(this.isFunction(r)&&(r=r({schema:e,formModel:t})),"ApiSelect"===i){var o=r,a=o.api;if(!a||!this.isFunction(a))return}else conponents;console.log(this.schema)}}}},d518:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uIcon:n("f86b").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{},[n("v-uni-view",{staticClass:"u-navbar",class:{"u-navbar-fixed":t.isFixed,"u-border-bottom":t.borderBottom},style:[t.navbarStyle]},[n("v-uni-view",{staticClass:"u-status-bar",style:{height:t.statusBarHeight+"px"}}),n("v-uni-view",{staticClass:"u-navbar-inner",style:[t.navbarInnerStyle]},[t.isBack?n("v-uni-view",{staticClass:"u-back-wrap",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goBack.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"u-icon-wrap"},[n("u-icon",{attrs:{name:t.backIconName,color:t.backIconColor,size:t.backIconSize}})],1),t.backText?n("v-uni-view",{staticClass:"u-icon-wrap u-back-text u-line-1",style:[t.backTextStyle]},[t._v(t._s(t.backText))]):t._e()],1):t._e(),t.title?n("v-uni-view",{staticClass:"u-navbar-content-title",style:[t.titleStyle]},[n("v-uni-view",{staticClass:"u-title u-line-1",style:{color:t.titleColor,fontSize:t.titleSize+"rpx",fontWeight:t.titleBold?"bold":"normal"}},[t._v(t._s(t.title))])],1):t._e(),n("v-uni-view",{staticClass:"u-slot-content"},[t._t("default")],2),n("v-uni-view",{staticClass:"u-slot-right"},[t._t("right")],2)],1)],1),t.isFixed&&!t.immersive?n("v-uni-view",{staticClass:"u-navbar-placeholder",style:{width:"100%",height:Number(t.navbarHeight)+t.statusBarHeight+"px"}}):t._e()],1)},o=[]},d54d:function(t,e,n){"use strict";n.r(e);var r=n("62f2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},da66:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={def:"zh",getType:function(){return uni.getStorageSync("mescroll-i18n")||this.def},setType:function(t){uni.setStorageSync("mescroll-i18n",t)}};e.default=r},db00:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.inp[data-v-30d8d7e6]{border-radius:%?4?%;border-width:1px;-webkit-box-flex:1;-ms-flex:1 1 0%;-webkit-flex:1 1 0%;flex:1 1 0%;height:%?60?%;line-height:%?60?%;padding-left:10px;padding-right:10px}',""]),t.exports=e},dd40:function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},df51:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.option.src?n("v-uni-image",{staticClass:"mescroll-totop",class:[t.isShow?"mescroll-totop-in":"mescroll-totop-out",{"mescroll-totop-safearea":t.option.safearea}],style:{"z-index":t.option.zIndex,left:t.left,right:t.right,bottom:t.addUnit(t.option.bottom),width:t.addUnit(t.option.width),"border-radius":t.addUnit(t.option.radius)},attrs:{src:t.option.src,mode:"widthFix"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}}}):t._e()},o=[]},dff1:function(t,e,n){"use strict";(function(t){var r=n("26ee"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a?r["a"].Buffer:void 0,c=u?u.allocUnsafe:void 0;function s(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}e["a"]=s}).call(this,n("dd40")(t))},e10c:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uCheckboxGroup:n("e620").default,uCheckbox:n("1e79").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-checkbox-group",{on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxGroupChange.apply(void 0,arguments)}}},t._l(t.getOptions,(function(e,r){return n("u-checkbox",{key:e.value,attrs:{name:e.value},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxChange.apply(void 0,arguments)}},model:{value:e.checked,callback:function(n){t.$set(e,"checked",n)},expression:"item.checked"}},[t._v(t._s(e.label))])})),1)],1)},o=[]},e249:function(t,e,n){var r=n("980a");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("34ca650a",r,!0,{sourceMap:!1,shadowMode:!1})},e350:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,n("d3b7"),n("caad"),n("2532");var i=r(n("4360"));function o(t){if(t&&t instanceof Array&&t.length>0){var e,n,r=i.default.getters&&(null!==(e=null===(n=i.default.getters.userInfo)||void 0===n?void 0:n.permissions_slug)&&void 0!==e?e:[]),o=t,a=r.some((function(t){return o.includes(t)}));return a}return!1}},e407:function(t,e,n){"use strict";var r=n("f6315"),i=n.n(r);i.a},e620:function(t,e,n){"use strict";n.r(e);var r=n("9cbc"),i=n("e8d7");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("c86e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"2c57e935",null,!1,r["a"],a);e["default"]=c.exports},e63d:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("d81d"),n("14d9");var i=r(n("4fff"));e.default={name:"u-checkbox-group",mixins:[i.default],props:{max:{type:[Number,String],default:999},disabled:{type:Boolean,default:!1},name:{type:[Boolean,String],default:""},labelDisabled:{type:Boolean,default:!1},shape:{type:String,default:"square"},activeColor:{type:String,default:"#2979ff"},size:{type:[String,Number],default:34},width:{type:String,default:"auto"},wrap:{type:Boolean,default:!1},iconSize:{type:[String,Number],default:20}},data:function(){return{}},created:function(){this.children=[]},methods:{emitEvent:function(){var t=this,e=[];this.children.map((function(t){t.value&&e.push(t.name)})),this.$emit("change",e),setTimeout((function(){t.dispatch("u-form-item","on-form-change",e)}),60)}}}},e859:function(t,e,n){"use strict";n.r(e);var r=n("aec2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e8d7:function(t,e,n){"use strict";n.r(e);var r=n("e63d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e941:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("0aec"));e.default={mixins:[i.default]}},e945:function(t,e,n){"use strict";n.r(e);var r=n("c4af"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e96b:function(t,e,n){var r=n("0c42");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("7db8cb9e",r,!0,{sourceMap:!1,shadowMode:!1})},edb7:function(t,e,n){"use strict";var r=n("467c"),i=n.n(r);i.a},ee32:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uSticky:n("680e").default,mescrollBody:n("4d90").default,uSwipeAction:n("844c").default,uLine:n("ee53").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-sticky",[n("v-uni-view",{staticClass:"bg-white"},[n("SearchForm",{attrs:{schemas:t.searchFormSchema},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.handleSubmit.apply(void 0,arguments)}}})],1)],1),n("mescroll-body",{attrs:{up:t.upOption,down:t.downOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",t._l(t.dataList,(function(e,r){return n("u-swipe-action",{key:e.id,staticClass:"my-20rpx mx-30rpx rounded-md overflow-hidden",attrs:{show:e.show,index:r,options:t.options},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleClick.apply(void 0,arguments)},"content-click":function(e){arguments[0]=e=t.$handleEvent(e),t.handleContentClick.apply(void 0,arguments)}}},[n("v-uni-view",[n("v-uni-view",{staticClass:"bg-white p-20rpx"},[n("v-uni-view",[t._v("基地名称:"+t._s(e.name))]),n("v-uni-view",[t._v("农业类型:"+t._s(e.industry_label))]),n("v-uni-view",{staticClass:"my-12rpx"},[n("u-line")],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v("基地面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("种养殖面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("就业人数")])],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.areas))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.cultivated))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.workforce))])],1)],1)],1)],1)})),1)],1)],1)},o=[]},ee53:function(t,e,n){"use strict";n.r(e);var r=n("baac"),i=n("24ae");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("bd58");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"3ed11d5a",null,!1,r["a"],a);e["default"]=c.exports},f039:function(t,e,n){"use strict";n.r(e);var r=n("4e37"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f14d:function(t,e,n){"use strict";n.r(e);var r=n("a87e"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f2d8:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdown:n("20b3").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-dropdown",{ref:"dropdownRef",class:{dropdownClose:!t.isOpen},on:{open:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!0},close:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!1}}},t._l(t.getSchema,(function(e){return n("SearchItem",{key:e.field,attrs:{schema:e,formModel:t.formModel,setFormModel:t.setFormModel,formActionType:t.formActionType,isOpen:t.isOpen},on:{"close-dropdown":function(e){arguments[0]=e=t.$handleEvent(e),t.handleCloseDropdown.apply(void 0,arguments)}}})})),1),n("portal-target",{attrs:{name:"calendar-portal"}})],1)},o=[]},f3be:function(t,e,n){"use strict";var r=n("ffff"),i=n.n(r);i.a},f6315:function(t,e,n){var r=n("5fea");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("46f1aafd",r,!0,{sourceMap:!1,shadowMode:!1})},f68e:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-popup",{attrs:{closeable:!0,width:t.width,height:t.width,mode:"center"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("v-uni-view",{staticClass:"relative h-full flex flex-col overflow-hidden"},[n("v-uni-view",{staticClass:"h-86rpx leading-86rpx flex-center w-full"},[t._t("title",[n("v-uni-view",{staticClass:"text-34rpx"},[t._v(t._s(t.title))])])],2),n("v-uni-view",{staticClass:"flex-1 overflow-y-auto w-full"},[t._t("default")],2),n("v-uni-view",[t._t("bottom")],2)],1)],1)},o=[]},f839:function(t,e,n){"use strict";var r=n("71e9"),i=n.n(r);i.a},f918:function(t,e,n){"use strict";var r=n("62be"),i=n.n(r);i.a},f926:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdownItem:n("0dcd").default,uInput:n("d5da").default,uLine:n("ee53").default,uButton:n("d9ad").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-dropdown-item",{attrs:{title:t.label}},[n("v-uni-view",{staticClass:"bg-white p-30rpx"},[n("u-input",{staticClass:"flex-1",attrs:{placeholder:t.placeholder},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}}),n("v-uni-view",{staticClass:"my-20rpx"},[n("u-line")],1),n("u-button",{attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleChange.apply(void 0,arguments)}}},[t._v("确定")])],1)],1)},o=[]},f940:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={name:"u-swipe-action",props:{index:{type:[Number,String],default:""},btnWidth:{type:[String,Number],default:180},disabled:{type:Boolean,default:!1},show:{type:Boolean,default:!1},bgColor:{type:String,default:"#ffffff"},vibrateShort:{type:Boolean,default:!1},options:{type:Array,default:function(){return[]}}},watch:{show:{immediate:!0,handler:function(t,e){t?this.open():this.close()}}},data:function(){return{moveX:0,scrollX:0,status:!1,movableAreaWidth:0,elId:this.$u.guid(),showBtn:!1}},computed:{movableViewWidth:function(){return this.movableAreaWidth+this.allBtnWidth+"px"},innerBtnWidth:function(){return uni.upx2px(this.btnWidth)},allBtnWidth:function(){return uni.upx2px(this.btnWidth)*this.options.length},btnStyle:function(){var t=this;return function(e){return e.width=t.btnWidth+"rpx",e}}},mounted:function(){this.getActionRect()},methods:{btnClick:function(t){this.status=!1,this.$emit("click",this.index,t)},change:function(t){this.scrollX=t.detail.x},close:function(){this.moveX=0,this.status=!1},open:function(){this.disabled||(this.moveX=-this.allBtnWidth,this.status=!0)},touchend:function(){this.moveX=this.scrollX,this.$nextTick((function(){var t=this;0==this.status?this.scrollX<=-this.allBtnWidth/4?(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent(),this.vibrateShort&&uni.vibrateShort()):(this.moveX=0,this.status=!1,this.emitCloseEvent()):this.scrollX>3*-this.allBtnWidth/4?(this.moveX=0,this.$nextTick((function(){t.moveX=101})),this.status=!1,this.emitCloseEvent()):(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent())}))},emitOpenEvent:function(){this.$emit("open",this.index)},emitCloseEvent:function(){this.$emit("close",this.index)},touchstart:function(){},getActionRect:function(){var t=this;this.$uGetRect(".u-swipe-action").then((function(e){t.movableAreaWidth=e.width,t.$nextTick((function(){t.showBtn=!0}))}))},contentClick:function(){1==this.status&&(this.status="close",this.moveX=0),this.$emit("content-click",this.index)}}}},fe9d:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请输入"},isOpen:{type:Boolean}},computed:{},data:function(){return{status:""}},methods:{handleChange:function(){this.$emit("change",this.status),this.$emit("close-dropdown",this.status)}},watch:{isOpen:{handler:function(t){this.status=this.value},immediate:!0}}}},ffff:function(t,e,n){var r=n("75c4");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("2143248c",r,!0,{sourceMap:!1,shadowMode:!1})}}]); \ No newline at end of file + */},"58e0":function(t,e,n){"use strict";(function(t){var r=n("26ee"),i=n("2f74"),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=a&&a.exports===o,c=u?r["a"].Buffer:void 0,s=c?c.isBuffer:void 0,l=s||i["a"];e["a"]=l}).call(this,n("dd40")(t))},"5e8e":function(t,e,n){"use strict";var r=n("83cc"),i=n.n(r);i.a},"5ea3":function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e["a"]=n}).call(this,n("c8ba"))},"5f04":function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("13d5"),n("d3b7"),n("14d9"),n("4de4");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},label:{type:String,default:""},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"}},computed:{status:{get:function(){return this.value},set:function(t){this.$emit("change",t),this.$emit("input",t)}},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},data:function(){return{options:[],emitData:null,isFirstLoad:!0}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleChange:function(t){var e=this.getOptions.filter((function(e){return e.value==t}));this.emitData=e},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},"5fea":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-checkbox[data-v-7e6e0538]{display:inline-flex;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none;line-height:1.8}.u-checkbox__icon-wrap[data-v-7e6e0538]{color:#606266;flex:none;display:-webkit-flex;display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;width:%?42?%;height:%?42?%;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;border:1px solid #c8c9cc;transition-duration:.2s}.u-checkbox__icon-wrap--circle[data-v-7e6e0538]{border-radius:100%}.u-checkbox__icon-wrap--square[data-v-7e6e0538]{border-radius:%?6?%}.u-checkbox__icon-wrap--checked[data-v-7e6e0538]{color:#fff;background-color:#2979ff;border-color:#2979ff}.u-checkbox__icon-wrap--disabled[data-v-7e6e0538]{background-color:#ebedf0;border-color:#c8c9cc}.u-checkbox__icon-wrap--disabled--checked[data-v-7e6e0538]{color:#c8c9cc!important}.u-checkbox__label[data-v-7e6e0538]{word-wrap:break-word;margin-left:%?10?%;margin-right:%?24?%;color:#606266;font-size:%?30?%}.u-checkbox__label--disabled[data-v-7e6e0538]{color:#c8c9cc}',""]),t.exports=e},"62be":function(t,e,n){var r=n("cc76");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("532536c8",r,!0,{sourceMap:!1,shadowMode:!1})},"62f2":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var r=uni.getSystemInfoSync(),i={};e.default={name:"u-navbar",props:{height:{type:[String,Number],default:""},backIconColor:{type:String,default:"#606266"},backIconName:{type:String,default:"nav-back"},backIconSize:{type:[String,Number],default:"44"},backText:{type:String,default:""},backTextStyle:{type:Object,default:function(){return{color:"#606266"}}},title:{type:String,default:""},titleWidth:{type:[String,Number],default:"250"},titleColor:{type:String,default:"#606266"},titleBold:{type:Boolean,default:!1},titleSize:{type:[String,Number],default:32},isBack:{type:[Boolean,String],default:!0},background:{type:Object,default:function(){return{background:"#ffffff"}}},isFixed:{type:Boolean,default:!0},immersive:{type:Boolean,default:!1},borderBottom:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:""},customBack:{type:Function,default:null}},data:function(){return{menuButtonInfo:i,statusBarHeight:r.statusBarHeight}},computed:{navbarInnerStyle:function(){var t={};return t.height=this.navbarHeight+"px",t},navbarStyle:function(){var t={};return t.zIndex=this.zIndex?this.zIndex:this.$u.zIndex.navbar,Object.assign(t,this.background),t},titleStyle:function(){var t={};return t.left=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.right=(r.windowWidth-uni.upx2px(this.titleWidth))/2+"px",t.width=uni.upx2px(this.titleWidth)+"px",t},navbarHeight:function(){return this.height?this.height:44}},created:function(){},methods:{goBack:function(){"function"===typeof this.customBack?this.customBack.bind(this.$u.$parent.call(this))():uni.navigateBack()}}}},"66f6":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,".mescroll-body[data-v-6b5ff080]{position:relative; /* 下拉刷新区域相对自身定位 */height:auto; /* 不可固定高度,否则overflow:hidden导致无法滑动; 同时使设置的最小高生效,实现列表不满屏仍可下拉*/overflow:hidden; /* 当有元素写在mescroll-body标签前面时,可遮住下拉刷新区域 */box-sizing:border-box /* 避免设置padding出现双滚动条的问题 */}\r\n\r\n/* 使sticky生效: 父元素不能overflow:hidden或者overflow:auto属性 */.mescroll-body.mescorll-sticky[data-v-6b5ff080]{overflow:unset!important}\r\n\r\n/* 适配 iPhoneX */@supports (bottom:constant(safe-area-inset-bottom)) or (bottom:env(safe-area-inset-bottom)){.mescroll-safearea[data-v-6b5ff080]{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}}\r\n\r\n/* 下拉刷新区域 */.mescroll-downwarp[data-v-6b5ff080]{position:absolute;top:-100%;left:0;width:100%;height:100%;text-align:center}\r\n\r\n/* 下拉刷新--内容区,定位于区域底部 */.mescroll-downwarp .downwarp-content[data-v-6b5ff080]{position:absolute;left:0;bottom:0;width:100%;min-height:%?60?%;padding:%?20?% 0;text-align:center}\r\n\r\n/* 下拉刷新--提示文本 */.mescroll-downwarp .downwarp-tip[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle;margin-left:%?16?%\r\n\t/* color: gray; 已在style设置color,此处删去*/}\r\n\r\n/* 下拉刷新--旋转进度条 */.mescroll-downwarp .downwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-downwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollDownRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollDownRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}\r\n\r\n/* 上拉加载区域 */.mescroll-upwarp[data-v-6b5ff080]{box-sizing:border-box;min-height:%?110?%;padding:%?30?% 0;text-align:center;clear:both}\r\n\r\n/*提示文本 */.mescroll-upwarp .upwarp-tip[data-v-6b5ff080],\r\n.mescroll-upwarp .upwarp-nodata[data-v-6b5ff080]{display:inline-block;font-size:%?28?%;vertical-align:middle\r\n\t/* color: gray; 已在style设置color,此处删去*/}.mescroll-upwarp .upwarp-tip[data-v-6b5ff080]{margin-left:%?16?%}\r\n\r\n/*旋转进度条 */.mescroll-upwarp .upwarp-progress[data-v-6b5ff080]{display:inline-block;width:%?32?%;height:%?32?%;border-radius:50%;border:%?2?% solid grey;border-bottom-color:transparent!important; /*已在style设置border-color,此处需加 !important*/vertical-align:middle}\r\n\r\n/* 旋转动画 */.mescroll-upwarp .mescroll-rotate[data-v-6b5ff080]{-webkit-animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite;animation:mescrollUpRotate-data-v-6b5ff080 .6s linear infinite}@-webkit-keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes mescrollUpRotate-data-v-6b5ff080{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}",""]),t.exports=e},"680e":function(t,e,n){"use strict";n.r(e);var r=n("8cc1"),i=n("0f4f");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("5e8e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"adf85ec2",null,!1,r["a"],a);e["default"]=c.exports},"6a1a":function(t,e,n){var r=n("c35c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("221bf9c5",r,!0,{sourceMap:!1,shadowMode:!1})},"6ccf":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-calendar[data-v-7de526b6]{color:#606266}.u-calendar__header[data-v-7de526b6]{width:100%;box-sizing:border-box;font-size:%?30?%;background-color:#fff;color:#303133}.u-calendar__header__text[data-v-7de526b6]{margin-top:%?30?%;padding:0 %?60?%;display:flex;flex-direction:row;justify-content:center;align-items:center}.u-calendar__action[data-v-7de526b6]{padding:%?40?% 0 %?40?% 0}.u-calendar__action__icon[data-v-7de526b6]{margin:0 %?16?%}.u-calendar__action__text[data-v-7de526b6]{padding:0 %?16?%;color:#303133;font-size:%?32?%;line-height:%?32?%;font-weight:700}.u-calendar__week-day[data-v-7de526b6]{display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden}.u-calendar__week-day__text[data-v-7de526b6]{flex:1;text-align:center}.u-calendar__content[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;padding:6px 0;box-sizing:border-box;background-color:#fff;position:relative}.u-calendar__content--end-date[data-v-7de526b6]{border-top-right-radius:%?8?%;border-bottom-right-radius:%?8?%}.u-calendar__content--start-date[data-v-7de526b6]{border-top-left-radius:%?8?%;border-bottom-left-radius:%?8?%}.u-calendar__content__item[data-v-7de526b6]{width:14.2857%;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:6px 0;overflow:hidden;position:relative;z-index:2}.u-calendar__content__item__inner[data-v-7de526b6]{height:%?84?%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;font-size:%?32?%;position:relative;border-radius:50%}.u-calendar__content__item__inner__desc[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;-webkit-transform:scale(.75);transform:scale(.75);-webkit-transform-origin:center center;transform-origin:center center;position:absolute;left:0;text-align:center;bottom:%?2?%}.u-calendar__content__item__tips[data-v-7de526b6]{width:100%;font-size:%?24?%;line-height:%?24?%;position:absolute;left:0;-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;text-align:center;bottom:%?8?%;z-index:2}.u-calendar__content__bg-month[data-v-7de526b6]{position:absolute;font-size:130px;line-height:130px;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#e4e7ed;z-index:1}.u-calendar__bottom[data-v-7de526b6]{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-direction:column;background-color:#fff;padding:0 %?40?% %?30?%;box-sizing:border-box;font-size:%?24?%;color:#909399}.u-calendar__bottom__choose[data-v-7de526b6]{height:%?50?%}.u-calendar__bottom__btn[data-v-7de526b6]{width:100%}',""]),t.exports=e},"6e0a":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={data:function(){return{wxsProp:{optDown:{},scrollTop:0,bodyHeight:0,isDownScrolling:!1,isUpScrolling:!1,isScrollBody:!0,isUpBoth:!0,t:0},callProp:{callType:"",t:0}}},methods:{wxsCall:function(t){"setWxsProp"===t.type?this.wxsProp={optDown:this.mescroll.optDown,scrollTop:this.mescroll.getScrollTop(),bodyHeight:this.mescroll.getBodyHeight(),isDownScrolling:this.mescroll.isDownScrolling,isUpScrolling:this.mescroll.isUpScrolling,isUpBoth:this.mescroll.optUp.isBoth,isScrollBody:this.mescroll.isScrollBody,t:Date.now()}:"setLoadType"===t.type?(this.downLoadType=t.downLoadType,this.$set(this.mescroll,"downLoadType",this.downLoadType),this.$set(this.mescroll,"isDownEndSuccess",null)):"triggerDownScroll"===t.type?this.mescroll.triggerDownScroll():"endDownScroll"===t.type?this.mescroll.endDownScroll():"triggerUpScroll"===t.type&&this.mescroll.triggerUpScroll(!0)}},mounted:function(){var t=this;this.mescroll.optDown.afterLoading=function(){t.callProp={callType:"showLoading",t:Date.now()}},this.mescroll.optDown.afterEndDownScroll=function(){t.callProp={callType:"endDownScroll",t:Date.now()};var e=300+(t.mescroll.optDown.beforeEndDelay||0);setTimeout((function(){4!==t.downLoadType&&0!==t.downLoadType||(t.callProp={callType:"clearTransform",t:Date.now()}),t.$set(t.mescroll,"downLoadType",t.downLoadType)}),e)},this.wxsCall({type:"setWxsProp"})}};e.default=r},"6eaa":function(t,e,n){"use strict";n.r(e);var r=n("1078"),i=n("9ac8");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},"6ef1":function(t,e,n){"use strict";n.r(e);var r=n("0416"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"6f5a":function(t,e,n){var r=n("66f6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("704c32ba",r,!0,{sourceMap:!1,shadowMode:!1})},"71e9":function(t,e,n){var r=n("3f29");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("577b2531",r,!0,{sourceMap:!1,shadowMode:!1})},"73cb":function(t,e,n){"use strict";n.r(e);var r=n("24c0"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"752f":function(t,e,n){"use strict";var r=function(t){(t.options.wxs||(t.options.wxs={}))["wxsBiz"]=function(t){var e={};function n(t){t&&(e.optDown=t.optDown,e.scrollTop=t.scrollTop,e.bodyHeight=t.bodyHeight,e.isDownScrolling=t.isDownScrolling,e.isUpScrolling=t.isUpScrolling,e.isUpBoth=t.isUpBoth,e.isScrollBody=t.isScrollBody,e.startTop=t.scrollTop)}function r(t,n,r){e.disabled()||t.callType&&("showLoading"===t.callType?e.showLoading(r):"endDownScroll"===t.callType?e.endDownScroll(r):"clearTransform"===t.callType&&e.clearTransform(r))}function i(t,n){e.downHight=0,e.startPoint=e.getPoint(t),e.startTop=e.getScrollTop(),e.startAngle=0,e.lastPoint=e.startPoint,e.maxTouchmoveY=e.getBodyHeight()-e.optDown.bottomOffset,e.inTouchend=!1,e.callMethod(n,{type:"setWxsProp"})}function o(t,n){var r=!0;if(e.disabled())return r;var i=e.getScrollTop(),o=e.getPoint(t),u=o.y-e.startPoint.y;if(u>0&&(e.isScrollBody&&i<=0||!e.isScrollBody&&(i<=0||i<=e.optDown.startTop&&i===e.startTop))&&!e.inTouchend&&!e.isDownScrolling&&!e.optDown.isLock&&(!e.isUpScrolling||e.isUpScrolling&&e.isUpBoth)){if(e.startAngle||(e.startAngle=e.getAngle(e.lastPoint,o)),e.startAngle0&&o.y>=e.maxTouchmoveY)return e.inTouchend=!0,a(t,n),r;r=!1;var c=o.y-e.lastPoint.y;e.downHight0?c*e.optDown.outOffsetRate:c),e.downHight=Math.round(e.downHight);var s=e.downHight/e.optDown.offset;e.onMoving(n,s,e.downHight)}return e.lastPoint=o,r}function a(t,n){if(e.isMoveDown)e.downHight>=e.optDown.offset?(e.downHight=e.optDown.offset,e.callMethod(n,{type:"triggerDownScroll"})):(e.downHight=0,e.callMethod(n,{type:"endDownScroll"})),e.movetype=0,e.isMoveDown=!1;else if(!e.isScrollBody&&e.getScrollTop()===e.startTop){var r=e.getPoint(t).y-e.startPoint.y<0;if(r){var i=e.getAngle(e.getPoint(t),e.startPoint);i>80&&e.callMethod(n,{type:"triggerUpScroll"})}}e.callMethod(n,{type:"setWxsProp"})}return e.onMoving=function(t,e,n){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"transform",transform:"translateY("+n+"px)",transition:""});var r=t.selectComponent(".mescroll-wxs-progress");r&&r.setStyle({transform:"rotate("+360*e+"deg)"})}))},e.showLoading=function(t){e.downHight=e.optDown.offset,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY("+e.downHight+"px)",transition:"transform 300ms"})}))},e.endDownScroll=function(t){e.downHight=0,e.isDownScrolling=!1,t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"auto",transform:"translateY(0)",transition:"transform 300ms"})}))},e.clearTransform=function(t){t.requestAnimationFrame((function(){t.selectComponent(".mescroll-wxs-content").setStyle({"will-change":"",transform:"",transition:""})}))},e.disabled=function(){return!e.optDown||!e.optDown.use||e.optDown.native},e.getPoint=function(t){return t?t.touches&&t.touches[0]?{x:t.touches[0].pageX,y:t.touches[0].pageY}:t.changedTouches&&t.changedTouches[0]?{x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY}:{x:t.clientX,y:t.clientY}:{x:0,y:0}},e.getAngle=function(t,e){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=Math.sqrt(n*n+r*r),o=0;return 0!==i&&(o=Math.asin(r/i)/Math.PI*180),o},e.getScrollTop=function(){return e.scrollTop||0},e.getBodyHeight=function(){return e.bodyHeight||0},e.callMethod=function(t,e){t&&t.callMethod("wxsCall",e)},t.exports={propObserver:n,callObserver:r,touchstartEvent:i,touchmoveEvent:o,touchendEvent:a},t.exports}({exports:{}})};e["a"]=r},"75c4":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-select__action[data-v-70094335]{position:relative;line-height:%?70?%;height:%?70?%}.u-select__action__icon[data-v-70094335]{position:absolute;right:%?20?%;top:50%;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:1}.u-select__action__icon--reverse[data-v-70094335]{-webkit-transform:rotate(-180deg) translateY(50%);transform:rotate(-180deg) translateY(50%)}.u-select__hader__title[data-v-70094335]{color:#606266}.u-select--border[data-v-70094335]{border-radius:%?6?%;border-radius:4px;border:1px solid #dcdfe6}.u-select__header[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:%?80?%;padding:0 %?40?%}.u-select__body[data-v-70094335]{width:100%;height:%?500?%;overflow:hidden;background-color:#fff}.u-select__body__picker-view[data-v-70094335]{height:100%;box-sizing:border-box}.u-select__body__picker-view__item[data-v-70094335]{display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:%?32?%;color:#303133;padding:0 %?8?%}',""]),t.exports=e},"76db":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-select"},[n("u-popup",{attrs:{maskCloseAble:t.maskCloseAble,mode:"bottom",popup:!1,length:"auto",safeAreaInsetBottom:t.safeAreaInsetBottom,"z-index":t.uZIndex},on:{close:function(e){arguments[0]=e=t.$handleEvent(e),t.close.apply(void 0,arguments)}},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[n("v-uni-view",{staticClass:"u-select"},[n("v-uni-view",{staticClass:"u-select__header",on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e)}}},[n("v-uni-view",{staticClass:"u-select__header__cancel u-select__header__btn",style:{color:t.cancelColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getResult("cancel")}}},[t._v(t._s(t.cancelText))]),n("v-uni-view",{staticClass:"u-select__header__title"},[t._v(t._s(t.title))]),n("v-uni-view",{staticClass:"u-select__header__confirm u-select__header__btn",style:{color:t.moving?t.cancelColor:t.confirmColor},attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{touchmove:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.getResult("confirm")}}},[t._v(t._s(t.confirmText))])],1),n("v-uni-view",{staticClass:"u-select__body"},[t.value?n("v-uni-picker-view",{staticClass:"u-select__body__picker-view",attrs:{value:t.defaultSelector},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.columnChange.apply(void 0,arguments)},pickstart:function(e){arguments[0]=e=t.$handleEvent(e),t.pickstart.apply(void 0,arguments)},pickend:function(e){arguments[0]=e=t.$handleEvent(e),t.pickend.apply(void 0,arguments)}}},t._l(t.columnData,(function(e,r){return n("v-uni-picker-view-column",{key:r},t._l(e,(function(e,r){return n("v-uni-view",{key:r,staticClass:"u-select__body__picker-view__item"},[n("v-uni-view",{staticClass:"u-line-1"},[t._v(t._s(e[t.labelName]))])],1)})),1)})),1):t._e()],1)],1)],1)],1)},o=[]},7860:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("99af"),n("ac1f"),n("5319"),n("fb6a"),n("a630"),n("3ca3"),n("d3b7"),n("ddb0");e.default={name:"u-calendar",props:{safeAreaInsetBottom:{type:Boolean,default:!1},maskCloseAble:{type:Boolean,default:!0},value:{type:Boolean,default:!1},zIndex:{type:[String,Number],default:0},changeYear:{type:Boolean,default:!0},changeMonth:{type:Boolean,default:!0},mode:{type:String,default:"date"},maxYear:{type:[Number,String],default:2050},minYear:{type:[Number,String],default:1950},minDate:{type:[Number,String],default:"1950-01-01"},maxDate:{type:[Number,String],default:""},borderRadius:{type:[String,Number],default:20},monthArrowColor:{type:String,default:"#606266"},yearArrowColor:{type:String,default:"#909399"},color:{type:String,default:"#303133"},activeBgColor:{type:String,default:"#2979ff"},activeColor:{type:String,default:"#ffffff"},rangeBgColor:{type:String,default:"rgba(41,121,255,0.13)"},rangeColor:{type:String,default:"#2979ff"},startText:{type:String,default:"开始"},endText:{type:String,default:"结束"},btnType:{type:String,default:"primary"},isActiveCurrent:{type:Boolean,default:!0},isChange:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},toolTip:{type:String,default:"选择日期"}},data:function(){return{weekday:1,weekdayArr:[],days:0,daysArr:[],showTitle:"",year:2020,month:0,day:0,startYear:0,startMonth:0,startDay:0,endYear:0,endMonth:0,endDay:0,today:"",activeDate:"",startDate:"",endDate:"",isStart:!0,min:null,max:null,weekDayZh:["日","一","二","三","四","五","六"]}},computed:{dataChange:function(){return"".concat(this.mode,"-").concat(this.minDate,"-").concat(this.maxDate)},uZIndex:function(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},watch:{dataChange:function(t){this.init()}},created:function(){this.init()},methods:{getColor:function(t,e){var n=1==e?"":this.color,r=t+1,i="".concat(this.year,"-").concat(this.month,"-").concat(r),o=new Date(i.replace(/\-/g,"/")).getTime(),a=this.startDate.replace(/\-/g,"/"),u=this.endDate.replace(/\-/g,"/");return this.isActiveCurrent&&this.activeDate==i||this.startDate==i||this.endDate==i?n=1==e?this.activeBgColor:this.activeColor:this.endDate&&o>new Date(a).getTime()&&on&&(t=n),this.year=t.getFullYear(),this.month=t.getMonth()+1,this.day=t.getDate(),this.today="".concat(t.getFullYear(),"-").concat(t.getMonth()+1,"-").concat(t.getDate()),this.activeDate=this.today,this.min=this.initDate(this.minDate),this.max=this.initDate(this.maxDate||this.today),this.startDate="",this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.endDate="",this.isStart=!0,this.changeData()},initDate:function(t){var e=t.split("-");return{year:Number(e[0]||1920),month:Number(e[1]||1),day:Number(e[2]||1)}},openDisAbled:function(t,e,n){var r=!0,i="".concat(t,"/").concat(e,"/").concat(n),o="".concat(this.min.year,"/").concat(this.min.month,"/").concat(this.min.day),a="".concat(this.max.year,"/").concat(this.max.month,"/").concat(this.max.day),u=new Date(i).getTime();return u>=new Date(o).getTime()&&u<=new Date(a).getTime()&&(r=!1),r},generateArray:function(t,e){return Array.from(new Array(e+1).keys()).slice(t)},formatNum:function(t){return t<10?"0"+t:t+""},getMonthDay:function(t,e){var n=new Date(t,e,0).getDate();return n},getWeekday:function(t,e){var n=new Date("".concat(t,"/").concat(e,"/01 00:00:00"));return n.getDay()},checkRange:function(t){var e=!1;return(tthis.maxYear)&&(uni.showToast({title:"日期超出范围啦~",icon:"none"}),e=!0),e},changeMonthHandler:function(t){if(t){var e=this.month+1,n=e>12?this.year+1:this.year;this.checkRange(n)||(this.month=e>12?1:e,this.year=n,this.changeData())}else{var r=this.month-1,i=r<1?this.year-1:this.year;this.checkRange(i)||(this.month=r<1?12:r,this.year=i,this.changeData())}},changeYearHandler:function(t){var e=t?this.year+1:this.year-1;this.checkRange(e)||(this.year=e,this.changeData())},changeData:function(){this.days=this.getMonthDay(this.year,this.month),this.daysArr=this.generateArray(1,this.days),this.weekday=this.getWeekday(this.year,this.month),this.weekdayArr=this.generateArray(1,this.weekday),this.showTitle="".concat(this.year,"年").concat(this.month,"月"),this.isChange&&"date"==this.mode&&this.btnFix(!0)},dateClick:function(t){if(t+=1,!this.openDisAbled(this.year,this.month,t)){this.day=t;var e="".concat(this.year,"-").concat(this.month,"-").concat(t);if("date"==this.mode)this.activeDate=e;else{var n=new Date(e.replace(/\-/g,"/")).getTime()0?n("v-uni-view",{staticClass:"mescroll-bottombar",style:{height:t.windowBottom+"px"}}):t._e(),t.safearea?n("v-uni-view",{staticClass:"mescroll-safearea"}):t._e(),n("mescroll-top",{attrs:{option:t.mescroll.optUp.toTop},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}},model:{value:t.isShowToTop,callback:function(e){t.isShowToTop=e},expression:"isShowToTop"}}),n("v-uni-view",{wxsProps:{"change:prop":"wxsProp"},attrs:{"change:prop":t.renderBiz.propObserver,prop:t.wxsProp}})],1)},o=[]},"980a":function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-swipe-action[data-v-1adff301]{width:auto;height:auto;position:relative;overflow:hidden}.u-swipe-view[data-v-1adff301]{display:flex;flex-direction:row;height:auto;position:relative\n /* 这一句很关键,覆盖默认的绝对定位 */}.u-swipe-content[data-v-1adff301]{flex:1}.u-swipe-del[data-v-1adff301]{position:relative;font-size:%?30?%;color:#fff}.u-btn-text[data-v-1adff301]{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}',""]),t.exports=e},9971:function(module,exports,__webpack_require__){"use strict";__webpack_require__("7a82");var _interopRequireDefault=__webpack_require__("ee27").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _slicedToArray2=_interopRequireDefault(__webpack_require__("d0af")),_typeof2=_interopRequireDefault(__webpack_require__("0122")),_createForOfIteratorHelper2=_interopRequireDefault(__webpack_require__("54f8"));__webpack_require__("4de4"),__webpack_require__("d3b7"),__webpack_require__("d81d"),__webpack_require__("c975"),__webpack_require__("159b"),__webpack_require__("b64b"),__webpack_require__("7db0"),__webpack_require__("c760"),__webpack_require__("f8c9"),__webpack_require__("caad"),__webpack_require__("2532"),__webpack_require__("14d9"),__webpack_require__("4fadc"),__webpack_require__("ac1f"),__webpack_require__("00b4"),__webpack_require__("466d"),__webpack_require__("498a");var _SearchItem=_interopRequireDefault(__webpack_require__("c881")),_lodashEs=__webpack_require__("4fcf6"),_default2=exports.default={props:{schemas:{type:Array,default:function(){return[]}}},components:{SearchItem:_SearchItem.default},computed:{formActionType:function formActionType(){var _this=this;return{setFieldsValue:function setFieldsValue(values){var fields=_this.getSchema.map((function(t){return t.field})).filter(Boolean),delimiter=".",nestKeyArray=fields.filter((function(t){return t.indexOf(delimiter)>=0})),validKeys=[];Object.keys(values).forEach((function(key){var schema=_this.getSchema.find((function(t){return t.field===key})),value=values[key],hasKey=Reflect.has(values,key);hasKey&&fields.includes(key)?(_this.formModel[key]=value,validKeys.push(key)):nestKeyArray.forEach((function(nestKey){try{var _value=eval("values"+delimiter+nestKey);_this.isDef(_value)&&(_this.formModel[nestKey]=_value,validKeys.push(nestKey))}catch(e){_this.isDef(defaultValueRef.value[nestKey])&&(_this.formModel[nestKey]=(0,_lodashEs.cloneDeep)(defaultValueRef.value[nestKey]))}}))}))}}},getSchema:function(){var t,e=this.schemas,n=(0,_createForOfIteratorHelper2.default)(e);try{for(n.s();!(t=n.n()).done;)t.value}catch(r){n.e(r)}finally{n.f()}return(0,_lodashEs.cloneDeep)(e)}},data:function(){return{isOpen:!1,formModel:{}}},created:function(){this.initFormModel()},methods:{handleOpen:function(){console.log("====")},handleCloseDropdown:function(){var t;null===(t=this.$refs.dropdownRef)||void 0===t||t.close()},initFormModel:function(){var t=this.schemas,e={};t.forEach((function(t){var n=t.field,r=t.defaultValue;n&&(e[n]=r)})),this.formModel=e},handleInputNumberValue:function(t,e){return t&&["Input","InputPassword","InputSearch","InputTextArea"].includes(t)&&e&&this.isNumber(e)?"".concat(e):e},isDef:function(t){return"undefined"!==typeof t},isNumber:function(t){return"number"===typeof t&&!isNaN(t)},isArray:function(t){return Array.isArray(t)},isObject:function(t){return"object"===(0,_typeof2.default)(t)&&null!==t},isFunction:function(t){return"function"===typeof t},setFormModel:function(t,e){this.formModel[t]=e,this.$emit("field-value-change",t,e)},handleFormValues:function(t){if(!this.isObject(t))return{};for(var e={},n=function(){var t=i[r],n=(0,_slicedToArray2.default)(t,2),o=n[1],a=(0,_slicedToArray2.default)(t,1),u=a[0],c=/^\[(.+)\]$/;if(c.test(u)){var s=u.match(c)[1].split(",");s.forEach((function(t,n){var r,i=null!==(r=null===o||void 0===o?void 0:o[n])&&void 0!==r?r:"";i&&(e[t.trim()]=i)}))}else o&&(e[u]=o)},r=0,i=Object.entries(t);r=this.parent.max)return this.$u.toast("最多可选".concat(this.parent.max,"项"));this.emitEvent(),this.$emit("input",!this.value)}}}}},a96b:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{value:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"100%"},height:{type:String,default:"100%"}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}},data:function(){return{}}}},adb4:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={props:{option:{type:Object,default:function(){return{}}},value:!1,modelValue:!1},computed:{left:function(){return this.option.left?this.addUnit(this.option.left):"auto"},right:function(){return this.option.left?"auto":this.addUnit(this.option.right)},isShow:function(){return this.value}},methods:{addUnit:function(t){return t?"number"===typeof t?t+"rpx":t:0},toTopClick:function(){this.$emit("input",!1),this.$emit("click")}}}},add5:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请选择日期"},params:{type:Object,default:function(){return{}}},mode:{type:String,default:"date"}},computed:{isRange:function(){return"range"===this.mode},placeholderStr:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.placeholder)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.placeholder)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.placeholder},status:function(){var t,e,n,r;return this.isRange?[null!==(t=null===(e=this.date)||void 0===e?void 0:e[0])&&void 0!==t?t:"",null!==(n=null===(r=this.date)||void 0===r?void 0:r[1])&&void 0!==n?n:""]:this.date}},data:function(){return{show:!1,date:null}},methods:{openCalendar:function(){this.show=!0},handleChange:function(t){var e;if(this.isRange){var n=t.startDate,r=t.endDate;e=[n,r]}else e=t.result;this.$emit("change",e),this.$emit("input",e),this.date=e,this.$emit("close-dropdown",e)}},watch:{value:{handler:function(t){this.date=t},immediate:!0,deep:!0}}}},aec2:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f07e")),o=r(n("c964")),a=r(n("f3f3"));n("a9e3"),n("7db0"),n("d3b7"),n("c740"),n("13d5"),n("14d9");var u=n("4fcf6");e.default={props:{api:{type:Function,default:function(){}},value:{type:[Array,Object,String,Number]},params:{type:Object,default:function(){return{}}},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},placeholder:{type:String,default:"请选择"}},data:function(){return{show:!1,isFirstLoad:!0,options:[]}},computed:{currentOption:function(){var t=this,e=this.getOptions.find((function(e){return e.value==t.value}));return null!==e&&void 0!==e?e:{}},showText:function(){var t,e;return null!==(t=null===(e=this.currentOption)||void 0===e?void 0:e.label)&&void 0!==t?t:this.value},defaultValue:function(){var t=this,e=this.getOptions.findIndex((function(e){return e.value==t.value}));return[e>-1?e:0]},getOptions:function(){var t=this.labelField,e=this.valueField;return this.options.reduce((function(n,r){if(r){var i=r[e];n.push((0,a.default)((0,a.default)({},(0,u.omit)(r,[t,e])),{},{label:r[t],value:i}))}return n}),[])}},created:function(){this.fetch()},methods:{fetch:function(){var t=this;return(0,o.default)((0,i.default)().mark((function e(){var n,r;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.api,n&&t.isFunction(n)){e.next=3;break}return e.abrupt("return");case 3:return t.options=[],e.prev=4,e.next=7,n(t.params);case 7:if(r=e.sent,t.isFirstLoad=!1,!Array.isArray(r)){e.next=13;break}return t.options=r,t.emitChange(),e.abrupt("return");case 13:t.emitChange(),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](4),console.warn(e.t0);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})))()},emitChange:function(){this.$emit("options-change",this.getOptions)},handleConfirm:function(t){if(t.length){var e=t[0].value;null!=e&&(this.$emit("change",e),this.$emit("input",e))}},isFunction:function(t){return"function"===typeof t}},watch:{params:{handler:function(){!this.isFirstLoad&&this.fetch()},deep:!0}}}},aecc:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("component",t._g(t._b({},"component",t.getBindValue.bind,!1),t.getBindValue.on))},o=[]},b14d:function(t,e,n){var r=n("86cb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("6d1ac5d2",r,!0,{sourceMap:!1,shadowMode:!1})},b471:function(t,e,n){"use strict";n.r(e);var r=n("fe9d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},b53f:function(t,e,n){"use strict";n.r(e);var r=n("f940"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},baac:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-line",style:[t.lineStyle]})},o=[]},bade:function(t,e,n){"use strict";n.r(e);var r=n("7860"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},bd0a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3"));n("d3b7"),n("159b"),n("14d9");var o=r(n("e350"));e.default={props:{value:{type:Boolean,default:!1},data:{type:Object,default:function(){}},colums:{type:Array,default:function(){return[]}},editAuth:{type:Array,default:function(){return[]}},delAuth:{type:Array,default:function(){return[]}}},computed:{show:{get:function(){return this.value},set:function(t){this.$emit("input",t)}},isEdit:function(){return!!this.$listeners.onEdit&&(0,o.default)(this.editAuth)},isDel:function(){return!!this.$listeners.onDel&&(0,o.default)(this.delAuth)},columsList:function(){var t=this,e=[];return this.colums.forEach((function(n){var r=n.dataIndex,o=n.format,a=t.data[r];t.isFunction(o)&&(a=o(a)),e.push((0,i.default)((0,i.default)({},n),{},{value:a}))})),e}},methods:{isFunction:function(t){return"function"===typeof t},handleEdit:function(){this.$emit("onEdit",this.data)},handleDel:function(){this.$emit("onDel",this.data)}}}},bd58:function(t,e,n){"use strict";var r=n("b14d"),i=n.n(r);i.a},be8c:function(t,e,n){"use strict";n.r(e);var r=n("849d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},becc:function(t,e,n){"use strict";var r=n("6a1a"),i=n.n(r);i.a},c17b:function(t,e,n){"use strict";n.r(e);var r=n("2a6c"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},c35c:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-loading-circle[data-v-19cf7fca]{display:inline-flex;vertical-align:middle;width:%?28?%;height:%?28?%;background:0 0;border-radius:50%;border:2px solid;border-color:#e5e5e5 #e5e5e5 #e5e5e5 #8f8d8e;-webkit-animation:u-circle-data-v-19cf7fca 1s linear infinite;animation:u-circle-data-v-19cf7fca 1s linear infinite}.u-loading-flower[data-v-19cf7fca]{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;animation:u-flower-data-v-19cf7fca 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}@-webkit-keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes u-flower-data-v-19cf7fca{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes u-circle-data-v-19cf7fca{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}',""]),t.exports=e},c4af:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("f3f3")),o=r(n("f07e")),a=r(n("c964"));n("d81d"),n("4de4"),n("d3b7"),n("99af");var u=r(n("d2f3")),c=r(n("02cd")),s=n("365c"),l=r(n("0b61")),f=r(n("0453")),d=r(n("12df")),p=r(n("4c48")),h=r(n("e350")),v=[{title:"基地名称",dataIndex:"name"},{title:"农业类型",dataIndex:"industry_label"},{title:"是否外部链接",dataIndex:"is_blank",format:function(t){return t?"是":"否"}},{title:"排序",dataIndex:"sort"},{title:"基地负责人",dataIndex:"person"},{title:"基地农作物",dataIndex:"crops",format:function(t){var e;return null!==(e=null===t||void 0===t?void 0:t.map((function(t){return t.name})).join(","))&&void 0!==e?e:""}},{title:"基地经度",dataIndex:"address_lng"},{title:"基地纬度",dataIndex:"address_lat"},{title:"基地地址",dataIndex:"address"},{title:"基地面积",dataIndex:"areas"},{title:"种养殖面积",dataIndex:"cultivated"},{title:"基地就业人数",dataIndex:"workforce"},{title:"基地描述",dataIndex:"description"}];e.default={mixins:[l.default],components:{SearchForm:c.default,Appbar:u.default,cuPopup:f.default,BaseTablePopup:d.default,BasicsEdit:p.default},data:function(){return{baseTableColums:v,currentData:null,filterParmas:{},downOption:{use:!1},upOption:{auto:!1,page:{size:20}},dataList:[],formShow:!1,baseShow:!1,searchFormSchema:[{field:"name",label:"名称",component:"Input",componentProps:{placeholder:"请输入名称"}},{field:"industry",label:"农业类型",component:"ApiSelect",componentProps:function(t){t.formActionType;return{api:function(){var t=(0,a.default)((0,o.default)().mark((function t(e){var n,r;return(0,o.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s.http.get("/api/keywords-industry",{params:e});case 2:return n=t.sent,r=n.data,t.abrupt("return",r.data);case 5:case"end":return t.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}(),labelField:"name",valueField:"key"}}}]}},computed:{options:function(){return[].filter((function(t){return(0,h.default)(t.permission)}))}},methods:{handleSubmit:function(t){var e=this;this.filterParmas=t,this.$nextTick((function(){e.mescroll.resetUpScroll()}))},upCallback:function(t){var e=t.num,n=t.size;this.getData((0,i.default)((0,i.default)({},this.filterParmas),{},{page:e,per_page:n,type:1}))},getData:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){var r,i,a,u;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,s.http.get("/api/agricultural-basic",{params:t});case 3:r=n.sent,i=r.data,1==t.page&&(e.dataList=[]),a=i.data,u=i.meta,e.dataList=e.dataList.concat(a.map((function(t){return Object.assign({show:!1},t)}))),e.mescroll.endByPage(a.length,u.total),n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](0),e.mescroll.endErr();case 14:case"end":return n.stop()}}),n,null,[[0,11]])})))()},handleClick:function(t,e){var n=this.options[e].opt,r=this.dataList[t];this.currentData=r,"edit"==n?this.handleEdit(r):"delete"==n&&this.handleDel(r)},handleContentClick:function(t){this.currentData=this.dataList[t],uni.navigateTo({url:"/pages/basics/profile-detail?id=".concat(this.currentData.id)})},handleEdit:function(t){this.currentData=t,this.formShow=!0,this.baseShow=!1},handleDel:function(t){var e=this;return(0,a.default)((0,o.default)().mark((function n(){return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:uni.showModal({title:"提示",content:"是否确定删除?",success:function(){var n=(0,a.default)((0,o.default)().mark((function n(r){var i;return(0,o.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!r.confirm){n.next=12;break}return n.prev=1,n.next=4,e.$http.delete("/api/agricultural-basic/".concat(t.id));case 4:e.mescroll.resetUpScroll(),e.baseShow=!1,n.next=12;break;case 8:n.prev=8,n.t0=n["catch"](1),i=n.t0.data,e.$u.toast(i.message);case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));function r(t){return n.apply(this,arguments)}return r}()});case 1:case"end":return n.stop()}}),n)})))()},handleCreate:function(){var t=this;return(0,a.default)((0,o.default)().mark((function e(){return(0,o.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.currentData=null,t.formShow=!0,t.baseShow=!1;case 3:case"end":return e.stop()}}),e)})))()},handleEditConfirm:function(){this.mescroll.resetUpScroll(),this.formShow=!1}}}},c6c9:function(t,e,n){"use strict";n.r(e);var r=n("1794"),i=n("bade");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("cb36");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"7de526b6",null,!1,r["a"],a);e["default"]=c.exports},c6eb:function(t,e,n){"use strict";(function(t){var r=n("5ea3"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a&&r["a"].process,c=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(e){}}();e["a"]=c}).call(this,n("dd40")(t))},c760:function(t,e,n){"use strict";var r=n("23e7");r({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},c86e:function(t,e,n){"use strict";var r=n("353f"),i=n.n(r);i.a},c881:function(t,e,n){"use strict";n.r(e);var r=n("aecc"),i=n("338d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},c892:function(t,e,n){"use strict";n.r(e);var r=n("82d3"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},cb29:function(t,e,n){"use strict";var r=n("23e7"),i=n("81d5"),o=n("44d2");r({target:"Array",proto:!0},{fill:i}),o("fill")},cb36:function(t,e,n){"use strict";var r=n("7b18"),i=n.n(r);i.a},cc76:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-navbar[data-v-2920cc37]{width:100%}.u-navbar-fixed[data-v-2920cc37]{position:fixed;left:0;right:0;top:0;z-index:991}.u-status-bar[data-v-2920cc37]{width:100%}.u-navbar-inner[data-v-2920cc37]{display:flex;flex-direction:row;justify-content:space-between;position:relative;align-items:center}.u-back-wrap[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;flex:1;flex-grow:0;padding:%?14?% %?14?% %?14?% %?24?%}.u-back-text[data-v-2920cc37]{padding-left:%?4?%;font-size:%?30?%}.u-navbar-content-title[data-v-2920cc37]{display:flex;flex-direction:row;align-items:center;justify-content:center;flex:1;position:absolute;left:0;right:0;height:%?60?%;text-align:center;flex-shrink:0}.u-navbar-centent-slot[data-v-2920cc37]{flex:1}.u-title[data-v-2920cc37]{line-height:%?60?%;font-size:%?32?%;flex:1}.u-navbar-right[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:flex-end}.u-slot-content[data-v-2920cc37]{flex:1;display:flex;flex-direction:row;align-items:center}',""]),t.exports=e},d2f3:function(t,e,n){"use strict";n.r(e);var r=n("1744"),i=n("f14d");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],a);e["default"]=c.exports},d3c3:function(t,e,n){"use strict";n.r(e);var r=n("0084"),i=n("24fe");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("05d7");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"30d8d7e6",null,!1,r["a"],a);e["default"]=c.exports},d50a:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("2ca0"),n("ac1f"),n("5319");var i=r(n("fc11")),o=r(n("f3f3")),a=r(n("9c49")),u=r(n("6eaa")),c=r(n("d3c3")),s=r(n("2fed")),l=n("4fcf6");e.default={props:{schema:{type:Object,default:function(){}},setFormModel:{type:Function,default:function(){}},formModel:{type:Object,default:function(){}},formActionType:{type:Object,default:function(){}},isOpen:{type:Boolean}},components:{ApiSelect:a.default,Select:u.default,Calendar:c.default,Input:s.default},created:function(){},computed:{getValues:function(){this.allDefaultValues;var t=this.formModel,e=this.schema;return{field:e.field,model:t,values:(0,o.default)({},t),schema:e}},getComponentsProps:function(){var t,e=this.schema,n=this.formModel,r=this.formActionType,i=e.componentProps,o=void 0===i?{}:i;this.isFunction(o)&&(o=null!==(t=o({schema:e,formModel:n,formActionType:r}))&&void 0!==t?t:{});return o},getBindValue:function(){var t,e=this,n=this.schema,r=n.component,a=n.field,u=n.changeEvent,c=void 0===u?"change":u,s=n.valueField,f=n.label,d="on".concat((0,l.upperFirst)(c)),p=(t={},(0,i.default)(t,d,(function(t){e.setFormModel(a,t)})),(0,i.default)(t,"onCloseDropdown",(function(){e.$emit("close-dropdown")})),t),h=(0,o.default)((0,o.default)({},this.getComponentsProps),{},{label:f});h.codeField=a,h.formValues=this.getValues;var v=(0,i.default)({},s||"value",this.formModel[a]),m=(0,o.default)((0,o.default)((0,o.default)((0,o.default)({is:r},h),v),p),{},{isOpen:this.isOpen}),g={},b={};for(var y in m)if(y.startsWith("on")&&"function"===typeof m[y]){var w=(0,l.kebabCase)(y.replace("on",""));g[w]=m[y]}else b[y]=m[y];return{bind:b,on:g}}},methods:{isFunction:function(t){return"function"===typeof t&&null!==t},fetch:function(){var t=this.formModel,e=this.schema,n=e.componentProps,r=void 0===n?{}:n,i=e.components;if(this.isFunction(r)&&(r=r({schema:e,formModel:t})),"ApiSelect"===i){var o=r,a=o.api;if(!a||!this.isFunction(a))return}else conponents;console.log(this.schema)}}}},d518:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uIcon:n("f86b").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{},[n("v-uni-view",{staticClass:"u-navbar",class:{"u-navbar-fixed":t.isFixed,"u-border-bottom":t.borderBottom},style:[t.navbarStyle]},[n("v-uni-view",{staticClass:"u-status-bar",style:{height:t.statusBarHeight+"px"}}),n("v-uni-view",{staticClass:"u-navbar-inner",style:[t.navbarInnerStyle]},[t.isBack?n("v-uni-view",{staticClass:"u-back-wrap",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goBack.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"u-icon-wrap"},[n("u-icon",{attrs:{name:t.backIconName,color:t.backIconColor,size:t.backIconSize}})],1),t.backText?n("v-uni-view",{staticClass:"u-icon-wrap u-back-text u-line-1",style:[t.backTextStyle]},[t._v(t._s(t.backText))]):t._e()],1):t._e(),t.title?n("v-uni-view",{staticClass:"u-navbar-content-title",style:[t.titleStyle]},[n("v-uni-view",{staticClass:"u-title u-line-1",style:{color:t.titleColor,fontSize:t.titleSize+"rpx",fontWeight:t.titleBold?"bold":"normal"}},[t._v(t._s(t.title))])],1):t._e(),n("v-uni-view",{staticClass:"u-slot-content"},[t._t("default")],2),n("v-uni-view",{staticClass:"u-slot-right"},[t._t("right")],2)],1)],1),t.isFixed&&!t.immersive?n("v-uni-view",{staticClass:"u-navbar-placeholder",style:{width:"100%",height:Number(t.navbarHeight)+t.statusBarHeight+"px"}}):t._e()],1)},o=[]},d54d:function(t,e,n){"use strict";n.r(e);var r=n("62f2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},da66:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={def:"zh",getType:function(){return uni.getStorageSync("mescroll-i18n")||this.def},setType:function(t){uni.setStorageSync("mescroll-i18n",t)}};e.default=r},db00:function(t,e,n){var r=n("24fb");e=r(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.inp[data-v-30d8d7e6]{border-radius:%?4?%;border-width:1px;-webkit-box-flex:1;-ms-flex:1 1 0%;-webkit-flex:1 1 0%;flex:1 1 0%;height:%?60?%;line-height:%?60?%;padding-left:10px;padding-right:10px}',""]),t.exports=e},dd40:function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},df51:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.option.src?n("v-uni-image",{staticClass:"mescroll-totop",class:[t.isShow?"mescroll-totop-in":"mescroll-totop-out",{"mescroll-totop-safearea":t.option.safearea}],style:{"z-index":t.option.zIndex,left:t.left,right:t.right,bottom:t.addUnit(t.option.bottom),width:t.addUnit(t.option.width),"border-radius":t.addUnit(t.option.radius)},attrs:{src:t.option.src,mode:"widthFix"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toTopClick.apply(void 0,arguments)}}}):t._e()},o=[]},dff1:function(t,e,n){"use strict";(function(t){var r=n("26ee"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i,u=a?r["a"].Buffer:void 0,c=u?u.allocUnsafe:void 0;function s(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}e["a"]=s}).call(this,n("dd40")(t))},e10c:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uCheckboxGroup:n("e620").default,uCheckbox:n("1e79").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-checkbox-group",{on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxGroupChange.apply(void 0,arguments)}}},t._l(t.getOptions,(function(e,r){return n("u-checkbox",{key:e.value,attrs:{name:e.value},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.checkboxChange.apply(void 0,arguments)}},model:{value:e.checked,callback:function(n){t.$set(e,"checked",n)},expression:"item.checked"}},[t._v(t._s(e.label))])})),1)],1)},o=[]},e16d:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uSticky:n("680e").default,mescrollBody:n("4d90").default,uSwipeAction:n("844c").default,uLine:n("ee53").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-sticky",[n("v-uni-view",{staticClass:"bg-white"},[n("SearchForm",{attrs:{schemas:t.searchFormSchema},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.handleSubmit.apply(void 0,arguments)}}})],1)],1),n("mescroll-body",{attrs:{up:t.upOption,down:t.downOption},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.mescrollInit.apply(void 0,arguments)},up:function(e){arguments[0]=e=t.$handleEvent(e),t.upCallback.apply(void 0,arguments)}}},[n("v-uni-view",t._l(t.dataList,(function(e,r){return n("u-swipe-action",{key:e.id,staticClass:"my-20rpx mx-30rpx rounded-md overflow-hidden",attrs:{show:e.show,index:r,options:t.options},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleClick.apply(void 0,arguments)},"content-click":function(e){arguments[0]=e=t.$handleEvent(e),t.handleContentClick.apply(void 0,arguments)}}},[n("v-uni-view",[n("v-uni-view",{staticClass:"bg-white p-20rpx"},[n("v-uni-view",[t._v("基地名称:"+t._s(e.name))]),n("v-uni-view",[t._v("农业类型:"+t._s(e.industry_label))]),n("v-uni-view",{staticClass:"my-12rpx"},[n("u-line")],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v("基地面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("种养殖面积")]),n("v-uni-view",{staticClass:"text-center"},[t._v("就业人数")])],1),n("v-uni-view",{staticClass:"grid grid-cols-3"},[n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.areas))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.cultivated))]),n("v-uni-view",{staticClass:"text-center"},[t._v(t._s(e.workforce))])],1)],1)],1)],1)})),1)],1)],1)},o=[]},e249:function(t,e,n){var r=n("980a");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("34ca650a",r,!0,{sourceMap:!1,shadowMode:!1})},e350:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,n("d3b7"),n("caad"),n("2532");var i=r(n("4360"));function o(t){if(t&&t instanceof Array&&t.length>0){var e,n,r=i.default.getters&&(null!==(e=null===(n=i.default.getters.userInfo)||void 0===n?void 0:n.permissions_slug)&&void 0!==e?e:[]),o=t,a=r.some((function(t){return o.includes(t)}));return a}return!1}},e407:function(t,e,n){"use strict";var r=n("f6315"),i=n.n(r);i.a},e620:function(t,e,n){"use strict";n.r(e);var r=n("9cbc"),i=n("e8d7");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("c86e");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"2c57e935",null,!1,r["a"],a);e["default"]=c.exports},e63d:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3"),n("d81d"),n("14d9");var i=r(n("4fff"));e.default={name:"u-checkbox-group",mixins:[i.default],props:{max:{type:[Number,String],default:999},disabled:{type:Boolean,default:!1},name:{type:[Boolean,String],default:""},labelDisabled:{type:Boolean,default:!1},shape:{type:String,default:"square"},activeColor:{type:String,default:"#2979ff"},size:{type:[String,Number],default:34},width:{type:String,default:"auto"},wrap:{type:Boolean,default:!1},iconSize:{type:[String,Number],default:20}},data:function(){return{}},created:function(){this.children=[]},methods:{emitEvent:function(){var t=this,e=[];this.children.map((function(t){t.value&&e.push(t.name)})),this.$emit("change",e),setTimeout((function(){t.dispatch("u-form-item","on-form-change",e)}),60)}}}},e859:function(t,e,n){"use strict";n.r(e);var r=n("aec2"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e8d7:function(t,e,n){"use strict";n.r(e);var r=n("e63d"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e941:function(t,e,n){"use strict";n("7a82");var r=n("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("0aec"));e.default={mixins:[i.default]}},e945:function(t,e,n){"use strict";n.r(e);var r=n("c4af"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},e96b:function(t,e,n){var r=n("0c42");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("7db8cb9e",r,!0,{sourceMap:!1,shadowMode:!1})},edb7:function(t,e,n){"use strict";var r=n("467c"),i=n.n(r);i.a},ee53:function(t,e,n){"use strict";n.r(e);var r=n("baac"),i=n("24ae");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("bd58");var a,u=n("f0c5"),c=Object(u["a"])(i["default"],r["b"],r["c"],!1,null,"3ed11d5a",null,!1,r["a"],a);e["default"]=c.exports},f039:function(t,e,n){"use strict";n.r(e);var r=n("4e37"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f14d:function(t,e,n){"use strict";n.r(e);var r=n("a87e"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},f2d8:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdown:n("20b3").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("u-dropdown",{ref:"dropdownRef",class:{dropdownClose:!t.isOpen},on:{open:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!0},close:function(e){arguments[0]=e=t.$handleEvent(e),t.isOpen=!1}}},t._l(t.getSchema,(function(e){return n("SearchItem",{key:e.field,attrs:{schema:e,formModel:t.formModel,setFormModel:t.setFormModel,formActionType:t.formActionType,isOpen:t.isOpen},on:{"close-dropdown":function(e){arguments[0]=e=t.$handleEvent(e),t.handleCloseDropdown.apply(void 0,arguments)}}})})),1),n("portal-target",{attrs:{name:"calendar-portal"}})],1)},o=[]},f3be:function(t,e,n){"use strict";var r=n("ffff"),i=n.n(r);i.a},f6315:function(t,e,n){var r=n("5fea");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("46f1aafd",r,!0,{sourceMap:!1,shadowMode:!1})},f68e:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uPopup:n("df25").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-popup",{attrs:{closeable:!0,width:t.width,height:t.width,mode:"center"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("v-uni-view",{staticClass:"relative h-full flex flex-col overflow-hidden"},[n("v-uni-view",{staticClass:"h-86rpx leading-86rpx flex-center w-full"},[t._t("title",[n("v-uni-view",{staticClass:"text-34rpx"},[t._v(t._s(t.title))])])],2),n("v-uni-view",{staticClass:"flex-1 overflow-y-auto w-full"},[t._t("default")],2),n("v-uni-view",[t._t("bottom")],2)],1)],1)},o=[]},f839:function(t,e,n){"use strict";var r=n("71e9"),i=n.n(r);i.a},f918:function(t,e,n){"use strict";var r=n("62be"),i=n.n(r);i.a},f926:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var r={uDropdownItem:n("0dcd").default,uInput:n("d5da").default,uLine:n("ee53").default,uButton:n("d9ad").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("u-dropdown-item",{attrs:{title:t.label}},[n("v-uni-view",{staticClass:"bg-white p-30rpx"},[n("u-input",{staticClass:"flex-1",attrs:{placeholder:t.placeholder},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}}),n("v-uni-view",{staticClass:"my-20rpx"},[n("u-line")],1),n("u-button",{attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleChange.apply(void 0,arguments)}}},[t._v("确定")])],1)],1)},o=[]},f940:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={name:"u-swipe-action",props:{index:{type:[Number,String],default:""},btnWidth:{type:[String,Number],default:180},disabled:{type:Boolean,default:!1},show:{type:Boolean,default:!1},bgColor:{type:String,default:"#ffffff"},vibrateShort:{type:Boolean,default:!1},options:{type:Array,default:function(){return[]}}},watch:{show:{immediate:!0,handler:function(t,e){t?this.open():this.close()}}},data:function(){return{moveX:0,scrollX:0,status:!1,movableAreaWidth:0,elId:this.$u.guid(),showBtn:!1}},computed:{movableViewWidth:function(){return this.movableAreaWidth+this.allBtnWidth+"px"},innerBtnWidth:function(){return uni.upx2px(this.btnWidth)},allBtnWidth:function(){return uni.upx2px(this.btnWidth)*this.options.length},btnStyle:function(){var t=this;return function(e){return e.width=t.btnWidth+"rpx",e}}},mounted:function(){this.getActionRect()},methods:{btnClick:function(t){this.status=!1,this.$emit("click",this.index,t)},change:function(t){this.scrollX=t.detail.x},close:function(){this.moveX=0,this.status=!1},open:function(){this.disabled||(this.moveX=-this.allBtnWidth,this.status=!0)},touchend:function(){this.moveX=this.scrollX,this.$nextTick((function(){var t=this;0==this.status?this.scrollX<=-this.allBtnWidth/4?(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent(),this.vibrateShort&&uni.vibrateShort()):(this.moveX=0,this.status=!1,this.emitCloseEvent()):this.scrollX>3*-this.allBtnWidth/4?(this.moveX=0,this.$nextTick((function(){t.moveX=101})),this.status=!1,this.emitCloseEvent()):(this.moveX=-this.allBtnWidth,this.status=!0,this.emitOpenEvent())}))},emitOpenEvent:function(){this.$emit("open",this.index)},emitCloseEvent:function(){this.$emit("close",this.index)},touchstart:function(){},getActionRect:function(){var t=this;this.$uGetRect(".u-swipe-action").then((function(e){t.movableAreaWidth=e.width,t.$nextTick((function(){t.showBtn=!0}))}))},contentClick:function(){1==this.status&&(this.status="close",this.moveX=0),this.$emit("content-click",this.index)}}}},fe9d:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");e.default={props:{label:{type:String,default:""},value:{type:[Array,Object,String,Number]},placeholder:{type:[Array,String],default:"请输入"},isOpen:{type:Boolean}},computed:{},data:function(){return{status:""}},methods:{handleChange:function(){this.$emit("change",this.status),this.$emit("close-dropdown",this.status)}},watch:{isOpen:{handler:function(t){this.status=this.value},immediate:!0}}}},ffff:function(t,e,n){var r=n("75c4");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var i=n("4f06").default;i("2143248c",r,!0,{sourceMap:!1,shadowMode:!1})}}]); \ No newline at end of file diff --git a/dist/build/h5/static/js/pages-index-monitor.25f897da.js b/dist/build/h5/static/js/pages-index-monitor.810e53f6.js similarity index 94% rename from dist/build/h5/static/js/pages-index-monitor.25f897da.js rename to dist/build/h5/static/js/pages-index-monitor.810e53f6.js index 7a47754..b436b8a 100644 --- a/dist/build/h5/static/js/pages-index-monitor.25f897da.js +++ b/dist/build/h5/static/js/pages-index-monitor.810e53f6.js @@ -1,4 +1,4 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-monitor"],{"0158":function(e,t,i){"use strict";i.r(t);var n=i("0247"),a=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);t["default"]=a.a},"0235":function(e,t,i){"use strict";i.d(t,"i",(function(){return l})),i.d(t,"h",(function(){return u})),i.d(t,"d",(function(){return c})),i.d(t,"f",(function(){return h})),i.d(t,"e",(function(){return p})),i.d(t,"c",(function(){return f})),i.d(t,"g",(function(){return v})),i.d(t,"a",(function(){return m})),i.d(t,"b",(function(){return g}));var n=i("be09"),a=i.n(n),r={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},s=["video","audio","text"],o=["Video","Audio","Text"],l=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a})):e},u=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),s.forEach((function(n){var a=r[n].exec(e.toLowerCase());if(a&&!(a.length<=1)){t=n;var s=e.substring(0,a[1].length),o=e.replace(s,"");i.push({type:s,details:o,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},c=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var a=i[n];if(a.default&&a.playlists)return u(a.playlists[0].attributes.CODECS)}return null},h=function(e){return void 0===e&&(e=""),r.audio.test(e.trim().toLowerCase())},d=function(e){return void 0===e&&(e=""),r.text.test(e.trim().toLowerCase())},p=function(e){if(e&&"string"===typeof e){var t=e.toLowerCase().split(",").map((function(e){return l(e.trim())})),i="video";1===t.length&&h(t[0])?i="audio":1===t.length&&d(t[0])&&(i="application");var n="mp4";return t.every((function(e){return r.mp4.test(e)}))?n="mp4":t.every((function(e){return r.webm.test(e)}))?n="webm":t.every((function(e){return r.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}},f=function(e){return void 0===e&&(e=""),a.a.MediaSource&&a.a.MediaSource.isTypeSupported&&a.a.MediaSource.isTypeSupported(p(e))||!1},v=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t=0&&!this.plain?"":"u-hairline-border"}},data:function(){return{rippleTop:0,rippleLeft:0,fields:{},waveActive:!1}},methods:{click:function(e){var t=this;this.$u.throttle((function(){!0!==t.loading&&!0!==t.disabled&&(t.ripple&&(t.waveActive=!1,t.$nextTick((function(){this.getWaveQuery(e)}))),t.$emit("click",e))}),this.throttleTime)},getWaveQuery:function(e){var t=this;this.getElQuery().then((function(i){var n=i[0];if(n.width&&n.width&&(n.targetWidth=n.height>n.width?n.height:n.width,n.targetWidth)){t.fields=n;var a="",r="";a=e.touches[0].clientX,r=e.touches[0].clientY,t.rippleTop=r-n.top-n.targetWidth/2,t.rippleLeft=a-n.left-n.targetWidth/2,t.$nextTick((function(){t.waveActive=!0}))}}))},getElQuery:function(){var e=this;return new Promise((function(t){var i="";i=uni.createSelectorQuery().in(e),i.select(".u-btn").boundingClientRect(),i.exec((function(e){t(e)}))}))},getphonenumber:function(e){this.$emit("getphonenumber",e)},getuserinfo:function(e){this.$emit("getuserinfo",e)},error:function(e){this.$emit("error",e)},opensetting:function(e){this.$emit("opensetting",e)},launchapp:function(e){this.$emit("launchapp",e)}}}},"045b":function(e,t,i){"use strict";var n=i("7b5a"),a=i.n(n);a.a},"0696":function(e,t,i){"use strict";var n=i("8866"),a=i.n(n);a.a},"095a":function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return s}));var n=i("be09"),a=i.n(n),r=function(t){return a.a.atob?a.a.atob(t):e.from(t,"base64").toString("binary")};function s(e){for(var t=r(e),i=new Uint8Array(t.length),n=0;n0;a+=12,r--)i.references.push({referenceType:(128&e[a])>>>7,referencedSize:2147483647&t.getUint32(a),subsegmentDuration:t.getUint32(a+4),startsWithSap:!!(128&e[a+8]),sapType:(112&e[a+8])>>>4,sapDeltaTime:268435455&t.getUint32(a+8)});return i};e.exports=a},"0b92":function(e,t,i){var n=i("7357");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i("4f06").default;a("87c220d8",n,!0,{sourceMap:!1,shadowMode:!1})},"0c01":function(e,t,i){"use strict";var n=i("d136"),a=i.n(n),r=i("be09"),s=i.n(r),o="http://example.com",l=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=s.a.location&&s.a.location.href||"");var i="function"===typeof s.a.URL,n=/^\/\//.test(e),r=!s.a.location&&!/\/\//i.test(e);if(i?e=new s.a.URL(e,s.a.location||o):/\/\//i.test(e)||(e=a.a.buildAbsoluteURL(s.a.location&&s.a.location.href||"",e)),i){var l=new URL(t,e);return r?l.href.slice(o.length):n?l.href.slice(l.protocol.length):l.href}return a.a.buildAbsoluteURL(e,t)};t["a"]=l},"0c1c":function(e,t,i){"use strict";e.exports=function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},"0c42":function(e,t,i){var n=i("24fb");t=n(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-switch[data-v-0d3821ba]{position:relative;display:inline-block;box-sizing:initial;width:2em;height:1em;background-color:#fff;border:1px solid rgba(0,0,0,.1);border-radius:1em;transition:background-color .3s;font-size:%?50?%}.u-switch__node[data-v-0d3821ba]{display:flex;flex-direction:row;align-items:center;justify-content:center;position:absolute;top:0;left:0;border-radius:100%;z-index:1;background-color:#fff;background-color:#fff;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05),-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:-webkit-transform cubic-bezier(.3,1.05,.4,1.05);transition:transform cubic-bezier(.3,1.05,.4,1.05);transition:transform cubic-bezier(.3,1.05,.4,1.05),-webkit-transform cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05)}.u-switch__loading[data-v-0d3821ba]{display:flex;flex-direction:row;align-items:center;justify-content:center}.u-switch--on[data-v-0d3821ba]{background-color:#1989fa}.u-switch--on .u-switch__node[data-v-0d3821ba]{-webkit-transform:translateX(100%);transform:translateX(100%)}.u-switch--disabled[data-v-0d3821ba]{opacity:.4}',""]),e.exports=t},"0de0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return/mp4a\.\d+.\d+/i.test(e)},a=function(e){return/avc1\.[\da-f]+/i.test(e)},r=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),a=i[1].replace(/"/g,"").trim();t.parameters[n]=a}})),t},s=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a}))}))};t["default"]={isAudioCodec:n,parseContentType:r,isVideoCodec:a,translateLegacyCodecs:s},e.exports=t["default"]},"0ea2":function(e,t,i){"use strict";var n,a,r,s=i("4329"),o=i("4e69"),l=i("ae75"),u=i("256f").TimestampRolloverStream,c=i("ae75"),h=188,d=71;n=function(){var e=new Uint8Array(h),t=0;n.prototype.init.call(this),this.push=function(i){var n,a=0,r=h;t?(n=new Uint8Array(i.byteLength+t),n.set(e.subarray(0,t)),n.set(i,t),t=0):n=i;while(r>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=l.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=l.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},a.prototype=new s,a.STREAM_TYPES={h264:27,adts:15},r=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},a=function(e,t){var i;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])},s=function(t,i,n){var r,s=new Uint8Array(t.size),o={type:i},l=0,u=0,c=!1;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,l=0;l=0&&e<=100}function r(){var e=100,t=3,i=0,r=100,s=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!a(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!a(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!a(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!a(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!a(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t}}})}e.exports=r},"12c6":function(e,t,i){ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-monitor"],{"0158":function(e,t,i){"use strict";i.r(t);var n=i("0247"),a=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);t["default"]=a.a},"0235":function(e,t,i){"use strict";i.d(t,"i",(function(){return l})),i.d(t,"h",(function(){return u})),i.d(t,"d",(function(){return c})),i.d(t,"f",(function(){return h})),i.d(t,"e",(function(){return p})),i.d(t,"c",(function(){return f})),i.d(t,"g",(function(){return v})),i.d(t,"a",(function(){return m})),i.d(t,"b",(function(){return g}));var n=i("be09"),a=i.n(n),r={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},s=["video","audio","text"],o=["Video","Audio","Text"],l=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a})):e},u=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),s.forEach((function(n){var a=r[n].exec(e.toLowerCase());if(a&&!(a.length<=1)){t=n;var s=e.substring(0,a[1].length),o=e.replace(s,"");i.push({type:s,details:o,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},c=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var a=i[n];if(a.default&&a.playlists)return u(a.playlists[0].attributes.CODECS)}return null},h=function(e){return void 0===e&&(e=""),r.audio.test(e.trim().toLowerCase())},d=function(e){return void 0===e&&(e=""),r.text.test(e.trim().toLowerCase())},p=function(e){if(e&&"string"===typeof e){var t=e.toLowerCase().split(",").map((function(e){return l(e.trim())})),i="video";1===t.length&&h(t[0])?i="audio":1===t.length&&d(t[0])&&(i="application");var n="mp4";return t.every((function(e){return r.mp4.test(e)}))?n="mp4":t.every((function(e){return r.webm.test(e)}))?n="webm":t.every((function(e){return r.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}},f=function(e){return void 0===e&&(e=""),a.a.MediaSource&&a.a.MediaSource.isTypeSupported&&a.a.MediaSource.isTypeSupported(p(e))||!1},v=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t=0&&!this.plain?"":"u-hairline-border"}},data:function(){return{rippleTop:0,rippleLeft:0,fields:{},waveActive:!1}},methods:{click:function(e){var t=this;this.$u.throttle((function(){!0!==t.loading&&!0!==t.disabled&&(t.ripple&&(t.waveActive=!1,t.$nextTick((function(){this.getWaveQuery(e)}))),t.$emit("click",e))}),this.throttleTime)},getWaveQuery:function(e){var t=this;this.getElQuery().then((function(i){var n=i[0];if(n.width&&n.width&&(n.targetWidth=n.height>n.width?n.height:n.width,n.targetWidth)){t.fields=n;var a="",r="";a=e.touches[0].clientX,r=e.touches[0].clientY,t.rippleTop=r-n.top-n.targetWidth/2,t.rippleLeft=a-n.left-n.targetWidth/2,t.$nextTick((function(){t.waveActive=!0}))}}))},getElQuery:function(){var e=this;return new Promise((function(t){var i="";i=uni.createSelectorQuery().in(e),i.select(".u-btn").boundingClientRect(),i.exec((function(e){t(e)}))}))},getphonenumber:function(e){this.$emit("getphonenumber",e)},getuserinfo:function(e){this.$emit("getuserinfo",e)},error:function(e){this.$emit("error",e)},opensetting:function(e){this.$emit("opensetting",e)},launchapp:function(e){this.$emit("launchapp",e)}}}},"03a3":function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){return n}));var n={uSubsection:i("3ba2").default,uDropdown:i("20b3").default,uDropdownItem:i("0dcd").default,uIcon:i("f86b").default,uButton:i("d9ad").default,uSwitch:i("89f2").default,uLoadmore:i("eb64").default,uEmpty:i("7516").default,uPicker:i("665d").default},a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("v-uni-view",{staticClass:"monitor-page bg-page"},[i("v-uni-view",{staticClass:"utab-section"},[i("u-subsection",{attrs:{list:e.list,current:e.current},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.sectionChange.apply(void 0,arguments)}}})],1),i("v-uni-view",{staticClass:"secreen-section",staticStyle:{"background-color":"#fff"}},[0==e.current?i("u-dropdown",{ref:"uDropdown",staticClass:"dropdown-box"},[i("u-dropdown-item",{attrs:{title:"基地",height:"700rpx",options:e.deviceAddressList},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.change.apply(void 0,arguments)}},model:{value:e.addressValue,callback:function(t){e.addressValue=t},expression:"addressValue"}}),i("u-dropdown-item",{attrs:{title:"检测点",height:"700rpx",options:e.options2},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.change2.apply(void 0,arguments)}},model:{value:e.device_id,callback:function(t){e.device_id=t},expression:"device_id"}}),i("u-dropdown-item",{attrs:{title:"全部",options:e.options3},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.change3.apply(void 0,arguments)}},model:{value:e.is_recommend,callback:function(t){e.is_recommend=t},expression:"is_recommend"}})],1):e._e(),1==e.current?i("u-dropdown",{ref:"uDropdown2",staticClass:"dropdown-box",on:{open:function(t){arguments[0]=t=e.$handleEvent(t),e.openDropDown.apply(void 0,arguments)}}},[i("u-dropdown-item",{attrs:{title:"基地",height:"700rpx",options:e.deviceAddressList2},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.change.apply(void 0,arguments)}},model:{value:e.addressValue2,callback:function(t){e.addressValue2=t},expression:"addressValue2"}}),i("u-dropdown-item",{attrs:{title:"检测点",height:"700rpx",options:e.options4},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.change4.apply(void 0,arguments)}},model:{value:e.device_id2,callback:function(t){e.device_id2=t},expression:"device_id2"}}),1==e.current?i("u-dropdown-item",{attrs:{title:"日期"}},[i("v-uni-view",{staticClass:"slot-content",staticStyle:{"background-color":"#ffffff"}},[i("v-uni-view",{staticClass:"select-date u-border-bottom",staticStyle:{"margin-bottom":"0"}},[i("v-uni-view",{staticClass:"name",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerTimeFn("start")}}},[i("u-icon",{attrs:{name:"calendar",color:"#333",size:"32"}}),i("v-uni-text",{staticStyle:{"margin-left":"6rpx"}},[e._v("开始时间:")])],1),i("v-uni-view",{staticClass:"time_box"},[e.start_date_c?i("v-uni-view",{staticClass:"tile_val",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerTimeFn("start")}}},[e._v(e._s(e.start_date_c))]):i("v-uni-view",{staticClass:"tip_txt",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerTimeFn("start")}}},[e._v("请选择开始时间")]),e.start_date_c?i("v-uni-view",{staticClass:"delete_btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.deleteDateFn("start")}}},[i("u-icon",{attrs:{name:"close-circle",color:"#333",size:"34"}})],1):e._e()],1)],1),i("v-uni-view",{staticClass:"select-date u-border-bottom",staticStyle:{"margin-bottom":"0"}},[i("v-uni-view",{staticClass:"name",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerTimeFn("end")}}},[i("u-icon",{attrs:{name:"calendar",color:"#333",size:"32"}}),i("v-uni-text",{staticStyle:{"margin-left":"6rpx"}},[e._v("结束时间:")])],1),i("v-uni-view",{staticClass:"time_box"},[e.end_date_c?i("v-uni-view",{staticClass:"tile_val",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerTimeFn("end")}}},[e._v(e._s(e.end_date_c))]):i("v-uni-view",{staticClass:"tip_txt",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerTimeFn("end")}}},[e._v("请选择结束时间")]),e.end_date_c?i("v-uni-view",{staticClass:"delete_btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.deleteDateFn("end")}}},[i("u-icon",{attrs:{name:"close-circle",color:"#333",size:"34"}})],1):e._e()],1)],1),e.selectedTimeTip?i("v-uni-view",{staticClass:"select-date u-border-bottom"},[i("v-uni-view",{staticClass:"tip_err_text"},[e._v("请选择开始时间和结束时间,查询视频")])],1):e._e(),i("v-uni-view",{staticClass:"btn_group"},[i("u-button",{staticClass:"btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.resetSecreen()}}},[e._v("重置")]),i("u-button",{staticClass:"btn",attrs:{type:"primary"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.selectedDateConform()}}},[e._v("查询")])],1)],1)],1):e._e()],1):e._e()],1),0==e.current&&e.addressName?i("v-uni-view",{staticClass:"secreen-show-box mt20"},[i("v-uni-view",{staticClass:"label_t"},[e._v("当前位置:")]),i("v-uni-view",{staticClass:"info"},[e._v(e._s(e.addressName)+"-"+e._s(e.device_id?e.device_id:"全部")+"-"+e._s(e.is_recommend?"推荐":"全部"))])],1):e._e(),1==e.current&&e.q_start_time?i("v-uni-view",{staticClass:"secreen-show-box mt20"},[i("v-uni-view",{staticClass:"label_t"},[e._v("查询:")]),i("v-uni-view",{staticClass:"info"},[i("v-uni-view",[e._v(e._s(e.addressName2)+"-"+e._s(e.device_id2))]),i("v-uni-view",[e._v(e._s(e.q_start_time)+" 到 "+e._s(e.q_end_time))])],1)],1):e._e(),i("v-uni-view",{staticClass:"content-box"},[i("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:0==e.current,expression:"current == 0"}],staticClass:"video_ul"},[e._l(e.videoList,(function(t,n){return i("v-uni-view",{key:n+"s",staticClass:"video_li"},[i("v-uni-view",{staticClass:"video_cd"},[i("LiveVideo",{attrs:{id:t.id}})],1),i("v-uni-view",{staticClass:"bottom-box"},[i("v-uni-view",{staticClass:"row flex-row"},[i("v-uni-view",{staticClass:"lab"},[e._v("推荐:")]),i("u-switch",{attrs:{size:"30"},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.changeRecommend(t,n)}},model:{value:t.bl_recommend,callback:function(i){e.$set(t,"bl_recommend",i)},expression:"video.bl_recommend"}})],1),i("v-uni-view",{staticClass:"address"},[e._v(e._s(t.base_name)+"-"+e._s(t.monitoring_point))])],1)],1)})),i("u-loadmore",{attrs:{status:e.loading}})],2),i("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:1==e.current,expression:"current == 1"}],staticClass:"video_ul"},[e._l(e.videoList2,(function(t,n){return i("v-uni-view",{key:n+"s2",staticClass:"video_li"},[i("v-uni-view",{staticClass:"video_cd"},[i("LiveVideo",{attrs:{id:t.id}})],1),i("v-uni-view",{staticClass:"bottom-box"},[i("v-uni-view",{staticClass:"address"},[e._v(e._s(t.base_name)+"-"+e._s(t.monitoring_point))])],1)],1)})),e.loading2?i("u-loadmore",{attrs:{status:e.loading2}}):e._e(),e.videoList2&&e.videoList2.length?e._e():i("u-empty",{attrs:{text:"请选择要查看的视频的日期",mode:"history","margin-top":"100"}})],2)],1),i("u-picker",{attrs:{mode:"time",params:e.pickerParams,"default-time":e.defaultTime},on:{confirm:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerChange.apply(void 0,arguments)}},model:{value:e.pickerShow,callback:function(t){e.pickerShow=t},expression:"pickerShow"}})],1)},r=[]},"0696":function(e,t,i){"use strict";var n=i("8866"),a=i.n(n);a.a},"095a":function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return s}));var n=i("be09"),a=i.n(n),r=function(t){return a.a.atob?a.a.atob(t):e.from(t,"base64").toString("binary")};function s(e){for(var t=r(e),i=new Uint8Array(t.length),n=0;n0;a+=12,r--)i.references.push({referenceType:(128&e[a])>>>7,referencedSize:2147483647&t.getUint32(a),subsegmentDuration:t.getUint32(a+4),startsWithSap:!!(128&e[a+8]),sapType:(112&e[a+8])>>>4,sapDeltaTime:268435455&t.getUint32(a+8)});return i};e.exports=a},"0b92":function(e,t,i){var n=i("7357");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i("4f06").default;a("87c220d8",n,!0,{sourceMap:!1,shadowMode:!1})},"0c01":function(e,t,i){"use strict";var n=i("d136"),a=i.n(n),r=i("be09"),s=i.n(r),o="http://example.com",l=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=s.a.location&&s.a.location.href||"");var i="function"===typeof s.a.URL,n=/^\/\//.test(e),r=!s.a.location&&!/\/\//i.test(e);if(i?e=new s.a.URL(e,s.a.location||o):/\/\//i.test(e)||(e=a.a.buildAbsoluteURL(s.a.location&&s.a.location.href||"",e)),i){var l=new URL(t,e);return r?l.href.slice(o.length):n?l.href.slice(l.protocol.length):l.href}return a.a.buildAbsoluteURL(e,t)};t["a"]=l},"0c1c":function(e,t,i){"use strict";e.exports=function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},"0c42":function(e,t,i){var n=i("24fb");t=n(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.u-switch[data-v-0d3821ba]{position:relative;display:inline-block;box-sizing:initial;width:2em;height:1em;background-color:#fff;border:1px solid rgba(0,0,0,.1);border-radius:1em;transition:background-color .3s;font-size:%?50?%}.u-switch__node[data-v-0d3821ba]{display:flex;flex-direction:row;align-items:center;justify-content:center;position:absolute;top:0;left:0;border-radius:100%;z-index:1;background-color:#fff;background-color:#fff;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05),-webkit-transform .3s cubic-bezier(.3,1.05,.4,1.05);transition:-webkit-transform cubic-bezier(.3,1.05,.4,1.05);transition:transform cubic-bezier(.3,1.05,.4,1.05);transition:transform cubic-bezier(.3,1.05,.4,1.05),-webkit-transform cubic-bezier(.3,1.05,.4,1.05);transition:transform .3s cubic-bezier(.3,1.05,.4,1.05)}.u-switch__loading[data-v-0d3821ba]{display:flex;flex-direction:row;align-items:center;justify-content:center}.u-switch--on[data-v-0d3821ba]{background-color:#1989fa}.u-switch--on .u-switch__node[data-v-0d3821ba]{-webkit-transform:translateX(100%);transform:translateX(100%)}.u-switch--disabled[data-v-0d3821ba]{opacity:.4}',""]),e.exports=t},"0de0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return/mp4a\.\d+.\d+/i.test(e)},a=function(e){return/avc1\.[\da-f]+/i.test(e)},r=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),a=i[1].replace(/"/g,"").trim();t.parameters[n]=a}})),t},s=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),a=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+a}))}))};t["default"]={isAudioCodec:n,parseContentType:r,isVideoCodec:a,translateLegacyCodecs:s},e.exports=t["default"]},"0ea2":function(e,t,i){"use strict";var n,a,r,s=i("4329"),o=i("4e69"),l=i("ae75"),u=i("256f").TimestampRolloverStream,c=i("ae75"),h=188,d=71;n=function(){var e=new Uint8Array(h),t=0;n.prototype.init.call(this),this.push=function(i){var n,a=0,r=h;t?(n=new Uint8Array(i.byteLength+t),n.set(e.subarray(0,t)),n.set(i,t),t=0):n=i;while(r>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=l.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=l.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},a.prototype=new s,a.STREAM_TYPES={h264:27,adts:15},r=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},a=function(e,t){var i;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])},s=function(t,i,n){var r,s=new Uint8Array(t.size),o={type:i},l=0,u=0,c=!1;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,l=0;l=0&&e<=100}function r(){var e=100,t=3,i=0,r=100,s=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!a(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!a(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!a(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!a(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!a(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t}}})}e.exports=r},"12c6":function(e,t,i){ /** * @license * Video.js 6.13.0 @@ -10,7 +10,7 @@ * Available under Apache License Version 2.0 * */ -function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var a=n(i("ea7c")),r=n(i("4742")),s=n(i("1b8d")),o=n(i("8c10")),l=n(i("eec7")),u=n(i("bec7")),c="6.13.0",h=a.navigator&&a.navigator.userAgent||"",d=/AppleWebKit\/([\d.]+)/i.exec(h),p=d?parseFloat(d.pop()):null,f=/iPad/i.test(h),v=/iPhone/i.test(h)&&!f,m=/iPod/i.test(h),g=v||f||m,b=function(){var e=h.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),y=/Android/i.test(h),_=function(){var e=h.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),T=y&&/webkit/i.test(h)&&_<2.3,S=y&&_<5&&p<537,w=/Firefox/i.test(h),k=/Edge/i.test(h),E=!k&&(/Chrome/i.test(h)||/CriOS/i.test(h)),C=function(){var e=h.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),x=/MSIE\s8\.0/.test(h),A=function(){var e=/MSIE\s(\d+)\.\d/.exec(h),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(h)&&/rv:11.0/.test(h)&&(t=11),t}(),j=/Safari/i.test(h)&&!E&&!y&&!k,I=(j||g)&&!E,O=ie()&&("ontouchstart"in a||a.navigator.maxTouchPoints||a.DocumentTouch&&a.document instanceof a.DocumentTouch),P=ie()&&"backgroundSize"in a.document.createElement("video").style,L=(Object.freeze||Object)({IS_IPAD:f,IS_IPHONE:v,IS_IPOD:m,IS_IOS:g,IOS_VERSION:b,IS_ANDROID:y,ANDROID_VERSION:_,IS_OLD_ANDROID:T,IS_NATIVE_ANDROID:S,IS_FIREFOX:w,IS_EDGE:k,IS_CHROME:E,CHROME_VERSION:C,IS_IE8:x,IE_VERSION:A,IS_SAFARI:j,IS_ANY_SAFARI:I,TOUCH_ENABLED:O,BACKGROUND_SIZE_SUPPORTED:P}),D="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},M=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},R=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},N=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t},B=function(e,t){return e.raw=t,e},U=Object.prototype.toString,F=function(e){return z(e)?Object.keys(e):[]};function V(e,t){F(e).forEach((function(i){return t(e[i],i)}))}function H(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return F(e).reduce((function(i,n){return t(i,e[n],n)}),i)}function q(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],a=r.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Y.warn(s(J,e,i)),a.setAttribute(e,i)):"textContent"===e?oe(a,i):a[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){a.setAttribute(e,i[e])})),n&&Ce(a,n),a}function oe(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function le(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ue(e,t){return ee(t),e.classList?e.classList.contains(t):te(t).test(e.className)}function ce(e,t){return e.classList?e.classList.add(t):ue(e,t)||(e.className=(e.className+" "+t).trim()),e}function he(e,t){return e.classList?e.classList.remove(t):(ee(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function de(e,t,i){var n=ue(e,t);if("function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=!n),i!==n)return i?ce(e,t):he(e,t),e}function pe(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function fe(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,a=n.length-1;a>=0;a--){var r=n[a].name,s=n[a].value;"boolean"!==typeof e[r]&&-1===i.indexOf(","+r+",")||(s=null!==s),t[r]=s}return t}function ve(e,t){return e.getAttribute(t)}function me(e,t,i){e.setAttribute(t,i)}function ge(e,t){e.removeAttribute(t)}function be(){r.body.focus(),r.onselectstart=function(){return!1}}function ye(){r.onselectstart=function(){return!0}}function _e(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Q(e,"height"))),i.width||(i.width=parseFloat(Q(e,"width"))),i}}function Te(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=r.documentElement,n=r.body,s=i.clientLeft||n.clientLeft||0,o=a.pageXOffset||n.scrollLeft,l=t.left+o-s,u=i.clientTop||n.clientTop||0,c=a.pageYOffset||n.scrollTop,h=t.top+c-u;return{left:Math.round(l),top:Math.round(h)}}function Se(e,t){var i={},n=Te(e),a=e.offsetWidth,r=e.offsetHeight,s=n.top,o=n.left,l=t.pageY,u=t.pageX;return t.changedTouches&&(u=t.changedTouches[0].pageX,l=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-l+r)/r)),i.x=Math.max(0,Math.min(1,(u-o)/a)),i}function we(e){return z(e)&&3===e.nodeType}function ke(e){while(e.firstChild)e.removeChild(e.firstChild);return e}function Ee(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"===typeof e&&(e=e()),ne(e)||we(e)?e:"string"===typeof e&&/\S/.test(e)?r.createTextNode(e):void 0})).filter((function(e){return e}))}function Ce(e,t){return Ee(t).forEach((function(t){return e.appendChild(t)})),e}function xe(e,t){return Ce(ke(e),t)}function Ae(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||(9===A||0===e.button&&1===e.buttons))}var je=re("querySelector"),Ie=re("querySelectorAll"),Oe=(Object.freeze||Object)({isReal:ie,isEl:ne,isInFrame:ae,createEl:se,textContent:oe,prependTo:le,hasClass:ue,addClass:ce,removeClass:he,toggleClass:de,setAttributes:pe,getAttributes:fe,getAttribute:ve,setAttribute:me,removeAttribute:ge,blockTextSelection:be,unblockTextSelection:ye,getBoundingClientRect:_e,findPosition:Te,getPointerPosition:Se,isTextNode:we,emptyEl:ke,normalizeContent:Ee,appendContent:Ce,insertContent:xe,isSingleLeftClick:Ae,$:je,$$:Ie}),Pe=1;function Le(){return Pe++}var De={},Me="vdata"+(new Date).getTime();function Re(e){var t=e[Me];return t||(t=e[Me]=Le()),De[t]||(De[t]={}),De[t]}function Ne(e){var t=e[Me];return!!t&&!!Object.getOwnPropertyNames(De[t]).length}function Be(e){var t=e[Me];if(t){delete De[t];try{delete e[Me]}catch(i){e.removeAttribute?e.removeAttribute(Me):e[Me]=null}}}function Ue(e,t){var i=Re(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Be(e)}function Fe(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Ve(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||a.event;for(var s in e={},n)"layerX"!==s&&"layerY"!==s&&"keyLocation"!==s&&"webkitMovementX"!==s&&"webkitMovementY"!==s&&("returnValue"===s&&n.preventDefault||(e[s]=n[s]));if(e.target||(e.target=e.srcElement||r),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var o=r.documentElement,l=r.body;e.pageX=e.clientX+(o&&o.scrollLeft||l&&l.scrollLeft||0)-(o&&o.clientLeft||l&&l.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||l&&l.scrollTop||0)-(o&&o.clientTop||l&&l.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var He=!1;(function(){try{var e=Object.defineProperty({},"passive",{get:function(){He=!0}});a.addEventListener("test",null,e),a.removeEventListener("test",null,e)}catch(t){}})();var qe=["touchstart","touchmove"];function ze(e,t,i){if(Array.isArray(t))return Fe(ze,e,t,i);var n=Re(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Le()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=Ve(t);var a=n.handlers[t.type];if(a)for(var r=a.slice(0),s=0,o=r.length;s-1&&(a={passive:!0}),e.addEventListener(t,n.dispatcher,a)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function We(e,t,i){if(Ne(e)){var n=Re(e);if(n.handlers){if(Array.isArray(t))return Fe(We,e,t,i);var a=function(e,t){n.handlers[t]=[],Ue(e,t)};if(void 0!==t){var r=n.handlers[t];if(r)if(i){if(i.guid)for(var s=0;s0)for(var a=0,s=e.length;a0)for(var o=0,l=t.length;o0)for(var u=0,c=i.length;u0)for(var h=0,d=n.length;h=t&&(e.apply(void 0,arguments),i=n)};return n},nt=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a,r=void 0,s=function(){n.clearTimeout(r),r=null},o=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return o.cancel=s,o},at=function(){};at.prototype.allowedEvents_={},at.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ze(this,e,t),this.addEventListener=i},at.prototype.addEventListener=at.prototype.on,at.prototype.off=function(e,t){We(this,e,t)},at.prototype.removeEventListener=at.prototype.off,at.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},$e(this,e,t),this.addEventListener=i},at.prototype.trigger=function(e){var t=e.type||e;"string"===typeof e&&(e={type:t}),e=Ve(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ge(this,e)},at.prototype.dispatchEvent=at.prototype.trigger;var rt=function(e){return e instanceof at||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"===typeof e[t]}))},st=function(e){return"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ot=function(e){if(!e.nodeName&&!rt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},lt=function(e){if(!st(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ut=function(e){if("function"!==typeof e)throw new Error("Invalid listener; must be a function.")},ct=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n=void 0,a=void 0,r=void 0;return i?(n=e.eventBusEl_,t.length>=3&&t.shift(),a=t[0],r=t[1]):(n=t[0],a=t[1],r=t[2]),ot(n),lt(a),ut(r),r=tt(e,r),{isTargetingSelf:i,target:n,type:a,listener:r}},ht=function(e,t,i,n){ot(e),e.nodeName?Xe[t](e,i,n):e[t](i,n)},dt={on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=se("span",{className:"vjs-event-bus"});return q(e,dt),e.on("dispose",(function(){e.off(),a.setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ft={state:{},setState:function(e){var t=this;"function"===typeof e&&(e=e());var i=void 0;return V(e,(function(e,n){t.state[n]!==e&&(i=i||{},i[n]={from:t.state[n],to:e}),t.state[n]=e})),i&&rt(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function vt(e,t){return q(e,ft),e.state=q({},e.state,t),"function"===typeof e.handleStateChanged&&rt(e)&&e.on("statechanged",e.handleStateChanged),e}function mt(e){return"string"!==typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function gt(e,t){return mt(e)===mt(t)}function bt(){for(var e={},t=arguments.length,i=Array(t),n=0;n=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Be(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return Y.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=bt(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return se(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=this.player_.language&&this.player_.language(),a=this.player_.languages&&this.player_.languages(),r=a&&a[n],s=n&&n.split("-")[0],o=a&&a[s],l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],a=n;return"undefined"===typeof n&&(a=e),a}))),l},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=mt(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,a=void 0,r=void 0;if("string"===typeof t){r=mt(t);var s=i.componentClass||r;i.name=r;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!==typeof o)return null;a=new o(this.player_||this,i)}else a=t;if(this.children_.splice(n,0,a),"function"===typeof a.id&&(this.childIndex_[a.id()]=a),r=r||a.name&&mt(a.name()),r&&(this.childNameIndex_[r]=a),"function"===typeof a.el&&a.el()){var l=this.contentEl().children,u=l[n]||null;this.contentEl().insertBefore(a.el(),u)}return a},e.prototype.removeChild=function(e){if("string"===typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var n=this.options_,a=function(e){var i=e.name,a=e.opts;if(void 0!==n[i]&&(a=n[i]),!1!==a){!0===a&&(a={}),a.playerOptions=t.options_.playerOptions;var r=t.addChild(i,a);r&&(t[i]=r)}},r=void 0,s=e.getComponent("Tech");r=Array.isArray(i)?i:Object.keys(i),r.concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map((function(e){var n=void 0,a=void 0;return"string"===typeof e?(n=e,a=i[n]||t.options_[n]||{}):(n=e.name,a=e),{name:n,opts:a}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||mt(t.name));return i&&!s.isTech(i)})).forEach(a)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},e.prototype.$=function(e,t){return je(e,t||this.contentEl())},e.prototype.$$=function(e,t){return Ie(e,t||this.contentEl())},e.prototype.hasClass=function(e){return ue(this.el_,e)},e.prototype.addClass=function(e){ce(this.el_,e)},e.prototype.removeClass=function(e){he(this.el_,e)},e.prototype.toggleClass=function(e,t){de(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return ve(this.el_,e)},e.prototype.setAttribute=function(e,t){me(this.el_,e,t)},e.prototype.removeAttribute=function(e){ge(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],a=n.indexOf("px");return-1!==a?parseInt(n.slice(0,a),10):parseInt(this.el_["offset"+mt(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"===typeof a.getComputedStyle){var i=a.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(t=parseFloat(t),0===t){var n="offset"+mt(e);t=this.el_[n]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=10,n=200,a=void 0;this.on("touchstart",(function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=(new Date).getTime(),a=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)a=!1;else if(t){var n=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY,s=Math.sqrt(n*n+r*r);s>i&&(a=!1)}}));var r=function(){a=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(i){if(t=null,!0===a){var r=(new Date).getTime()-e;r0&&u.map((function(e){return l[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=mt(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();function _t(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}function Tt(e,t,i,n){return _t(e,n,i.length-1),i[n][t]}function St(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Tt.bind(null,"start",0,e),end:Tt.bind(null,"end",1,e)}}function wt(e,t){return Array.isArray(e)?St(e):void 0===e||void 0===t?St():St([[e,t]])}function kt(e,t){var i=0,n=void 0,a=void 0;if(!t)return 0;e&&e.length||(e=wt(0,0));for(var r=0;rt&&(a=t),i+=a-n;return i/t}yt.prototype.supportsRaf_="function"===typeof a.requestAnimationFrame&&"function"===typeof a.cancelAnimationFrame,yt.registerComponent("Component",yt);for(var Et={},Ct=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],xt=Ct[0],At=void 0,jt=0;jt0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;M(this,t);var s=N(this,e.call(this));if(!a&&(a=s,x))for(var o in a=r.createElement("custom"),t.prototype)"constructor"!==o&&(a[o]=t.prototype[o]);a.tracks_=[],Object.defineProperty(a,"length",{get:function(){return this.tracks_.length}});for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:[];M(this,t);for(var s=void 0,o=a.length-1;o>=0;o--)if(a[o].enabled){zt(a,a[o]);break}if(x){for(var l in s=r.createElement("custom"),Ht.prototype)"constructor"!==l&&(s[l]=Ht.prototype[l]);for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u])}return i=N(this,e.call(this,a,s)),s=i,s.changing_=!1,n=s,N(i,n)}return R(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&zt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,zt(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),Gt=function(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];M(this,t);for(var s=void 0,o=a.length-1;o>=0;o--)if(a[o].selected){Gt(a,a[o]);break}if(x){for(var l in s=r.createElement("custom"),Ht.prototype)"constructor"!==l&&(s[l]=Ht.prototype[l]);for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u])}return i=N(this,e.call(this,a,s)),s=i,s.changing_=!1,Object.defineProperty(s,"selectedIndex",{get:function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:[];M(this,t);var s=void 0;if(x){for(var o in s=r.createElement("custom"),Ht.prototype)"constructor"!==o&&(s[o]=Ht.prototype[o]);for(var l in t.prototype)"constructor"!==l&&(s[l]=t.prototype[l])}return i=N(this,e.call(this,a,s)),s=i,n=s,N(i,n)}return R(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",tt(this,(function(){this.trigger("change")})));var i=["metadata","chapters"];-1===i.indexOf(t.kind)&&t.addEventListener("modechange",tt(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Ht),Yt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];M(this,e);var i=this;if(x)for(var n in i=r.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);i.trackElements_=[],Object.defineProperty(i,"length",{get:function(){return this.trackElements_.length}});for(var a=0,s=t.length;a0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var a=N(this,e.call(this)),s=a;if(x)for(var o in s=r.createElement("custom"),t.prototype)"constructor"!==o&&(s[o]=t.prototype[o]);var l={id:n.id||"vjs_track_"+Le(),kind:n.kind||"",label:n.label||"",language:n.language||""},u=function(e){Object.defineProperty(s,e,{get:function(){return l[e]},set:function(){}})};for(var c in l)u(c);return i=s,N(a,i)}return R(t,e),t}(at),ii=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=r.createElement("a");i.href=e;var n=""===i.host&&"file:"!==i.protocol,s=void 0;n&&(s=r.createElement("div"),s.innerHTML='',i=s.firstChild,s.setAttribute("style","display:none; position:absolute;"),r.body.appendChild(s));for(var o={},l=0;lx',e=t.firstChild.href}return e},ai=function(e){if("string"===typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},ri=function(e){var t=a.location,i=ii(e),n=":"===i.protocol?t.protocol:i.protocol,r=n+i.host!==t.protocol+t.host;return r},si=(Object.freeze||Object)({parseUrl:ii,getAbsoluteURL:ni,getFileExtension:ai,isCrossOrigin:ri}),oi=function(e,t){var i=new a.WebVTT.Parser(a,a.vttjs,a.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(a.console&&a.console.groupCollapsed&&a.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return Y.error(e)})),a.console&&a.console.groupEnd&&a.console.groupEnd()),i.flush()},li=function(e,t){var i={uri:e},n=ri(e);n&&(i.cors=n),l(i,tt(this,(function(e,i,n){if(e)return Y.error(e,i);if(t.loaded_=!0,"function"!==typeof a.WebVTT){if(t.tech_){var r=function(){return oi(n,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",(function(){Y.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)}))}}else oi(n,t)})))},ui=function(e){function t(){var i,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(M(this,t),!a.tech)throw new Error("A tech was not provided.");var r=bt(a,{kind:Zt[a.kind]||"subtitles",language:a.language||a.srclang||""}),s=ei[r.mode]||"disabled",o=r["default"];"metadata"!==r.kind&&"chapters"!==r.kind||(s="hidden");var l=(i=N(this,e.call(this,r)),i);if(l.tech_=r.tech,x)for(var u in t.prototype)"constructor"!==u&&(l[u]=t.prototype[u]);l.cues_=[],l.activeCues_=[];var c=new Kt(l.cues_),h=new Kt(l.activeCues_),d=!1,p=tt(l,(function(){this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1)}));return"disabled"!==s&&l.tech_.ready((function(){l.tech_.on("timeupdate",p)}),!0),Object.defineProperty(l,"default",{get:function(){return o},set:function(){}}),Object.defineProperty(l,"mode",{get:function(){return s},set:function(e){var t=this;ei[e]&&(s=e,"disabled"!==s?this.tech_.ready((function(){t.tech_.on("timeupdate",p)}),!0):this.tech_.off("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(l,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(l,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return h;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||a.startTime===a.endTime&&a.startTime<=e&&a.startTime+.5>=e)&&t.push(a)}if(d=!1,t.length!==this.activeCues_.length)d=!0;else for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var r=bt(a,{kind:Jt[a.kind]||""}),s=(i=N(this,e.call(this,r)),i),o=!1;if(x)for(var l in t.prototype)"constructor"!==l&&(s[l]=t.prototype[l]);return Object.defineProperty(s,"enabled",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),r.enabled&&(s.enabled=r.enabled),s.loaded_=!0,n=s,N(i,n)}return R(t,e),t}(ti),hi=function(e){function t(){var i,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var r=bt(a,{kind:Qt[a.kind]||""}),s=(i=N(this,e.call(this,r)),i),o=!1;if(x)for(var l in t.prototype)"constructor"!==l&&(s[l]=t.prototype[l]);return Object.defineProperty(s,"selected",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),r.selected&&(s.selected=r.selected),n=s,N(i,n)}return R(t,e),t}(ti),di=0,pi=1,fi=2,vi=3,mi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var n=N(this,e.call(this)),a=void 0,s=n;if(x)for(var o in s=r.createElement("custom"),t.prototype)"constructor"!==o&&(s[o]=t.prototype[o]);var l,u=new ui(i);return s.kind=u.kind,s.src=u.src,s.srclang=u.language,s.label=u.label,s["default"]=u["default"],Object.defineProperty(s,"readyState",{get:function(){return a}}),Object.defineProperty(s,"track",{get:function(){return u}}),a=di,u.addEventListener("loadeddata",(function(){a=fi,s.trigger({type:"load",target:s})})),x?(l=s,N(n,l)):n}return R(t,e),t}(at);mi.prototype.allowedEvents_={load:"load"},mi.NONE=di,mi.LOADING=pi,mi.LOADED=fi,mi.ERROR=vi;var gi={audio:{ListClass:Wt,TrackClass:ci,capitalName:"Audio"},video:{ListClass:$t,TrackClass:hi,capitalName:"Video"},text:{ListClass:Xt,TrackClass:ui,capitalName:"Text"}};Object.keys(gi).forEach((function(e){gi[e].getterName=e+"Tracks",gi[e].privateName=e+"Tracks_"}));var bi={remoteText:{ListClass:Xt,TrackClass:ui,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Yt,TrackClass:mi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},yi=bt(gi,bi);function _i(e,t,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=e.textTracks();a.kind=t,i&&(a.label=i),n&&(a.language=n),a.tech=e;var s=new yi.text.TrackClass(a);return r.addTrack(s),s}bi.names=Object.keys(bi),gi.names=Object.keys(gi),yi.names=[].concat(bi.names).concat(gi.names);var Ti=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};M(this,t),i.reportTouchActivity=!1;var a=N(this,e.call(this,null,i,n));return a.hasStarted_=!1,a.on("playing",(function(){this.hasStarted_=!0})),a.on("loadstart",(function(){this.hasStarted_=!1})),yi.names.forEach((function(e){var t=yi[e];i&&i[t.getterName]&&(a[t.privateName]=i[t.getterName])})),a.featuresProgressEvents||a.manualProgressOn(),a.featuresTimeupdateEvents||a.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===i["native"+e+"Tracks"]&&(a["featuresNative"+e+"Tracks"]=!1)})),!1===i.nativeCaptions||!1===i.nativeTextTracks?a.featuresNativeTextTracks=!1:!0!==i.nativeCaptions&&!0!==i.nativeTextTracks||(a.featuresNativeTextTracks=!0),a.featuresNativeTextTracks||a.emulateTextTracks(),a.autoRemoteTextTracks_=new yi.text.ListClass,a.initTrackListeners(),i.nativeControlsForTouch||a.emitTapEvents(),a.constructor&&(a.name_=a.constructor.name||"Unknown Tech"),a}return R(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(tt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return wt(0,0)},t.prototype.bufferedPercent=function(){return kt(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(gi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach((function(e){var i=t[e+"Tracks"]()||[],n=i.length;while(n--){var a=i[n];"text"===e&&t.removeRemoteTextTrack(a),i.removeTrack(a)}}))},t.prototype.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var i=e[t];this.removeRemoteTextTrack(i)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new Ot(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?wt(0,0):wt()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;gi.names.forEach((function(t){var i=gi[t],n=function(){e.trigger(t+"trackchange")},a=e[i.getterName]();a.addEventListener("removetrack",n),a.addEventListener("addtrack",n),e.on("dispose",(function(){a.removeEventListener("removetrack",n),a.removeEventListener("addtrack",n)}))}))},t.prototype.addWebVttScript_=function(){var e=this;if(!a.WebVTT)if(r.body.contains(this.el())){if(!this.options_["vtt.js"]&&W(u)&&Object.keys(u).length>0)return void this.trigger("vttjsloaded");var t=r.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),a.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},a=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",a),this.addWebVttScript_();var r=function(){return e.trigger("texttrackchange")},s=function(){r();for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.createRemoteTextTrack(t);return!0!==i&&!1!==i&&(Y.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==i&&this.ready((function(){return e.autoRemoteTextTracks_.addTrack(n.track)})),n},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=mt(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=mt(e),t.techs_&&t.techs_[e]?t.techs_[e]:a&&a.videojs&&a.videojs[e]?(Y.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),a.videojs[e]):void 0},t}(yt);yi.names.forEach((function(e){var t=yi[e];Ti.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ti.prototype.featuresVolumeControl=!0,Ti.prototype.featuresMuteControl=!0,Ti.prototype.featuresFullscreenResize=!1,Ti.prototype.featuresPlaybackRate=!1,Ti.prototype.featuresProgressEvents=!1,Ti.prototype.featuresSourceset=!1,Ti.prototype.featuresTimeupdateEvents=!1,Ti.prototype.featuresNativeTextTracks=!1,Ti.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i=e.sourceHandlers||[],n=void 0,a=0;a3&&void 0!==arguments[3]?arguments[3]:null,a="call"+mt(i),r=e.reduce(Di(a),n),s=r===ki,o=s?null:t[i](r);return Mi(e,i,o,s),o}var Oi={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Pi={setCurrentTime:1},Li={play:1,pause:1};function Di(e){return function(t,i){return t===ki?ki:i[e]?i[e](t):t}}function Mi(e,t,i,n){for(var a=e.length-1;a>=0;a--){var r=e[a];r[t]&&r[t](n,i)}}function Ri(e){wi[e.id()]=null}function Ni(e,t){var i=wi[e.id()],n=null;if(void 0===i||null===i)return n=t(e),wi[e.id()]=[[t,n]],n;for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments[2],n=arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=t[0],o=t.slice(1);if("string"===typeof s)Bi(e,Si[s],i,n,a,r);else if(s){var l=Ni(n,s);if(!l.setSource)return a.push(l),Bi(e,o,i,n,a,r);l.setSource(q({},e),(function(t,s){if(t)return Bi(e,o,i,n,a,r);a.push(l),Bi(s,e.type===s.type?o:Si[s.type],i,n,a,r)}))}else o.length?Bi(e,o,i,n,a,r):r?i(e,a):Bi(e,Si["*"],i,n,a,!0)}var Ui={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Fi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=ai(e),i=Ui[t.toLowerCase()];return i||""},Vi=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),a=0;a0&&void 0!==arguments[0]?arguments[0]:"div",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=q({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&Y.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=q({role:"button"},n),this.tabIndex_=i.tabIndex;var a=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(a),a},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=se("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,oe(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!==typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){ze(r,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){We(r,"keydown",tt(this,this.handleKeyPress))},t}(yt);yt.registerComponent("ClickableComponent",Wi);var Gi=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.update(),i.on("posterchange",tt(a,a.update)),a}return R(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var e=se("div",{className:"vjs-poster",tabIndex:-1});return P||(this.fallbackImg_=se("img"),e.appendChild(this.fallbackImg_)),e},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){if(this.fallbackImg_)this.fallbackImg_.src=e;else{var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t}},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Dt(this.player_.play()):this.player_.pause())},t}(Wi);yt.registerComponent("PosterImage",Gi);var $i="#222",Xi="#ccc",Yi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ki(e,t){var i=void 0;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Qi(e,t,i){try{e.style[t]=i}catch(n){return}}var Ji=function(e){function t(i,n,r){M(this,t);var s=N(this,e.call(this,i,n,r)),o=tt(s,s.updateDisplay);return i.on("loadstart",tt(s,s.toggleDisplay)),i.on("texttrackchange",o),i.on("loadstart",tt(s,s.preselectTrack)),i.ready(tt(s,(function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),a.addEventListener&&a.addEventListener("orientationchange",o),i.on("dispose",(function(){return a.removeEventListener("orientationchange",o)}));for(var e=this.options_.playerOptions.tracks||[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=q({innerHTML:'',className:this.buildCSSClass()},t),i=q({type:"button"},i);var n=yt.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(n),n},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return Y.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),yt.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Wi);yt.registerComponent("Button",en);var tn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.mouseused_=!1,a.on("mousedown",a.handleMouseDown),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Dt(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var a=function(){return n.focus()};Lt(t)?t.then(a,(function(){})):this.setTimeout(a,1)}else this.player_.focus()}},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(en);tn.prototype.controlText_="Play Video",yt.registerComponent("BigPlayButton",tn);var nn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.controlText(n&&n.controlText||a.localize("Close")),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(en);yt.registerComponent("CloseButton",nn);var an=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.on(i,"play",a.handlePlay),a.on(i,"pause",a.handlePause),a.on(i,"ended",a.handleEnded),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(en);an.prototype.controlText_="Play",yt.registerComponent("PlayToggle",an);var rn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),a=Math.floor(e/3600),r=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(a=n=i="-"),a=a>0||s>0?a+":":"",n=((a||r>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,a+n+i},sn=rn;function on(e){sn=e}function ln(){sn=rn}var un=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return sn(e,t)},cn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.throttledUpdateContent=it(tt(a,a.updateContent),25),a.on(i,"timeupdate",a.throttledUpdateContent),a}return R(t,e),t.prototype.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+" "});return this.contentEl_=se("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){while(this.contentEl_.firstChild)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=r.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return un(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(yt);cn.prototype.labelText_="Time",cn.prototype.controlText_="Time",yt.registerComponent("TimeDisplay",cn);var hn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.on(i,"ended",a.handleEnded),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(cn);hn.prototype.labelText_="Current Time",hn.prototype.controlText_="Current Time",yt.registerComponent("CurrentTimeDisplay",hn);var dn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.on(i,"durationchange",a.updateContent),a.on(i,"loadedmetadata",a.throttledUpdateContent),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(cn);dn.prototype.labelText_="Duration",dn.prototype.controlText_="Duration",yt.registerComponent("DurationDisplay",dn);var pn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},t}(yt);yt.registerComponent("TimeDivider",pn);var fn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.on(i,"durationchange",a.throttledUpdateContent),a.on(i,"ended",a.handleEnded),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(cn);fn.prototype.labelText_="Remaining Time",fn.prototype.controlText_="Remaining Time",yt.registerComponent("RemainingTimeDisplay",fn);var vn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.updateShowing(),a.on(a.player(),"durationchange",a.updateShowing),a}return R(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=se("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(yt);yt.registerComponent("LiveDisplay",vn);var mn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.bar=a.getChild(a.options_.barName),a.vertical(!!a.options_.vertical),a.enable(),a}return R(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.prototype.createEl=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.className=i.className+" vjs-slider",i=q({tabIndex:0},i),n=q({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||E||e.preventDefault(),be(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;ye(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!==typeof e||e!==e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},t.prototype.calculateDistance=function(e){var t=Se(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(yt);yt.registerComponent("Slider",mn);var gn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.partEls_=[],a.on(i,"progress",a.update),a}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),i=this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,r=function(e,t){var i=e/t||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=r(n,i);for(var s=0;st.length;c--)this.el_.removeChild(a[c-1]);a.length=t.length},t}(yt);yt.registerComponent("LoadProgressBar",gn);var bn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,i){var n=_e(this.el_),a=_e(this.player_.el()),r=e.width*t;if(a&&n){var s=e.left-a.left+r,o=e.width-r+(a.right-e.right),l=n.width/2;sn.width&&(l=n.width),this.el_.style.right="-"+l+"px",oe(this.el_,i)}},t}(yt);yt.registerComponent("TimeTooltip",bn);var yn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),a=un(n,i.player_.duration()),r=i.getChild("timeTooltip");r&&r.update(e,t,a)}))},t}(yt);yn.prototype.options_={children:[]},A&&!(A>8)||g||y||yn.prototype.options_.children.push("timeTooltip"),yt.registerComponent("PlayProgressBar",yn);var _n=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.update=it(tt(a,a.update),25),a}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.duration(),a=un(t*n,n);i.el_.style.left=e.width*t+"px",i.getChild("timeTooltip").update(e,t,a)}))},t}(yt);_n.prototype.options_={children:["timeTooltip"]},yt.registerComponent("MouseTimeDisplay",_n);var Tn=5,Sn=30,wn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.setEventHandlers_(),a}return R(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=it(tt(this,this.update),Sn),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),Sn)})),this.on(this.player_,["ended","pause","waiting"],(function(){e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[un(e,i),un(i,i)],"{1} of {2}")),this.bar.update(_e(this.el_),t)},t.prototype.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e},t.prototype.handleMouseDown=function(t){Ae(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(Ae(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Dt(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+Tn)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-Tn)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(mn);wn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},A&&!(A>8)||g||y||wn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),wn.prototype.playerEvent="timeupdate",yt.registerComponent("SeekBar",wn);var kn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.handleMouseMove=it(tt(a,a.handleMouseMove),25),a.throttledHandleMouseSeek=it(tt(a,a.handleMouseSeek),25),a.enable(),a}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),a=_e(n),r=Se(n,e).x;r>1?r=1:r<0&&(r=0),i&&i.update(a,r)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(yt);kn.prototype.options_={children:["seekBar"]},yt.registerComponent("ProgressControl",kn);var En=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.on(i,"fullscreenchange",a.handleFullscreenChange),!1===r[Et.fullscreenEnabled]&&a.disable(),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(en);En.prototype.controlText_="Fullscreen",yt.registerComponent("FullscreenToggle",En);var Cn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},xn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},t}(yt);yt.registerComponent("VolumeLevel",xn);var An=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.on("slideractive",a.updateLastVolume_),a.on(i,"volumechange",a.updateARIAAttributes),i.ready((function(){return a.updateARIAAttributes()})),a}return R(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){Ae(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){Ae(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(mn);An.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},An.prototype.playerEvent="volumechange",yt.registerComponent("VolumeBar",An);var jn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t),n.vertical=n.vertical||!1,("undefined"===typeof n.volumeBar||W(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical);var a=N(this,e.call(this,i,n));return Cn(a,i),a.throttledHandleMouseMove=it(tt(a,a.handleMouseMove),25),a.on("mousedown",a.handleMouseDown),a.on("touchstart",a.handleMouseDown),a.on(a.volumeBar,["focus","slideractive"],(function(){a.volumeBar.addClass("vjs-slider-active"),a.addClass("vjs-slider-active"),a.trigger("slideractive")})),a.on(a.volumeBar,["blur","sliderinactive"],(function(){a.volumeBar.removeClass("vjs-slider-active"),a.removeClass("vjs-slider-active"),a.trigger("sliderinactive")})),a}return R(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(yt);jn.prototype.options_={children:["volumeBar"]},yt.registerComponent("VolumeControl",jn);var In=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},On=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return In(a,i),a.on(i,["loadstart","volumechange"],a.update),a}return R(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;g&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)he(this.el_,"vjs-vol-"+i);ce(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(en);On.prototype.controlText_="Mute",yt.registerComponent("MuteToggle",On);var Pn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t),"undefined"!==typeof n.inline?n.inline=n.inline:n.inline=!0,("undefined"===typeof n.volumeControl||W(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline);var a=N(this,e.call(this,i,n));return a.on(i,["loadstart"],a.volumePanelState_),a.on(a.volumeControl,["slideractive"],a.sliderActive_),a.on(a.volumeControl,["sliderinactive"],a.sliderInactive_),a}return R(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(yt);Pn.prototype.options_={children:["muteToggle","volumeControl"]},yt.registerComponent("VolumePanel",Pn);var Ln=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return n&&(a.menuButton_=n.menuButton),a.focusedChild_=-1,a.on("keydown",a.handleKeyPress),a}return R(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",tt(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=se(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),ze(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice(),i=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);i&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(yt);yt.registerComponent("Menu",Ln);var Dn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t);var a=N(this,e.call(this,i,n));a.menuButton_=new en(i,n),a.menuButton_.controlText(a.controlText_),a.menuButton_.el_.setAttribute("aria-haspopup","true");var r=en.prototype.buildCSSClass();return a.menuButton_.el_.className=a.buildCSSClass()+" "+r,a.menuButton_.removeClass("vjs-control"),a.addChild(a.menuButton_),a.update(),a.enabled_=!0,a.on(a.menuButton_,"tap",a.handleClick),a.on(a.menuButton_,"click",a.handleClick),a.on(a.menuButton_,"focus",a.handleFocus),a.on(a.menuButton_,"blur",a.handleBlur),a.on("keydown",a.handleSubmenuKeyPress),a}return R(t,e),t.prototype.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.prototype.createMenu=function(){var e=new Ln(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=se("li",{className:"vjs-menu-title",innerHTML:mt(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),le(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",tt(this,(function(e){this.unpressButton(),this.el_.blur()}))),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){ze(r,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){We(r,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),g&&ae())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(yt);yt.registerComponent("MenuButton",Dn);var Mn=function(e){function t(i,n){M(this,t);var a=n.tracks,r=N(this,e.call(this,i,n));if(r.items.length<=1&&r.hide(),!a)return N(r);var s=tt(r,r.update);return a.addEventListener("removetrack",s),a.addEventListener("addtrack",s),r.player_.on("ready",s),r.player_.on("dispose",(function(){a.removeEventListener("removetrack",s),a.removeEventListener("addtrack",s)})),r}return R(t,e),t}(Dn);yt.registerComponent("TrackButton",Mn);var Rn=function(e){function t(i,n){M(this,t);var a=N(this,e.call(this,i,n));return a.selectable=n.selectable,a.isSelected_=n.selected||!1,a.multiSelectable=n.multiSelectable,a.selected(a.isSelected_),a.selectable?a.multiSelectable?a.el_.setAttribute("role","menuitemcheckbox"):a.el_.setAttribute("role","menuitemradio"):a.el_.setAttribute("role","menuitem"),a}return R(t,e),t.prototype.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",q({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},i),n)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Wi);yt.registerComponent("MenuItem",Rn);var Nn=function(e){function t(i,n){M(this,t);var s=n.track,o=i.textTracks();n.label=s.label||s.language||"Unknown",n.selected="showing"===s.mode;var l=N(this,e.call(this,i,n));l.track=s;var u=function(){for(var e=arguments.length,t=Array(e),i=0;i-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Rn);yt.registerComponent("TextTrackMenuItem",Nn);var Bn=function(e){function t(i,n){return M(this,t),n.track={player:i,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,N(this,e.call(this,i,n))}return R(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,a=t.length;n-1&&"showing"===r.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,a=t.length;n-1&&"showing"===r.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Nn);yt.registerComponent("OffTextTrackMenuItem",Bn);var Un=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return M(this,t),n.tracks=i.textTracks(),N(this,e.call(this,i,n))}return R(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nn,i=void 0;this.label_&&(i=this.label_+" off"),e.push(new Bn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var a=0;a-1){var s=new t(this.player_,{track:r,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+r.kind+"-menu-item"),e.push(s)}}return e},t}(Mn);yt.registerComponent("TextTrackButton",Un);var Fn=function(e){function t(i,n){M(this,t);var a=n.track,r=n.cue,s=i.currentTime();n.selectable=!0,n.multiSelectable=!1,n.label=r.text,n.selected=r.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(mt(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i