@zhijiancloud/bpm 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/141.umd.js +1 -0
- package/dist/204.umd.js +1 -0
- package/dist/557.umd.js +2 -0
- package/dist/557.umd.js.LICENSE.txt +283 -0
- package/dist/559.umd.js +1 -0
- package/dist/584.umd.js +1 -0
- package/dist/997.umd.js +1 -0
- package/dist/bpmAppointment.umd.js +1 -1
- package/dist/bpmArea.umd.js +1 -1
- package/dist/bpmAreaElevation.umd.js +1 -1
- package/dist/bpmAudit.umd.js +1 -1
- package/dist/bpmDateTime.umd.js +1 -1
- package/dist/bpmExternalFormLink.umd.js +1 -0
- package/dist/bpmField.umd.js +5 -5
- package/dist/bpmFieldsFilter.umd.js +3 -3
- package/dist/bpmFormField.umd.js +5 -5
- package/dist/bpmMapLocation.umd.js +1 -1
- package/dist/bpmMulFile.umd.js +1 -1
- package/dist/bpmMulImage.umd.js +1 -1
- package/dist/bpmNumber.umd.js +1 -1
- package/dist/bpmOverTime.umd.js +1 -1
- package/dist/bpmRating.umd.js +1 -1
- package/dist/bpmRichText.umd.js +1 -1
- package/dist/bpmSelect.umd.js +1 -1
- package/dist/bpmSelectCheckItem.umd.js +1 -1
- package/dist/bpmSelectEntranceForm.umd.js +3 -3
- package/dist/bpmSelectFromField.umd.js +1 -1
- package/dist/bpmSelectFromForm.umd.js +1 -1
- package/dist/bpmSelectFromId.umd.js +1 -1
- package/dist/bpmSelectFromMulForm.umd.js +1 -1
- package/dist/bpmSelectHouseOwner.umd.js +1 -1
- package/dist/bpmSelectIssue.umd.js +1 -1
- package/dist/bpmSelectUser.umd.js +1 -1
- package/dist/bpmSignature.umd.js +1 -1
- package/dist/bpmSpliter.umd.js +1 -1
- package/dist/bpmSubForm.umd.js +1 -1
- package/dist/bpmSubFormField.umd.js +5 -5
- package/dist/bpmText.umd.js +1 -1
- package/dist/bpmTime.umd.js +1 -1
- package/dist/bpmVideo.umd.js +1 -0
- package/dist/bpmVideo.umd.js.LICENSE.txt +283 -0
- package/dist/css/bpmExternalFormLink.css +1 -0
- package/dist/css/index.css +1 -1
- package/dist/index.umd.js +5 -5
- package/package.json +1 -1
package/dist/997.umd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkbpm2=self.webpackChunkbpm2||[]).push([[997],{228:function(e){"use strict";var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,s||e,r),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,r=new Array(s);o<s;o++)r[o]=n[o].fn;return r},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,s,r){var a=i?i+e:e;if(!this._events[a])return!1;var l,u,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,o),!0;case 5:return c.fn.call(c.context,t,n,o,s),!0;case 6:return c.fn.call(c.context,t,n,o,s,r),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,o);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,o){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return r(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||r(this,s);else{for(var l=0,u=[],c=a.length;l<c;l++)(a[l].fn!==t||o&&!a[l].once||n&&a[l].context!==n)&&u.push(a[l]);u.length?this._events[s]=1===u.length?u[0]:u:r(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&r(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a},310:function(e,t,i){"use strict";i.d(t,{A:function(){return n}});var n="3.0.23"},3036:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},3592:function(e,t,i){"use strict";i.d(t,{A:function(){return l},L:function(){return r}});var n=i(1894),o=i(310),s=i(5489),r={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},a={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},l=(0,n.j6)((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};(0,n.xs)(this,e);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var l=i.mediaError?i.mediaError:t.media.error||{},u=t.duration,c=t.currentTime,h=t.ended,d=t.src,f=t.currentSrc,p=t.media,g=p.readyState,v=p.networkState,m=i.errorCode||l.code;a[m]&&(m=a[m]);var y={playerVersion:o.A,currentTime:c,duration:u,ended:h,readyState:g,networkState:v,src:d||f,errorType:i.errorType,errorCode:m,message:i.errorMessage||l.message,mediaError:l,originError:i.originError?i.originError.stack:"",host:s.Ay.getHostFromUrl(d||f)};return i.ext&&Object.keys(i.ext).map((function(e){y[e]=i.ext[e]})),y}if(arguments.length>1){for(var _={playerVersion:o.A,domain:document.domain},k=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],T=0;T<arguments.length;T++)_[k[T]]=arguments[T];return _.ex=r?(r[arguments[0]]||{}).msg:"",_}}))},6704:function(e,t,i){"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof globalThis?globalThis:void 0!==i.g&&i.g,e.exports=function(){"use strict";var e={"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/style/index.scss":function(e,t,i){var n=i("./node_modules/css-loader/dist/runtime/sourceMaps.js"),o=i.n(n),s=i("./node_modules/css-loader/dist/runtime/api.js"),r=i.n(s)()(o());r.push([e.id,".danmu{overflow:hidden;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#fff;box-shadow:-2px 0 0 0 rgba(0,0,0,.04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}","",{version:3,sources:["webpack://./src/style/danmu.scss"],names:[],mappings:"AAAA,OACE,eAAA,CACA,gBAAA,CACA,oBAAA,CACA,SACE,iBAAA,CACA,kBAAA,CAIJ,cACE,UAAA,CACA,WAAA,CACA,mBAAA,CACA,qBAAA,CACA,qBAAA,CACA,YAAA,CACA,cAAA,CACA,iBAAA,CACA,iBAAA,CACA,gBAAA,CACA,kCACE,iBAAA,CACA,wBAAA,CAEF,uBACE,UAAA,CACA,WAAA,CACA,gBAAA,CACA,iBAAA,CACA,aAAA,CACA,mBAAA,CACA,qBAAA,CACA,qCAAA,CACA,sBAAA,CACA,cAAA,CACA,eAAA,CACA,aAAA",sourcesContent:[".danmu {\n overflow: hidden;\n user-select: none;\n -ms-user-select: none;\n > * {\n position: absolute;\n white-space: nowrap;\n }\n}\n\n.danmu-switch {\n width: 32px;\n height: 20px;\n border-radius: 100px;\n background-color: #ccc;\n box-sizing: border-box;\n outline: none;\n cursor: pointer;\n position: relative;\n text-align: center;\n margin: 10px auto;\n &.danmu-switch-active {\n padding-left: 12px;\n background-color: #f85959;\n }\n span.txt {\n width: 20px;\n height: 20px;\n line-height: 20px;\n text-align: center;\n display: block;\n border-radius: 100px;\n background-color: #ffffff;\n box-shadow: -2px 0 0 0 rgba(0, 0, 0, 0.04);\n font-family: PingFangSC;\n font-size: 10px;\n font-weight: 500;\n color: #f44336;\n }\n}\n"],sourceRoot:""}]),t.A=r},"./node_modules/css-loader/dist/runtime/api.js":function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var u=0;u<e.length;u++){var c=[].concat(e[u]);n&&r[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),i&&(c[2]&&(c[1]="@media ".concat(c[2]," {").concat(c[1],"}")),c[2]=i),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}},"./node_modules/css-loader/dist/runtime/sourceMaps.js":function(e){e.exports=function(e){var t=e[1],i=e[3];if(!i)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(i))));return[t].concat(["/*# ".concat("sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n)," */")]).join("\n")}return[t].join("\n")}},"./node_modules/d/index.js":function(e,t,i){var n=i("./node_modules/d/node_modules/type/value/is.js"),o=i("./node_modules/d/node_modules/type/plain-function/is.js"),s=i("./node_modules/es5-ext/object/assign/index.js"),r=i("./node_modules/es5-ext/object/normalize-options.js"),a=i("./node_modules/es5-ext/string/#/contains/index.js");(e.exports=function(e,t){var i,o,l,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],n(e)?(i=a.call(e,"c"),o=a.call(e,"e"),l=a.call(e,"w")):(i=l=!0,o=!1),c={value:t,configurable:i,enumerable:o,writable:l},u?s(r(u),c):c}).gs=function(e,t,i){var l,u,c,h;return"string"!=typeof e?(c=i,i=t,t=e,e=null):c=arguments[3],n(t)?o(t)?n(i)?o(i)||(c=i,i=void 0):i=void 0:(c=t,t=i=void 0):t=void 0,n(e)?(l=a.call(e,"c"),u=a.call(e,"e")):(l=!0,u=!1),h={get:t,set:i,configurable:l,enumerable:u},c?s(r(c),h):h}},"./node_modules/d/node_modules/type/function/is.js":function(e,t,i){var n=i("./node_modules/d/node_modules/type/prototype/is.js");e.exports=function(e){if("function"!=typeof e||!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length||"function"!=typeof e.call||"function"!=typeof e.apply)return!1}catch(e){return!1}return!n(e)}},"./node_modules/d/node_modules/type/object/is.js":function(e,t,i){var n=i("./node_modules/d/node_modules/type/value/is.js"),o={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!n(e)&&hasOwnProperty.call(o,typeof e)}},"./node_modules/d/node_modules/type/plain-function/is.js":function(e,t,i){var n=i("./node_modules/d/node_modules/type/function/is.js"),o=/^\s*class[\s{/}]/,s=Function.prototype.toString;e.exports=function(e){return!(!n(e)||o.test(s.call(e)))}},"./node_modules/d/node_modules/type/prototype/is.js":function(e,t,i){var n=i("./node_modules/d/node_modules/type/object/is.js");e.exports=function(e){if(!n(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},"./node_modules/d/node_modules/type/value/is.js":function(e){e.exports=function(e){return null!=e}},"./node_modules/es5-ext/function/noop.js":function(e){e.exports=function(){}},"./node_modules/es5-ext/object/assign/index.js":function(e,t,i){e.exports=i("./node_modules/es5-ext/object/assign/is-implemented.js")()?Object.assign:i("./node_modules/es5-ext/object/assign/shim.js")},"./node_modules/es5-ext/object/assign/is-implemented.js":function(e){e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},"./node_modules/es5-ext/object/assign/shim.js":function(e,t,i){var n=i("./node_modules/es5-ext/object/keys/index.js"),o=i("./node_modules/es5-ext/object/valid-value.js"),s=Math.max;e.exports=function(e,t){var i,r,a,l=s(arguments.length,2);for(r=1,e=Object(o(e)),a=function(n){try{e[n]=t[n]}catch(e){i||(i=e)}};r<l;++r)n(t=arguments[r]).forEach(a);if(void 0!==i)throw i;return e}},"./node_modules/es5-ext/object/is-value.js":function(e,t,i){var n=i("./node_modules/es5-ext/function/noop.js")();e.exports=function(e){return e!==n&&null!==e}},"./node_modules/es5-ext/object/keys/index.js":function(e,t,i){e.exports=i("./node_modules/es5-ext/object/keys/is-implemented.js")()?Object.keys:i("./node_modules/es5-ext/object/keys/shim.js")},"./node_modules/es5-ext/object/keys/is-implemented.js":function(e){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},"./node_modules/es5-ext/object/keys/shim.js":function(e,t,i){var n=i("./node_modules/es5-ext/object/is-value.js"),o=Object.keys;e.exports=function(e){return o(n(e)?Object(e):e)}},"./node_modules/es5-ext/object/normalize-options.js":function(e,t,i){var n=i("./node_modules/es5-ext/object/is-value.js"),o=Array.prototype.forEach,s=Object.create;e.exports=function(e){var t=s(null);return o.call(arguments,(function(e){n(e)&&function(e,t){var i;for(i in e)t[i]=e[i]}(Object(e),t)})),t}},"./node_modules/es5-ext/object/valid-callable.js":function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return e}},"./node_modules/es5-ext/object/valid-value.js":function(e,t,i){var n=i("./node_modules/es5-ext/object/is-value.js");e.exports=function(e){if(!n(e))throw TypeError("Cannot use null or undefined");return e}},"./node_modules/es5-ext/string/#/contains/index.js":function(e,t,i){e.exports=i("./node_modules/es5-ext/string/#/contains/is-implemented.js")()?String.prototype.contains:i("./node_modules/es5-ext/string/#/contains/shim.js")},"./node_modules/es5-ext/string/#/contains/is-implemented.js":function(e){var t="razdwatrzy";e.exports=function(){return"function"==typeof t.contains&&!0===t.contains("dwa")&&!1===t.contains("foo")}},"./node_modules/es5-ext/string/#/contains/shim.js":function(e){var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},"./node_modules/event-emitter/index.js":function(e,t,i){var n,o,s,r,a,l,u,c=i("./node_modules/d/index.js"),h=i("./node_modules/es5-ext/object/valid-callable.js"),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,g=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var i;return h(t),m.call(this,"__ee__")?i=this.__ee__:(i=y.value=p(null),g(this,"__ee__",y),y.value=null),i[e]?"object"==typeof i[e]?i[e].push(t):i[e]=[i[e],t]:i[e]=t,this},o=function(e,t){var i,o;return h(t),o=this,n.call(this,e,i=function(){s.call(o,e,i),d.call(t,this,arguments)}),i.__eeOnceListener__=t,this},a={on:n,once:o,off:s=function(e,t){var i,n,o,s;if(h(t),!m.call(this,"__ee__")||!(i=this.__ee__)[e])return this;if("object"==typeof(n=i[e]))for(s=0;o=n[s];++s)(o===t||o.__eeOnceListener__===t)&&(2===n.length?i[e]=n[+!s]:n.splice(s,1));else(n===t||n.__eeOnceListener__===t)&&delete i[e];return this},emit:r=function(e){var t,i,n,o,s;if(m.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(t=1,i=arguments.length,s=Array(i-1);t<i;++t)s[t-1]=arguments[t];for(t=0,o=o.slice();n=o[t];++t)d.call(n,this,s)}else switch(arguments.length){case 1:f.call(o,this);break;case 2:f.call(o,this,arguments[1]);break;case 3:f.call(o,this,arguments[1],arguments[2]);break;default:for(t=1,i=arguments.length,s=Array(i-1);t<i;++t)s[t-1]=arguments[t];d.call(o,this,s)}}},u=v({},l={on:c(n),once:c(o),off:c(s),emit:c(r)}),e.exports=t=function(e){return null==e?p(u):v(Object(e),l)},t.methods=a},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":function(e){var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var o={},s=[],r=0;r<e.length;r++){var a=e[r],l=n.base?a[0]+n.base:a[0],u=o[l]||0,c="".concat(l," ").concat(u);o[l]=u+1;var h=i(c),d={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==h)t[h].references++,t[h].updater(d);else{var f=function(e,t){var i=t.domAPI(t);return i.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&i.update(e=t):i.remove()}}(d,n);n.byIndex=r,t.splice(r,0,{identifier:c,updater:f,references:1})}s.push(c)}return s}e.exports=function(e,o){var s=n(e=e||[],o=o||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var a=i(s[r]);t[a].references--}for(var l=n(e,o),u=0;u<s.length;u++){var c=i(s[u]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}s=l}}},"./node_modules/style-loader/dist/runtime/insertBySelector.js":function(e){var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},"./node_modules/style-loader/dist/runtime/insertStyleElement.js":function(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":function(e,t,i){e.exports=function(e){var t=i.nc;t&&e.setAttribute("nonce",t)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":function(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(i){var n,o,s;n="",i.supports&&(n+="@supports (".concat(i.supports,") {")),i.media&&(n+="@media ".concat(i.media," {")),(o=void 0!==i.layer)&&(n+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),n+=i.css,o&&(n+="}"),i.media&&(n+="}"),i.supports&&(n+="}"),(s=i.sourceMap)&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(n,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":function(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,i),s.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};return function(){i.r(n),i.d(n,{default:function(){return F},DanmuJs:function(){return F}});var e=i("./node_modules/event-emitter/index.js"),t=i.n(e);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}var s="undefined"!=typeof window&&window.location.href.indexOf("danmu-debug")>-1,r=function(){var e;function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.constructorName=e||""}return e=[{key:"info",value:function(e){for(var t,i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];s&&(t=console).log.apply(t,["[Danmu Log][".concat(this.constructorName,"]"),e].concat(function(e){if(Array.isArray(e))return o(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e){if(e){if("string"==typeof e)return o(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),a=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function")}return e=[{key:"setLogger",value:function(e){this.logger=(null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](e):e instanceof r)?e:new r((e||"")+".js")}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),l=Object.prototype.hasOwnProperty;function u(e,t){if("Object"===c(t)&&"Object"===c(e))return Object.keys(t).forEach((function(i){var n,o;"Object"!==c(t[i])||(n=t[i],null!=(o=Node)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](n):n instanceof o)?"Array"===c(t[i])?e[i]="Array"===c(e[i])?e[i].concat(t[i]):t[i]:e[i]=t[i]:e[i]?u(e[i],t[i]):e[i]=t[i]})),e}function c(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function h(e,t,i,n){if(n)e.on(t,i),e.once(n,(function o(){e.off(t,i),e.off(n,o)}));else{var o=function(n){i(n),e.off(t,o)};e.on(t,o)}}function d(e,t,i){var n=e.style;try{n[t]=i}catch(e){n.setProperty(t,i)}}function f(e){return"number"==typeof e&&!Number.isNaN(e)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var m=new r("bullet"),y=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this instanceof i))throw TypeError("Cannot call a class as a function");t=p(t=i),n=function(e,t){var i;if(t&&("object"==((i=t)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,v()?Reflect.construct(t,[],p(this).constructor):t.apply(this,void 0));var s=e.container,r=e.recycler,a=e.config;return n.setLogger(m),n.danmu=e,n.options=o,n.duration=o.duration,n.id=o.id,n.container=s,n.mode="top"===o.mode||"bottom"===o.mode?o.mode:"scroll",n.start=o.start,n.prior=o.prior,n.realTime=o.realTime,n.color=o.color,n.bookChannelId=o.bookChannelId,n.reuseDOM=!0,n.noCopyEl=!(!a.disableCopyDOM&&!o.disableCopyDOM),n.recycler=r,n._fullySlideInScreenDuration=void 0,n._lastMoveTime=void 0,n.status="waiting",o.elLazyInit||(n.bulletCreateFail=!n._makeEl()),n}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&g(i,e),t=[{key:"moveV",get:function(){var e=this.danmu,t=this.options,i=this._moveV;if(!i){if(t.moveV)i=t.moveV;else if(this.elPos){var n=e.containerPos;i=("b2t"===this.direction?n.height+(e.config.chaseEffect?this.height:0):n.width+(e.config.chaseEffect?this.width:0))/this.duration*1e3}i&&(i*=e.main.playRate,this._moveV=i)}return i}},{key:"direction",get:function(){return this.danmu.direction}},{key:"fullySlideIntoScreen",get:function(){var e=!0;return"scroll"===this.mode&&this._lastMoveTime&&this._fullySlideInScreenDuration>0&&(e=((new Date).getTime()-this._lastMoveTime)/1e3>=this._fullySlideInScreenDuration),e}},{key:"_makeEl",value:function(){var e,t,i=this.danmu,n=this.options,o=i.config,s=i.globalHooks,r="",a=n.style||{};if(a.perspective="500em",n.el||n.elLazyInit){if(this.noCopyEl&&(this.reuseDOM=!1),n.elLazyInit){if("function"==typeof s.bulletCreateEl)try{var l,u=s.bulletCreateEl(n);e=(null!=(l=HTMLElement)&&"undefined"!=typeof Symbol&&l[Symbol.hasInstance]?l[Symbol.hasInstance](u):u instanceof l)?u:u.el}catch(e){}}else if(1===n.el.nodeType&&!n.el.parentNode)if(this.reuseDOM){var c=function(e){if(!e||1!==e.nodeType)return"";var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}(n.el);n.eventListeners&&n.eventListeners.length>0&&n.eventListeners.forEach((function(e){c.addEventListener(e.event,e.listener,e.useCapture||!1)})),(e=this.recycler.use()).childNodes.length>0&&(e.innerHTML=""),e.textContent&&(e.textContent=""),e.appendChild(c)}else e=n.el}else"string"==typeof n.txt&&((e=this.recycler.use()).textContent=n.txt);if(!e||!i.main)return!1;if(f(o.bulletOffset)&&o.bulletOffset>=0)t=o.bulletOffset;else{var h=i.containerPos;t=h.width/10>100?100:h.width/10}var d=n.realTime?0:Math.floor(Math.random()*t);a.left=this.updateOffset(d,!0),Object.keys(a).forEach((function(e){var t=e.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));r+="".concat(t,":").concat(a[e],";")}));var p=r,g=e.style;try{g.cssText=p}catch(e){}return this.el=e,n.like&&n.like.el&&this.setLikeDom(n.like.el,n.like.style),!0}},{key:"updateOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.random=e;var i=this.danmu.containerPos.width+e+"px";return t||d(this.el,"left",this.danmu.containerPos.width+e+"px"),i}},{key:"attach",value:function(){if(this.options.elLazyInit&&!this.el&&this._makeEl(),this.danmu&&this.danmu.main){var e=this.danmu,t=this.options,i=this.el,n=e.globalHooks;n.bulletAttaching&&n.bulletAttaching(t),this.container.contains(i)||this.container.appendChild(i),this.elPos=i.getBoundingClientRect(),"b2t"===this.direction?(this.width=this.elPos.height,this.height=this.elPos.width):(this.width=this.elPos.width,this.height=this.elPos.height),this.moveV&&(this.duration=(this.danmu.containerPos.width+this.random+this.width)/this.moveV*1e3),n.bulletAttached&&n.bulletAttached(t,i)}}},{key:"detach",value:function(){var e=this.el,t=this.danmu,i=this.options,n=t.globalHooks;e&&(n.bulletDetaching&&n.bulletDetaching(i),this.reuseDOM?this.recycler.unused(e):e.parentNode&&e.parentNode.removeChild(e),n.bulletDetached&&n.bulletDetached(i,e),this.el=null),this.elPos=void 0}},{key:"topInit",value:function(){this.logger&&this.logger.info("topInit #".concat(this.options.txt||"[DOM Element]","#")),"b2t"===this.direction?(d(this.el,"transformOrigin","left top"),d(this.el,"transform","translateX(-".concat(this.top,"px) translateY(").concat(this.danmu.containerPos.height,"px) translateZ(0px) rotate(90deg)")),d(this.el,"transition","transform 0s linear 0s")):d(this.el,"top","".concat(this.top,"px"))}},{key:"pauseMove",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("paused"!==this.status&&("forcedPause"!==this.status&&(this.status="paused"),this._moveV=void 0,this.el))if("scroll"===this.mode){var t=this.danmu.containerPos;if(e){var i,n=((new Date).getTime()-this._lastMoveTime)/1e3*this.moveV;i=this.moveMoreS-n>=0?"b2t"===this.direction?(this.moveMoreS-n)/this.moveContainerHeight*t.height:(this.moveMoreS-n)/this.moveContainerWidth*t.width:this.moveMoreS-n,"b2t"===this.direction?d(this.el,"transform","translateX(-".concat(this.top,"px) translateY(").concat(i,"px) translateZ(0px) rotate(90deg)")):d(this.el,"left","".concat(i,"px"))}else"b2t"===this.direction?d(this.el,"transform","translateX(-".concat(this.top,"px) translateY(").concat(this.el.getBoundingClientRect().top-t.top,"px) translateZ(0px) rotate(90deg)")):d(this.el,"left","".concat(this.el.getBoundingClientRect().left-t.left,"px"));"b2t"===this.direction||d(this.el,"transform","translateX(0px) translateY(0px) translateZ(0px)"),d(this.el,"transition","transform 0s linear 0s")}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e){if(this.hasMove||(this.danmu.emit("bullet_start",this),this.hasMove=!0),("forcedPause"!==this.status||e)&&this.el&&"start"!==this.status)if(this.status="start","scroll"===this.mode){var t,i=this.danmu.containerPos;if(!this.el)return;var n=this.el.getBoundingClientRect();if("b2t"===this.direction){t=n.bottom-i.bottom;var o=(n.bottom-i.top)/this.moveV;d(this.el,"transition","transform ".concat(o,"s linear 0s")),d(this.el,"transform","translateX(-".concat(this.top,"px) translateY(-").concat(this.height,"px) translateZ(0px) rotate(90deg)")),this._lastMoveTime=(new Date).getTime(),this.moveMoreS=n.top-i.top,this.moveContainerHeight=i.height}else{t=n.right-i.right;var s=n.right-i.left,r=s/this.moveV;n.right>i.left?(d(this.el,"transition","transform ".concat(r,"s linear 0s")),d(this.el,"transform","translateX(-".concat(s,"px) translateY(0px) translateZ(0px)")),this._lastMoveTime=(new Date).getTime(),this.moveMoreS=n.left-i.left,this.moveContainerWidth=i.width):(this.status="end",this.remove())}this._fullySlideInScreenDuration=t/this.moveV}else{var a=(new Date).getTime(),l=(this.startTime&&a-this.startTime>this.duration?a-this.startTime:this.duration)/1e3;d(this.el,"left","50%"),d(this.el,"margin","0 0 0 -".concat(this.width/2,"px")),d(this.el,"visibility","hidden"),d(this.el,"transition","visibility ".concat(l,"s 0s")),this.pastDuration||(this.pastDuration=1),this.startTime=a}}},{key:"remove",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.logger&&this.logger.info("remove #".concat(this.options.txt||"[DOM Element]","#")),e&&this.pauseMove(),this.el&&this.el.parentNode&&(this.detach(),this.options.el&&1===this.options.el.nodeType&&this.noCopyEl&&d(this.options.el,"transform","none"),this.danmu.emit("bullet_remove",{bullet:this}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e){Object.keys(t).forEach((function(i){e.style[i]=t[i]}));var i="danmu-like";if(e.className=i,this.el){var n=this.el.querySelector("."+i);n&&this.el.removeChild(n),this.el.innerHTML="".concat(this.el.innerHTML).concat(e.outerHTML)}}return e}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(i.prototype,t),i}(a);function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(T=function(){return!!e})()}var E=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(e){var t,n;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return t=_(t=i),(n=function(e,t){var i;if(t&&("object"==((i=t)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,T()?Reflect.construct(t,[],_(this).constructor):t.apply(this,void 0))).setLogger("channel"),n.danmu=e,n.width=0,n.height=0,n.reset(!0),n.channels=[],n.updatePos(),h(n.danmu,"bullet_remove",(function(e){n.removeBullet(e.bullet)}),"destroy"),h(n.danmu,"channel_resize",(function(){n.resize()}),"destroy"),n}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&k(i,e),t=[{key:"direction",get:function(){return this.danmu.direction}},{key:"checkAvailableTrack",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this.channels,i=!1;if("scroll"===e)for(var n,o=0;o<t.length;o++)if(i=!0,(n=t[o]).operating[e])i=!1;else{var s=n.queue[e][0];if(!s||s.fullySlideIntoScreen){if(i)break}else i=!1}else i=!0;return i}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.channels.splice(0,this.channels.length),this._cancelResizeTimer(),this)l.call(this,e)&&delete this[e]}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("reset");var t=this,i=t.danmu,n=i.container,o=i.bulletBtn;function s(){if(t.danmu&&t.danmu.container){var e=t.danmu.container.getBoundingClientRect();t.width=e.width,t.height=e.height,t.resetId&&(cancelAnimationFrame(t.resetId),t.resetId=null);var i=t._initChannels(),n=i.channelSize,o=i.channelCount,s=i.channels;t.channelCount=o,t.channels=s,"b2t"===t.direction?t.channelWidth=n:t.channelHeight=n}}t.container=n,o&&o.main&&o.main.queue.forEach((function(e){e.remove()})),t.channels&&t.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var i=0;i<t.channels.length;i++)t.channels[i].queue[e].forEach((function(e){e.remove()}))})),o&&o.main&&o.main.data&&o.main.data.forEach((function(e){e.attached_=!1})),e?this.resetId=requestAnimationFrame(s):s()}},{key:"getRealOccupyArea",value:function(){return{width:this.width,height:this.height}}},{key:"updatePos",value:function(){var e=this.container.getBoundingClientRect();this.containerPos=e,this.containerWidth=e.width,this.containerHeight=e.height,this.containerTop=e.top,this.containerBottom=e.bottom,this.containerLeft=e.left,this.containerRight=e.right}},{key:"addBullet",value:function(e){var t=this,i=this.danmu,n=this.channels;if("b2t"===t.direction?(s=this.channelWidth,r=Math.ceil(e.width/s)):(o=this.channelHeight,r=Math.ceil(e.height/o)),r>n.length)return{result:!1,message:"exceed channels.length, occupy=".concat(r,",channelsSize=").concat(n.length)};for(var o,s,r,a,l=!0,u=-1,c=0,h=n.length;c<h;c++)if(n[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exited, channelOrder=".concat(c,",danmu_id=").concat(e.id)};if("scroll"===e.mode)for(var d=0,f=n.length-r;d<=f;d+=r){l=!0;for(var p=d;p<d+r;p++){if((a=n[p]).operating.scroll||a.bookId.scroll&&a.bookId.scroll!==e.id){l=!1;break}a.operating.scroll=!0;var g=a.queue.scroll[0];if(g){var v=g.el.getBoundingClientRect();if("b2t"===t.direction){if(v.bottom>=t.containerPos.bottom){l=!1,a.operating.scroll=!1;break}}else if(v.right>=t.containerPos.right){l=!1,a.operating.scroll=!1;break}var m=void 0,y=g.moveV,_=void 0,k=e.moveV,T=void 0;if("b2t"===t.direction?(_=(m=v.bottom-t.containerTop)/y,T=t.containerHeight+e.random-m):(_=(m=v.right-t.containerLeft)/y,T=t.containerWidth+e.random-m),k>y){var E=T/(k-y);if(i.config.bOffset||(i.config.bOffset=0),_+i.config.bOffset>=E){var b=_*k-t.containerPos.width;b>0&&e.updateOffset(b+(1+Math.ceil(5*Math.random())))}}}a.operating.scroll=!1}if(l){u=d;break}}else if("top"===e.mode)for(var A=0,C=n.length-r;A<=C;A++){l=!0;for(var S=A;S<A+r;S++){if(S>Math.floor(n.length/2)||(a=n[S]).operating[e.mode]||(a.bookId[e.mode]||e.prior)&&a.bookId[e.mode]!==e.id){l=!1;break}if(a.operating[e.mode]=!0,a.queue[e.mode].length>0){l=!1,a.operating[e.mode]=!1;break}a.operating[e.mode]=!1}if(l){u=A;break}}else if("bottom"===e.mode)for(var x=n.length-r;x>=0;x--){l=!0;for(var w=x;w<x+r;w++){if(w<=Math.floor(n.length/2)||(a=n[w]).operating[e.mode]||(a.bookId[e.mode]||e.prior)&&a.bookId[e.mode]!==e.id){l=!1;break}if(a.operating[e.mode]=!0,a.queue[e.mode].length>0){l=!1,a.operating[e.mode]=!1;break}a.operating[e.mode]=!1}if(l){u=x;break}}if(-1!==u){for(var I=u,R=u+r;I<R;I++)(a=n[I]).operating[e.mode]=!0,a.queue[e.mode].unshift(e),e.prior&&(delete a.bookId[e.mode],t.logger&&t.logger.info(I+"号轨道恢复正常使用")),a.operating[e.mode]=!1;return e.prior&&(t.logger&&t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,i.player&&i.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}))),e.channel_id=[u,r],e.el.setAttribute("data-line-index",u+1),"b2t"===t.direction?(e.top=u*s,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerWidth*t.danmu.config.area.start)):(e.top=u*o,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start)),{result:e,message:"success"}}if(e.options.realTime){var P=0,O=-1,L=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,i){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=P&&(P=e.start,O=i,L=e)})),L){L.remove(),t.removeBullet(L),t.danmu.bulletBtn.main.queue.splice(O,1),e.channel_id=L.channel_id;for(var D=L.channel_id[0],N=L.channel_id[0]+L.channel_id[1];D<N;D++)(a=n[D]).operating[e.mode]=!0,a.queue[e.mode].unshift(e),e.prior&&delete a.bookId[e.mode],a.operating[e.mode]=!1;return e.top=L.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId||t.danmu.live)i.player&&i.bulletBtn.main.data.some((function(i){return i.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),i.start+=2e3,!0)}));else{u=-1;for(var M=0,F=n.length-r;M<=F;M++){l=!0;for(var H=M;H<M+r;H++)if(n[H].bookId[e.mode]){l=!1;break}if(l){u=M;break}}if(-1!==u){for(var U=u;U<u+r;U++)n[U].bookId[e.mode]=e.id,t.logger&&t.logger.info(U+"号轨道被"+e.id+"号优先弹幕预定");i.player&&i.bulletBtn.main.data.some((function(i){return i.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),i.start+=2e3,i.bookChannelId=[u,r],t.logger&&t.logger.info("".concat(e.id,"号优先弹幕预定了").concat(u,"~").concat(u+r-1,"号轨道")),!0)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger&&this.logger.info("removeBullet ".concat(e.options.txt||"[DOM Element]"));for(var t,i=this.channels,n=e.channel_id,o=n[0],s=n[0]+n[1];o<s;o++)!function(n){if(t=i[n]){t.operating[e.mode]=!0;var o=-1;t.queue[e.mode].some((function(t,i){return t.id===e.id&&(o=i,!0)})),o>-1&&t.queue[e.mode].splice(o,1),t.operating[e.mode]=!1}}(o);e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resizeSync",value:function(){this.resize(!0)}},{key:"_initChannels",value:function(){if(this.danmu&&this.danmu.config){var e=this.danmu.config,t=e.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12);if(e.area){var i,n=e.area,o=n.lines,s=n.start,r=n.end;if("number"==typeof o&&o>=0&&Number.isInteger(o))i=o,"b2t"===this.direction?this.width=i*t:this.height=i*t;else if(s>=0&&r>=s){var a=r-s;"b2t"===this.direction?this.width=Math.floor(this.width*a):this.height=Math.floor(this.height*a)}}f(i)||(i="b2t"===this.direction?Math.floor(this.width/t):Math.floor(this.height/t));for(var l=[],u=0;u<i;u++)l[u]={id:u,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};return{channelSize:t,channelCount:i,channels:l}}}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("resize");var t=this;function i(e,t){e[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}}}function n(){var e=t.danmu,n=e.container,o=e.bulletBtn;t.container=n,t.updatePos(),t._cancelResizeTimer(),o.main.data&&o.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,t.logger&&t.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),t.logger&&t.logger.info("resize导致所有轨道恢复正常使用"),t.width=t.containerWidth,t.height=t.containerHeight;var s=t._initChannels(),r=s.channelSize,a=s.channels;if(t.channels)if(t.channels.length<=a.length){for(var l=function(e){["scroll","top","bottom"].forEach((function(t){a[e].queue[t].forEach((function(e){e.resized=!1}))}))},u=0;u<t.channels.length;u++)i(a,u),function(e){["scroll","top"].forEach((function(i){t.channels[e].queue[i].forEach((function(t){t.el&&a[e].queue[i].push(t)}))}))}(u),function(e){t.channels[e].queue.bottom.forEach((function(i){if(i.el&&(a[e+a.length-t.channels.length].queue.bottom.push(i),i.channel_id[0]+i.channel_id[1]-1===e)){var n=[].concat(i.channel_id);i.channel_id=[n[0]-t.channels.length+a.length,n[1]],i.top=i.channel_id[0]*r,t.danmu.config.area&&t.danmu.config.area.start&&(i.top+=t.containerHeight*t.danmu.config.area.start),i.topInit()}}))}(u);for(var c=0;c<a.length;c++)l(c);t.channels=a,"b2t"===t.direction?t.channelWidth=r:t.channelHeight=r}else!function(e,n){for(var o=function(o){i(e,o),r.forEach((function(i){if("top"===i&&o>Math.floor(e.length/2));else if("bottom"===i&&o<=Math.floor(e.length/2));else{var s="bottom"===i?o-e.length+t.channels.length:o;t.channels[s].queue[i].forEach((function(r,a){if(r.el){if(e[o].queue[i].push(r),"bottom"===i&&r.channel_id[0]+r.channel_id[1]-1===s){var l=[].concat(r.channel_id);r.channel_id=[l[0]-t.channels.length+e.length,l[1]],r.top=r.channel_id[0]*n,t.danmu.config.area&&t.danmu.config.area.start&&(r.top+=t.containerHeight*t.danmu.config.area.start),r.topInit()}t.channels[s].queue[i].splice(a,1)}}))}}))},s=function(t){r.forEach((function(i){e[t].queue[i].forEach((function(e){e.resized=!1}))}))},r=["scroll","top","bottom"],a=0;a<e.length;a++)o(a);for(var l=0;l<e.length;l++)s(l);t.channels=e,"b2t"===t.direction?t.channelWidth=n:t.channelHeight=n}(a,r);t.resizing=!1}t.resizing||(t.resizing=!0,e?n():(this._cancelResizeTimer(),this.resizeId=requestAnimationFrame(n)))}},{key:"_cancelResizeTimer",value:function(){this.resizeId&&(cancelAnimationFrame(this.resizeId),this.resizeId=null)}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(i.prototype,t),i}(a);function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C=function(){return!!e})()}var S=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(e){var t,n;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return n=b(n=i),(t=function(e,t){var i;if(t&&("object"==((i=t)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,C()?Reflect.construct(n,[],b(this).constructor):n.apply(this,void 0))).setLogger("main"),t.danmu=e,t.container=e.container,t.channel=new E(e),t.data=[].concat(e.config.comments),t.playedData=[],t.queue=[],t.timer=null,t.playRate=1,t.retryStatus="normal",t.interval=e.config.interval,t._status="idle",t._events=[],t._bindEvents(),t}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&A(i,e),t=[{key:"status",get:function(){return this._status}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this._unbindEvents(),this._cancelTick(),this.channel&&this.channel.destroy(),this.data=[],this)delete this[e]}},{key:"_bindEvents",value:function(){var e=this,t=this.danmu,i=this.container;this._unbindEvents(),this._events.push([t,"bullet_remove",function(t){var i=t.bullet,n=e.data,o=e.queue;o.some((function(e,t){return e.id===i.id&&(o.splice(t,1),!0)})),n.some((function(e){return e.id===i.id&&(e.attached_=!1,!0)}))}]),this._events.push([i,"transitionend",function(t){var i=e._getBulletByEvt(t);i&&(i.status="end",i.remove(!1))}]),(t.config.mouseControl||t.config.mouseEnterControl)&&this._events.push([i,"mouseover",function(t){var i,n=e.danmu;n&&(!n.mouseControl||!n.config.mouseControlPause)&&(i=e._getBulletByEvt(t))&&"waiting"!==i.status&&"end"!==i.status&&n.emit("bullet_hover",{bullet:i,event:t})}]),this._events.forEach((function(e){e[0].addEventListener?e[0].addEventListener(e[1],e[2],!1):e[0].on&&e[0].on(e[1],e[2])}))}},{key:"_unbindEvents",value:function(){this._events.length&&(this._events.forEach((function(e){e[0].removeEventListener?e[0].removeEventListener(e[1],e[2],!1):e[0].off&&e[0].off(e[1],e[2])})),this._events=[])}},{key:"_cancelTick",value:function(){this.handleTimer&&(clearTimeout(this.handleTimer),this.handleTimer=null)}},{key:"_startTick",value:function(){var e=this;e.retryStatus="normal",e._cancelTick(),e.sortData(),function t(){"closed"===e._status&&"stop"===e.retryStatus?e._cancelTick():("playing"===e._status&&(e.readData(),e.dataHandle()),("stop"!==e.retryStatus||"paused"===e._status)&&(e.handleTimer=setTimeout(t,250)))}()}},{key:"start",value:function(){this.logger&&this.logger.info("start"),"playing"!==this._status&&(this._status="playing",this.queue=[],this.container.innerHTML="",this.channel.reset(),this._startTick())}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),"closed"!==this._status&&(this._status="closed",this.retryStatus="stop",this.queue=[],this.container&&(this.container.innerHTML=""),this.channel&&this.channel.reset(),this._cancelTick())}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.channel&&this.channel.reset(),this.data=[],this.queue=[],this.container&&(this.container.innerHTML="")}},{key:"play",value:function(){var e=this;if("closed"!==this._status){this.logger&&this.logger.info("play"),this._status="playing";var t=this.channel.channels;t&&t.length>0&&["scroll","top","bottom"].forEach((function(i){e.queue.forEach((function(e){e.startMove(),e.resized=!0}));for(var n=0;n<t.length;n++)t[n].queue[i].forEach((function(e){e.resized=!1}))})),this._startTick()}else this.logger&&this.logger.info("play ignored")}},{key:"pause",value:function(){if("closed"!==this._status){this.logger&&this.logger.info("pause"),this._status="paused",this._cancelTick();var e=this.channel.channels;e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove()}))}else this.logger&&this.logger.info("pause ignored")}},{key:"dataHandle",value:function(){"paused"!==this._status&&"closed"!==this._status&&this.queue.length&&this.queue.forEach((function(e){"waiting"===e.status&&e.startMove()}))}},{key:"readData",value:function(){var e=this.danmu,t=this.interval,i=this.channel,n=e.player;if(e.isReady&&e.main){if(n){var o=n.currentTime?Math.floor(1e3*n.currentTime):0;r=this.data.filter((function(i){return!i.start&&0>e.hideArr.indexOf(i.mode)&&(!i.color||0>e.hideArr.indexOf("color"))&&(i.start=o),!i.attached_&&0>e.hideArr.indexOf(i.mode)&&(!i.color||0>e.hideArr.indexOf("color"))&&i.start-t<=o&&o<=i.start+t})),e.config.highScorePriority&&r.sort((function(e,t){return t.prior&&!e.prior||(t.score||-1)-(e.score||-1)})),e.live&&(this.data=[])}else 0===(r=this.data.splice(0,1)).length&&(r=this.playedData.splice(0,1));if(r.length>0&&i.checkAvailableTrack(r[0].mode)){i.updatePos();for(var s,r,a,u=0,c=0;c<r.length;c++)if(a=r[c],this.forceDuration&&this.forceDuration!==a.duration&&(a.duration=this.forceDuration),(s=new y(e,a)).bulletCreateFail){if(0===u)break;u--}else if(s.attach(),a.attached_=!0,i.addBullet(s).result)this.queue.push(s),s.topInit(),u=0;else{for(var h in s.detach(),s)l.call(s,h)&&delete s[h];if(s=null,a.attached_=!1,a.noDiscard&&(a.prior?this.data.unshift(a):this.data.push(a)),0===u)break;u--}}}}},{key:"sortData",value:function(){this.data.sort((function(e,t){return(e.start||-1)-(t.start||-1)}))}},{key:"keepPoolWatermark",value:function(){var e=this.danmu,t=e.config,i=e.player,n=this.data,o=[],s=0;if("number"==typeof t.maxCommentsLength&&n.length>t.maxCommentsLength){s=n.length-t.maxCommentsLength;for(var r,a=0;a<s;a++)(r=n[a]).prior&&!r.attached_&&o.push(n[a])}else if(t.dropStaleComments&&i&&i.currentTime){var l=Math.floor(1e3*i.currentTime)-t.interval;if(l>0)for(var u,c=0;c<n.length;c++)if((u=n[c]).prior&&!u.attached_&&o.push(n[c]),u.start>l){s=c;break}}s>0&&(n.splice(0,s),this.data=o.concat(n))}},{key:"_getBulletByEvt",value:function(e){for(var t,i,n=e.target||e.srcElement,o=this.queue,s=0;s<o.length;s++)if((i=o[s])&&i.el&&(i.el===n||i.el.contains(n))){t=i;break}return t}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(i.prototype,t),i}(a);function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}var R=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(e){var t,n;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return n=x(n=i),(t=function(e,t){var i;if(t&&("object"==((i=t)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,I()?Reflect.construct(n,[],x(this).constructor):n.apply(this,void 0))).setLogger("control"),t.danmu=e,t.main=new S(e),e.config.defaultOff||t.main.start(),t}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&w(i,e),t=[{key:"createSwitch",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return this.logger&&this.logger.info("createSwitch"),this.switchBtn=function(){var e=arguments.length>0&&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.length>3&&void 0!==arguments[3]?arguments[3]:"",o=document.createElement(e);return o.className=n,o.innerHTML=t,Object.keys(i).forEach((function(t){var n=i[t];"video"===e||"audio"===e?n&&o.setAttribute(t,n):o.setAttribute(t,n)})),o}("dk-switch",'<span class="txt">弹</span>',{},"danmu-switch ".concat(e?"danmu-switch-active":"")),this.switchBtn}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.main.destroy(),this)l.call(this,e)&&delete this[e]}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(i.prototype,t),i}(a),P=function(){var e;function t(e){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e={initDOM:function(){return document.createElement("div")},initSize:10},this.init(e)}return e=[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unused",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.style.opacity=0,this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.clearElementStyle(this.idleList[e]);for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.clearElementStyle(this.usingList[t]);for(var i in this)l.call(this,i)&&delete this[i]}},{key:"clearElementStyle",value:function(e){var t="undefined"!=typeof window?window.navigator.userAgent:null;t&&(t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1?d(e,"transform","none"):e.setAttribute("style",""))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}(),O=new(function(){var e;function t(){var e=this;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");if(this.__handlers=[],"undefined"!=typeof ResizeObserver)try{this.observer=new ResizeObserver(function(e){var t=this,i=0;return function(){for(var n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];clearTimeout(i),i=setTimeout((function(){return e.apply(t,o)}),100)}}((function(t){e.__trigger(t)})))}catch(e){}}return e=[{key:"addObserver",value:function(e,t){if(this.observer&&e){this.observer&&this.observer.observe(e);for(var i=this.__handlers,n=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(n=o);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){if(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){t[i].handler&&t[i].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}());function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t){var i;if(t&&("object"==((i=t)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(M=function(){return!!e})()}var F=function(e){var i;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");i=L(i=n),(o=D(this,M()?Reflect.construct(i,[],L(this).constructor):i.apply(this,void 0))).setLogger("danmu"),o.logger&&o.logger.info("danmu.js version: ".concat("1.2.1"));var i,o,s=o.config={overlap:!1,area:{start:0,end:1,lines:void 0},hooks:void 0,live:!1,comments:[],direction:"r2l",needResizeObserver:!1,dropStaleComments:!1,channelSize:void 0,maxCommentsLength:void 0,bulletOffset:void 0,interval:2e3,highScorePriority:!0,chaseEffect:!0};if(u(s,e),t()(o),o.globalHooks={},s.hooks&&o.hooks(s.hooks),o.hideArr=[],o.recycler=new P,o.freezeId=null,s.comments.forEach((function(e){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),o.container=s.container&&1===s.container.nodeType?s.container:null,!o.container)return o.emit("error","container id can't be empty"),D(o,!1);if(s.containerStyle){var r=s.containerStyle;Object.keys(r).forEach((function(e){o.container.style[e]=r[e]}))}var a=o.container,l="danmu";return a.classList?l.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(e){e&&a.classList.add(e)})):(a.classList?Array.prototype.some.call(a.classList,(function(e){return e===l})):a.className.match(RegExp("(\\s|^)danmu(\\s|$)")))||(a.className+=" "+l),o.live=s.live,o.player=s.player,o.direction=s.direction,o.bulletBtn=new R(o),o.main=o.bulletBtn.main,o.isReady=!0,o.emit("ready"),o.logger&&o.logger.info("ready"),o.addResizeObserver(),o}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&N(n,e),i=[{key:"status",get:function(){return this.main.status}},{key:"state",get:function(){var e=this.main;return{status:e.status,comments:e.data,bullets:e.queue,displayArea:e.channel.getRealOccupyArea()}}},{key:"containerPos",get:function(){return this.main.channel.containerPos}},{key:"hooks",value:function(e){u(this.globalHooks,e)}},{key:"addResizeObserver",value:function(){var e,t=this;this.config.needResizeObserver&&this.container&&(e=this.container,O.addObserver(e,(function(){t.logger&&t.logger.info("needResizeObserver"),t.resize()})))}},{key:"start",value:function(){this.logger&&this.logger.info("start"),this.main&&this.main.start()}},{key:"pause",value:function(){this.logger&&this.logger.info("pause"),this.main&&this.main.pause()}},{key:"play",value:function(){this.logger&&this.logger.info("play"),this.main&&this.main.play()}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),this.main&&this.main.stop()}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.main&&this.main.clear()}},{key:"destroy",value:function(){var e;for(var t in e=this.container,O.unObserver(e,void 0),this.logger&&this.logger.info("destroy"),this.stop(),this.bulletBtn&&this.bulletBtn.destroy(),this.recycler&&this.recycler.destroy(),this)delete this[t];this.emit("destroy")}},{key:"sendComment",value:function(e){var t=this.main,i=this.logger;i&&i.info("sendComment: ".concat(e.txt||"[DOM Element]")),t&&(e.duration||(e.duration=15e3),e&&e.id&&e.duration&&(e.el||e.elLazyInit||e.txt)&&(e.duration=e.duration?e.duration:5e3,e.style||(e.style={opacity:void 0,fontSize:void 0}),e.style&&(this.opacity&&this.opacity!==e.style.opacity&&(e.style.opacity=this.opacity),this.fontSize&&this.fontSize!==e.style.fontSize&&(e.style.fontSize=this.fontSize)),e.prior||e.realTime?(t.data.unshift(e),e.realTime&&(t.readData(),t.dataHandle())):t.data.push(e),t.sortData(),t.keepPoolWatermark()))}},{key:"setCommentID",value:function(e,t){var i=this;this.logger&&this.logger.info("setCommentID: oldID ".concat(e," newID ").concat(t)),e&&t&&(this.main.data.some((function(i){return i.id===e&&(i.id=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.id=t,n.pauseMove(),"paused"!==i.main.status&&n.startMove(),!0)})))}},{key:"setCommentDuration",value:function(e,t){var i=this;this.logger&&this.logger.info("setCommentDuration: id ".concat(e," duration ").concat(t)),e&&t&&(t=t||5e3,this.main.data.some((function(i){return i.id===e&&(i.duration=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.duration=t,n.pauseMove(),"paused"!==i.main.status&&n.startMove(),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger&&this.logger.info("setCommentLike: id ".concat(e," like ").concat(t)),e&&t&&(this.main.data.some((function(i){return i.id===e&&(i.like=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.pauseMove(),i.setLikeDom(t.el,t.style),"paused"!==i.danmu.main.status&&i.startMove(),!0)})))}},{key:"restartComment",value:function(e){if(this.logger&&this.logger.info("restartComment: id ".concat(e)),e){var t=this.main;this._releaseCtrl(e),"closed"!==t.status&&t.queue.some((function(i){return i.id===e&&("paused"!==t.status?i.startMove(!0):i.status="paused",!0)}))}}},{key:"_releaseCtrl",value:function(e){this.freezeId&&e===this.freezeId&&(this.mouseControl=!1,this.freezeId=null)}},{key:"_freezeCtrl",value:function(e){this.mouseControl=!0,this.freezeId=e}},{key:"freezeComment",value:function(e){this.logger&&this.logger.info("freezeComment: id ".concat(e)),e&&(this._freezeCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.status="forcedPause",t.pauseMove(),t.el&&t.el.style&&d(t.el,"zIndex",10),!0)})))}},{key:"removeComment",value:function(e){if(this.logger&&this.logger.info("removeComment: id ".concat(e)),e){var t=this.main;this._releaseCtrl(e),t.queue=t.queue.filter((function(t){return t.id!==e||(t.remove(),!1)})),t.data=t.data.filter((function(t){return t.id!==e}))}}},{key:"updateComments",value:function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.logger&&this.logger.info("updateComments: ".concat(e.length,", isClear ").concat(t));var i=this.main;"boolean"==typeof t&&t&&(i.data=[]),i.data=i.data.concat(e),i.sortData(),i.keepPoolWatermark()}},{key:"setAllDuration",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",i=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];this.logger&&this.logger.info("setAllDuration: mode ".concat(t," duration ").concat(i," force ").concat(n)),i&&(i=i||5e3,n&&(this.main.forceDuration=i),this.main.data.forEach((function(e){t===e.mode&&(e.duration=i)})),this.main.queue.forEach((function(n){t===n.mode&&(n.duration=i,n.pauseMove(),"paused"!==e.main.status&&n.startMove())})))}},{key:"setPlayRate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",i=arguments.length>1?arguments[1]:void 0;this.logger&&this.logger.info("setPlayRate: ".concat(i)),f(i)&&i>0&&(this.main.playRate=i,this.main.queue.forEach((function(i){t===i.mode&&(i.pauseMove(),"paused"!==e.main.status&&i.startMove())})))}},{key:"setOpacity",value:function(e){this.logger&&this.logger.info("setOpacity: opacity ".concat(e)),this.container&&(this.container.style.opacity=e)}},{key:"setFontSize",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{reflow:!0};this.logger&&this.logger.info("setFontSize: size ".concat(e," channelSize ").concat(t)),this.fontSize="".concat(e,"px"),e&&(this.main.data.forEach((function(e){e.style&&(e.style.fontSize=i.fontSize)})),this.main.queue.forEach((function(e){e.options.style||(e.options.style={}),e.options.style.fontSize=i.fontSize,e.setFontSize(i.fontSize),t&&(e.top=e.channel_id[0]*t,e.topInit())}))),t&&(this.config.channelSize=t,n.reflow&&this.main.channel.resizeSync())}},{key:"setArea",value:function(e){this.logger&&this.logger.info("setArea: area ".concat(e)),this.config.area=e,!1!==e.reflow&&this.main.channel.resizeSync()}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("hide: mode ".concat(e)),0>this.hideArr.indexOf(e)&&this.hideArr.push(e),this.main.queue.filter((function(t){return e===t.mode||"color"===e&&t.color})).forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("show: mode ".concat(e));var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger&&this.logger.info("setDirection: direction ".concat(e)),this.direction=e,this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger&&this.logger.info("resize"),this.emit("channel_resize")}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,i),n}(a),H=i("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),U=i.n(H),j=i("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),B=i.n(j),V=i("./node_modules/style-loader/dist/runtime/insertBySelector.js"),W=i.n(V),z=i("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),G=i.n(z),K=i("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),Y=i.n(K),X=i("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),q=i.n(X),J=i("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/style/index.scss"),Z={};Z.styleTagTransform=q(),Z.setAttributes=G(),Z.insert=W().bind(null,"head"),Z.domAPI=B(),Z.insertStyleElement=Y(),U()(J.A,Z),J.A&&J.A.locals&&J.A.locals}(),n}()},7512:function(e,t,i){var n=i(3036);function o(e,t,i,n,o){var r=s.apply(this,arguments);return e.addEventListener(i,r,o),{destroy:function(){e.removeEventListener(i,r,o)}}}function s(e,t,i,o){return function(i){i.delegateTarget=n(i.target,t),i.delegateTarget&&o.call(e,i)}}e.exports=function(e,t,i,n,s){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof i?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,i,n,s)})))}},7997:function(e,t,i){"use strict";i.r(t),i.d(t,{BasePlugin:function(){return k.Ay},CssFullscreenIcon:function(){return oe},Danmu:function(){return Ti},DanmuIcon:function(){return ki},DanmuPanel:function(){return yi},DefaultPreset:function(){return $t},DefaultPresetEn:function(){return ei},Errors:function(){return h.A},Events:function(){return d},FullscreenIcon:function(){return ue},HeatMap:function(){return _n},I18N:function(){return V},InstManager:function(){return X},LivePreset:function(){return ti},Loading:function(){return it},MobilePreset:function(){return ii},PlayIcon:function(){return de},Plugin:function(){return I},Progress:function(){return ve},STATES:function(){return z},STATE_CLASS:function(){return L},SimplePlayer:function(){return Q},Sniffer:function(){return c},Start:function(){return Re},TextTrack:function(){return yn},TimeIcon:function(){return me},Util:function(){return r.Ay},VolumeIcon:function(){return Te},default:function(){return Qt},langBr:function(){return si},langDe:function(){return ri},langEn:function(){return F},langEs:function(){return ai},langFr:function(){return li},langId:function(){return ui},langIt:function(){return ci},langJp:function(){return oi},langKr:function(){return hi},langMsMy:function(){return di},langRu:function(){return fi},langTh:function(){return pi},langVn:function(){return gi},langZhCn:function(){return Vt},langZhHk:function(){return ni}});var n=i(1894),o=i(228),s=i.n(o),r=i(5489),a=/(Android)\s([\d.]+)/,l=/(Version)\/([\d.]+)/,u=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],c={get device(){return c.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(i){return t[i].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Tizen)/gi.test(e),o=/(?:Web0S)/gi.test(e),s=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),a=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=a||s&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),u=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:u,isIpad:a,isIos:u||a,isAndroid:s,isPc:!(u||s||i||l),isSymbian:i,isWindowsPhone:t,isFireFox:r,isTizen:n,isWebOS:o}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?l:a)?t.exec(e):[];if(i&&i.length>=3){var n=i[2].split(".");return n.length>0?parseInt(n[0]):0}return 0},get isWeixin(){return"undefined"!=typeof navigator&&!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&u.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};try{var o=MediaSource.isTypeSupported(i.contentType),s=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:o&&s,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},h=i(3592),d=i(6985);function f(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var p=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;(0,n.xs)(this,i),(o=t.call(this,e))._hasStart=!1,o._currentTime=0,o._duration=0,o._internalOp={},o._lastMuted=!1,o.vtype="MP4",o._rate=-1,o.mediaConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var s=e["x5-video-player-type"]||e.x5VideoPlayerType;return c.isWeixin&&c.os.isAndroid&&s&&(o.mediaConfig["x5-video-player-type"]=s,delete o.mediaConfig.playsinline,delete o.mediaConfig["webkit-playsinline"],delete o.mediaConfig["x5-playsinline"]),e.loop&&(o.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(o.mediaConfig,"muted")&&(o.mediaConfig.muted=!0),o.media=e.mediaEl instanceof HTMLMediaElement?e.mediaEl:"function"==typeof e.mediaEl?e.mediaEl(o.mediaConfig):r.Ay.createDom(o.mediaConfig.mediaType,"",o.mediaConfig,""),e.defaultPlaybackRate&&(o.media.defaultPlaybackRate=o.media.playbackRate=e.defaultPlaybackRate),"Number"===r.Ay.typeOf(e.volume)&&(o.volume=e.volume),e.autoplayMuted&&(o.media.muted=!0,o._lastMuted=!0),e.autoplay&&(o.media.autoplay=!0),e.playsinline&&(o.media.playsinline=!0),o._interval={},o.mediaEventMiddleware={},o.attachVideoEvents(),o}return(0,n.j6)(i,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(i){t.mediaEventMiddleware[i]=e[i]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=d.VIDEO_EVENTS.map((function(t){var i="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[i]&&e.on(t,e[i]),(0,n.n8)({},t,function(e,t){return function(i,n){var o={player:t,eventName:e,originalEvent:i,detail:i.detail||{},timeStamp:i.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[i.type],muted:t.muted,volume:t.volume,host:r.Ay.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(i.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var s=t.media?t.media.playbackRate:0;if(s&&t._rate===s)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(o.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(o.error=n||t.video.error),t.mediaEventMiddleware[e]){var a=f.bind(t,e,o);try{t.mediaEventMiddleware[e].call(t,o,a)}catch(i){throw f.call(t,e,o),i}}else f.call(t,e,o)}}(t,e))}))),this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.addEventListener(i,e[i],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.removeEventListener(i,e[i],!1)})),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0],n="on".concat(i.charAt(0).toUpperCase()).concat(i.slice(1));"function"==typeof e[n]&&e.off(i,e[n])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var i=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){i.media.appendChild(r.Ay.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var n=e.children;if(n){this._videoSourceCount=n.length,this._videoSourceIndex=n.length,this._vLoadeddata=function(e){i.emit(d.SOURCE_SUCCESS,{src:e.target.currentSrc,host:r.Ay.getHostFromUrl(e.target.currentSrc)})};for(var o=null,s=0;s<this._evHandlers.length;s++)if("error"===Object.keys(this._evHandlers[s])[0]){o=this._evHandlers[s];break}!this._sourceError&&(this._sourceError=function(e){var t=parseInt(e.target.getAttribute("data-index"),10);if(i._videoSourceIndex--,0===i._videoSourceIndex||t>=i._videoSourceCount){var n={code:4,message:"sources_load_error"};o?o.error(e,n):i.errorHandler("error",n)}var s=h.L[4];i.emit(d.SOURCE_ERROR,new h.A(i,{errorType:s,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<n.length;a++)n[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var i=0;i<t.length;i++)t[i].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var i=this.media.error||t,n=i.code?h.L[i.code]:"other";i.message,this.media.currentSrc||this.media.srcObject||(i={code:6,message:"empty_src"}),this.emit(e,new h.A(this,{errorType:n,errorCode:i.code,errorMessage:i.message||"",mediaError:i}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var i=this.media.currentTime;if(e)for(var n=0,o=e.length;n<o&&(t[0]=e.start(n),t[1]=e.end(n),!(t[0]<=i&&i<=t[1]));n++);return t[0]-i<=0&&i-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?r.Ay.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var i=0;i<t.length;i++)if((t.start(i)<=this.currentTime||t.start(i)<.1)&&t.end(i)>=this.currentTime)return{start:t.start(i),end:t.end(i)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){return this.media.error?["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]:""}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(d.URL_CHANGE,e),this.emit(d.WAITING),this._currentTime=0,this._duration=0,r.Ay.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===r.Ay.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var o,s=arguments.length,r=new Array(s>2?s-2:0),a=2;a<s;a++)r[a-2]=arguments[a];(o=(0,n.Jt)((0,n.U6)(i.prototype),"emit",this)).call.apply(o,[this,e,t].concat(r))}},{key:"on",value:function(e,t){for(var o,s=arguments.length,r=new Array(s>2?s-2:0),a=2;a<s;a++)r[a-2]=arguments[a];(o=(0,n.Jt)((0,n.U6)(i.prototype),"on",this)).call.apply(o,[this,e,t].concat(r))}},{key:"once",value:function(e,t){for(var o,s=arguments.length,r=new Array(s>2?s-2:0),a=2;a<s;a++)r[a-2]=arguments[a];(o=(0,n.Jt)((0,n.U6)(i.prototype),"once",this)).call.apply(o,[this,e,t].concat(r))}},{key:"off",value:function(e,t){for(var o,s=arguments.length,r=new Array(s>2?s-2:0),a=2;a<s;a++)r[a-2]=arguments[a];(o=(0,n.Jt)((0,n.U6)(i.prototype),"off",this)).call.apply(o,[this,e,t].concat(r))}},{key:"offAll",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"removeAllListeners",this).call(this)}}]),i}(s()),g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};(0,n.xs)(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return(0,n.j6)(e,[{key:"openDB",value:function(e){var t=this,i=this,n=this.myDB.version||1,o=i.indexedDB.open(i.myDB.name,n);o.onerror=function(e){},o.onsuccess=function(n){t.myDB.db=n.target.result,e.call(i)},o.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(i.myDB.ojstore.name)||t.createObjectStore(i.myDB.ojstore.name,{keyPath:i.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),o=0;o<t.length;o++)(i=n.add(t[o])).onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),o=0;o<t.length;o++)(i=n.put(t[o])).onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,i){var n=this,o=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);o.onerror=function(){i.call(n,null)},o.onsuccess=function(e){var t=e.target.result;i.call(n,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),v=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],y=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],_="data-xgplayerid",k=i(4680),T=i(7512),E=i.n(T),b=i(4611),A={CONTROLS:"controls",ROOT:"root"},C={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},S="xg-icon-disable";function x(e){return!!e&&e.indexOf&&/^(?:http|data:|\/)/.test(e)}function w(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=null;if(e instanceof window.Element)return r.Ay.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(x(e)||x(e.url))return n.src=x(e)?e:e.url||"",s=r.Ay.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(s=e())instanceof window.Element?(r.Ay.addClass(s,i),Object.keys(n).map((function(e){s.setAttribute(e,n[e])})),s):(b.A.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(o,"] is a function mast return an Element Object")),null)}catch(e){return b.A.logError("Plugin named [".concat(o,"]:createIcon"),e),null}return"string"==typeof e?r.Ay.createDomFromHtml(e,n,i):(b.A.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(o,"] is invalid")),null)}var I=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.xs)(this,i),(e=t.call(this,o)).__delegates=[],e}return(0,n.j6)(i,[{key:"__init",value:function(e){if((0,n.Jt)((0,n.U6)(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,o=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],function(e,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(o){var s=e[o],r=s&&s.class?s.class:"",a=s&&s.attr?s.attr:{},l=null;i&&i[o]&&(r=function(e,t){return"object"===(0,n.uk)(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[o],r),a=function(e,t){return"object"===(0,n.uk)(e)&&e.attr&&"object"===(0,n.uk)(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[o],a),l=w(i[o],o,r,a,t.pluginName)),!l&&s&&(l=w(s.icon?s.icon:s,a,r,{},t.pluginName)),t.icons[o]=l}))}(this.registerIcons()||{},this),this.langText={};var s,a,l=this.registerLanguageTexts()||{};s=l,a=this,Object.keys(s).map((function(e){Object.defineProperty(a.langText,e,{get:function(){var t=a.lang,i=a.i18n;return i[e]?i[e]:s[e]&&s[e][t]||""}})}));var u="";try{u=this.render()}catch(e){throw b.A.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(u)(o=i.insert(u,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(o=r.Ay.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(o)}this.root=o,this.parent=t;var c=this.config.attr||{},h=this.config.style||{};this.setAttr(c),this.setStyle(h),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===(0,n.uk)(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var o,s,a=i,l=t[a],u={root:e.root};"function"==typeof l?(o=e.config[a]||{},s=l):"object"===(0,n.uk)(l)&&"function"==typeof l.plugin&&(o=l.options?r.Ay.deepCopy(e.config[a]||{},l.options):e.config[a]||{},s=l.plugin),u.config=o,void 0!==o.index&&(u.index=o.index),o.root&&(u.root=o.root),e.registerPlugin(s,u,a)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,i=this.i18n,n=this.langText;t&&function e(t,i){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],i):i(t.children[n])}(t,(function(t){var o=t.getAttribute&&t.getAttribute("lang-key");if(o){var s=i[o.toUpperCase()]||n[o];s&&(t.innerHTML="function"==typeof s?s(e):s)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var o=i[t]||n[t]||"";o&&(e.innerHTML=o)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,r.Ay.addClass(this.find(".xgplayer-icon"),S)}},{key:"enable",value:function(){this.config.disable=!1,r.Ay.removeClass(this.find(".xgplayer-icon"),S)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var s=(0,n.Jt)((0,n.U6)(i.prototype),"registerPlugin",this).call(this,e,t,o);return this._children.push(s),s}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,n){var o=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){o.bindEL(e,t)})):this.bindEL(e,t);else{var s=i.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(s)}}},{key:"unbind",value:function(e,t){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n="".concat(e,"_").concat(t),o=0;o<this.__delegates.length;o++)if(this.__delegates[o].key===n){this.__delegates[o].destroy(),this.__delegates.splice(o,1);break}}},{key:"setStyle",value:function(e,t){var i=this;if(this.root)return"String"===r.Ay.typeOf(e)?this.root.style[e]=t:void("Object"===r.Ay.typeOf(e)&&Object.keys(e).map((function(t){i.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var i=this;if(this.root)return"String"===r.Ay.typeOf(e)?this.root.setAttribute(e,t):void("Object"===r.Ay.typeOf(e)&&Object.keys(e).map((function(t){i.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}},{key:"unbindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,i)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return b.A.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),(0,n.Jt)((0,n.U6)(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null})),this.extraEls=[]}}],[{key:"insert",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,o=Number(i),s=e instanceof window.Node;if(n){for(var r=0,a=null,l="";r<n;r++){a=t.children[r];var u=Number(a.getAttribute("data-index"));if(u>=o){l="beforebegin";break}u<o&&(l="afterend")}return s?"afterend"===l?t.appendChild(e):t.insertBefore(e,a):a.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[r]}return s?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,i,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=[];if(e instanceof window.Node&&"function"==typeof n)if(Array.isArray(i))i.forEach((function(i){var r=E()(e,t,i,n,o);r.key="".concat(t,"_").concat(i),s.push(r)}));else{var r=E()(e,t,i,n,o);r.key="".concat(t,"_").concat(i),s.push(r)}return s}},{key:"ROOT_TYPES",get:function(){return A}},{key:"POSITIONS",get:function(){return C}}]),i}(k.Ay),R=function(){function e(){var t=this;if((0,n.xs)(this,e),(0,n.n8)(this,"__trigger",(function(e){var i=(new Date).getTime();t.timeStamp=i;for(var n=0;n<e.length;n++)t.__runHandler(e[n].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver((0,r.nF)(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return(0,n.j6)(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(_),n=this.__handlers,o=-1,s=0;s<n.length;s++)n[s]&&e===n[s].target&&(o=s);o>-1?this.__handlers[o].handler=t:this.__handlers.push({target:e,handler:t,playerId:i})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)}));try{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(e){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){try{t[i].handler(e)}catch(e){console.error(e)}return!0}return!1}}]),e}(),P=null,O={pluginGroup:{},init:function(e){var t,i,n=e._pluginInfoId;n||(n=(new Date).getTime(),e._pluginInfoId=n),!e.config.closeResizeObserver&&(t=e.root,i=function(){e.resize()},P||(P=new R),P.addObserver(t,i)),this.pluginGroup[n]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var i=null,n=null;return e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),t&&(n.config=t||{}),{PLUFGIN:i,options:n}},checkPluginIfExits:function(e,t){for(var i=0;i<t.length;i++)if(e.toLowerCase()===t[i].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var i=Object.keys(t),n=null,o=0;o<i.length;o++)if(e.toLowerCase()===i[o].toLowerCase()){n=t[i[o]];break}return"Object"===r.Ay.typeOf(n)?{root:n.root,position:n.position}:{}},lazyRegister:function(e,t){var i=this,n=t.timeout||1500;return Promise.race([t.loader().then((function(t){var n;n=t&&t.__esModule?t.default:t,i.register(e,n,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),n)}))])},register:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var n=e._pluginInfoId;if(n&&this.pluginGroup[n]){this.pluginGroup[n]._plugins||(this.pluginGroup[n]._plugins={});var o=this.pluginGroup[n]._plugins,s=this.pluginGroup[n]._originalOptions;i.player=e;var a=i.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){i.config||(i.config={});for(var l=Object.keys(s),u=0;u<l.length;u++)if(a.toLowerCase()===l[u].toLowerCase()){var c=s[l[u]];"Object"===r.Ay.typeOf(c)?i.config=Object.assign({},i.config,s[l[u]]):"Boolean"===r.Ay.typeOf(c)&&(i.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===i.config[e]&&(i.config[e]=t.defaultConfig[e])})),i.root?"string"==typeof i.root&&(i.root=e[i.root]):i.root=e.root,i.index=i.config.index||0;try{o[a.toLowerCase()]&&(this.unRegister(n,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var h=new t(i);return o[a.toLowerCase()]=h,o[a.toLowerCase()].func=t,h&&"function"==typeof h.afterCreate&&h.afterCreate(),h}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var i=this.pluginGroup[e]._plugins[t];i&&(i.pluginName&&i.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(i){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),i)}},deletePlugin:function(e,t){var i=e._pluginInfoId;i&&this.pluginGroup[i]&&this.pluginGroup[i]._plugins&&delete this.pluginGroup[i]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var i=e._pluginInfoId;if(!i||!this.pluginGroup[i])return null;var n=t.toLowerCase();return this.pluginGroup[i]._plugins[n]},beforeInit:function(e){var t=this;function i(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(n){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var o=e._pluginInfoId;if(t.pluginGroup[o]){var s=t.pluginGroup[o]._plugins,r=[];Object.keys(s).forEach((function(e){if(s[e]&&s[e].beforePlayerInit)try{var t=s[e].beforePlayerInit();r.push(i(t))}catch(e){throw r.push(i(null)),e}})),Promise.all([].concat(r)).then((function(){n()})).catch((function(e){console.error(e),n()}))}else n()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins;Object.keys(i).forEach((function(e){i[e]&&i[e].afterPlayerInit&&i[e].afterPlayerInit()}))}},setLang:function(e,t){var i=t._pluginInfoId;if(i&&this.pluginGroup[i]){var n=this.pluginGroup[i]._plugins;Object.keys(n).forEach((function(t){if(n[t].updateLang)n[t].updateLang(e);else try{n[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,i=e._pluginInfoId;if(i&&this.pluginGroup[i]){var n=[],o=this.pluginGroup[i]._plugins;Object.keys(o).forEach((function(e){"controls"!==e&&o[e]&&(n.push({plugin:o[e].func,options:o[e].__args}),t.unRegister(i,e))})),n.forEach((function(i){t.register(e,i.plugin,i.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins||{};Object.keys(i).forEach((function(e){i[e].onPluginsReady&&"function"==typeof i[e].onPluginsReady&&i[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n;i=e.root,null===(n=P)||void 0===n||n.unObserver(i,undefined);for(var o=this.pluginGroup[t]._plugins,s=0,r=Object.keys(o);s<r.length;s++){var a=r[s];this.unRegister(t,a)}delete this.pluginGroup[t],delete e._pluginInfoId}}},L={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function D(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:(0,r.Xo)(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}var N=i(3237),M=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onMouseEnter",(function(t){var i=(0,n.V5)(e),o=i.player;i.playerConfig.closeControlsBlur&&o.focus({autoHide:!1})})),(0,n.n8)((0,n.V5)(e),"onMouseLeave",(function(t){(0,n.V5)(e).player.focus()})),e}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==c.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.disable,n=t.height,o=t.mode;if(!i){"flex"===o&&this.player.addClass(L.FLEX_CONTROLS);var s={height:"".concat(n,"px")};Object.keys(s).map((function(t){e.root.style[t]=s[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(d.MINI_STATE_CHANGE,(function(t){t?r.Ay.addClass(e.root,"mini-controls"):r.Ay.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==c.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&r.Ay.addClass(this.root,L.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){r.Ay.removeClass(this.root,L.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(this.root){var s=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:s.position){case C.CONTROLS_LEFT:t.root=this.left;break;case C.CONTROLS_RIGHT:t.root=this.right;break;case C.CONTROLS_CENTER:t.root=this.center;break;case C.CONTROLS:t.root=this.root;break;default:t.root=this.left}return(0,n.Jt)((0,n.U6)(i.prototype),"registerPlugin",this).call(this,e,t,o)}}}},{key:"destroy",value:function(){"mobile"!==c.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,o=e.initShow;if(!e.disable){var s=r.Ay.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},(0,n.n8)({},L.CONTROLS_AUTOHIDE,i),{"xgplayer-controls-initshow":o||!i});return'<xg-controls class="'.concat(s,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),i}(I),F={LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}},H={lang:{},langKeys:[],textKeys:[]};function U(e,t){return Object.keys(t).forEach((function(i){var o,s=r.Ay.typeOf(t[i]),a=r.Ay.typeOf(e[i]);"Array"===s?("Array"!==a&&(e[i]=[]),(o=e[i]).push.apply(o,(0,n.Og)(t[i]))):"Object"===s?("Object"!==a&&(e[i]={}),U(e[i],t[i])):e[i]=t[i]})),e}function j(){Object.keys(H.lang.en).map((function(e){H.textKeys[e]=e}))}function B(e,t){var i=e.LANG;if(t||(t=H),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?U(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),j()}}B(F);var V={get textKeys(){return H.textKeys},get langKeys(){return H.langKeys},get lang(){var e={};return H.langKeys.map((function(t){e[t]=H.lang[t]})),H.lang["zh-cn"]&&(e.zh=H.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=H),t.lang){i="Array"!==r.Ay.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var n=t.lang;i.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),n[e.LANG]?U(n[e.LANG]||{},e.TEXT||{}):B(e,t)})),j()}},use:B,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return U(i.lang,H.lang),(t=i.langKeys).push.apply(t,(0,n.Og)(H.langKeys)),U(i.textKeys,H.textKeys),i}},W=i(310),z={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},G=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],K={},Y=null,X=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"add",value:function(e){e&&(K[e.playerId]=e,1===Object.keys(K).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete K[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in K)if(Object.prototype.hasOwnProperty.call(K,i)){var n=K[i];if(t){if(e(n))break}else e(n)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var n=e(i);return n&&(t=i),n}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(K[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):K[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(K),t=0;t<e.length;t++){var i=K[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(K[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):K[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Y||(Y=new i),Y}}]),i}(o.EventEmitter),q=["play","pause","replay","retry"],J=0,Z=0,$=null,Q=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;(0,n.xs)(this,i);var s=r.Ay.deepMerge(D(),e);o=t.call(this,s),(0,n.n8)((0,n.V5)(o),"canPlayFunc",(function(){if(o.config){var e=o.config,t=e.autoplay,i=e.defaultPlaybackRate;b.A.logInfo("player","canPlayFunc, startTime",o.__startTime),o._seekToStartTime(),o.playbackRate=i,(t||o._useAutoplay)&&o.mediaPlay(),o.off(d.CANPLAY,o.canPlayFunc),o.removeClass(L.ENTER)}})),(0,n.n8)((0,n.V5)(o),"onFullscreenChange",(function(e,t){var i=function(){r.Ay.setTimeout((0,n.V5)(o),(function(){o.resize()}),100)},s=r.Ay.getFullScreenEl();o._fullActionFrom?o._fullActionFrom="":o.emit(d.USER_ACTION,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:o.currentTime,duration:o.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var a=(0,r.Dq)(s,o.playerId,_);if(t||s&&(s===o._fullscreenEl||a))i(),!o.config.closeFocusVideoFocus&&o.media.focus(),o.fullscreen=!0,o.changeFullStyle(o.root,s,L.FULLSCREEN),o.emit(d.FULLSCREEN_CHANGE,!0,o._fullScreenOffset),o.cssfullscreen&&o.exitCssFullscreen();else if(o.fullscreen){i();var l=(0,n.V5)(o),u=l._fullScreenOffset;if(l.config.needFullscreenScroll?(window.scrollTo(u.left,u.top),r.Ay.setTimeout((0,n.V5)(o),(function(){o.fullscreen=!1,o._fullScreenOffset=null}),100)):(!o.config.closeFocusVideoFocus&&o.media.focus(),o.fullscreen=!1,o._fullScreenOffset=null),o.cssfullscreen)o.removeClass(L.FULLSCREEN);else{var c=o._fullscreenEl;c||!o.root.contains(e.target)&&e.target!==o.root||(c=e.target),o.recoverFullStyle(o.root,c,L.FULLSCREEN)}o._fullscreenEl=null,o.emit(d.FULLSCREEN_CHANGE,!1)}})),(0,n.n8)((0,n.V5)(o),"_onWebkitbeginfullscreen",(function(e){o._fullscreenEl=o.media,o.onFullscreenChange(e,!0)})),(0,n.n8)((0,n.V5)(o),"_onWebkitendfullscreen",(function(e){o.onFullscreenChange(e,!1)})),(0,N.Ay)((0,n.V5)(o),q),o.config=s,o._pluginInfoId=r.Ay.generateSessionId(),(0,b.P)((0,n.V5)(o));var a=o.constructor.defaultPreset;if(o.config.presets.length){var l=o.config.presets.indexOf("default");l>=0&&a&&(o.config.presets[l]=a)}else a&&o.config.presets.push(a);if(o.userTimer=null,o.waitTimer=null,o.handleSource=!0,o._state=z.INITIAL,o.isAd=!1,o.isError=!1,o._hasStart=!1,o.isSeeking=!1,o.isCanplay=!1,o._useAutoplay=!1,o.__startTime=-1,o.rotateDeg=0,o.isActive=!1,o.fullscreen=!1,o.cssfullscreen=!1,o.isRotateFullscreen=!1,o._fullscreenEl=null,o.timeSegments=[],o._cssfullscreenEl=null,o.curDefinition=null,o._orgCss="",o._fullScreenOffset=null,o._videoHeight=0,o._videoWidth=0,o.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},o.sizeInfo={width:0,height:0,left:0,top:0},o._accPlayed={t:0,acc:0,loopAcc:0},o._offsetInfo={currentTime:-1,duration:0},o.innerContainer=null,o.controls=null,o.topBar=null,o.root=null,o.__i18n=V.init(o._pluginInfoId),c.os.isAndroid&&c.osVersion>0&&c.osVersion<6&&(o.config.autoplay=!1),o.database=new g,o.isUserActive=!1,o._onceSeekCanplay=null,o._isPauseBeforeSeek=0,o.innerStates={isActiveLocked:!1},o.instManager=$,!o._initDOM())return console.error(new Error("can't find the dom which id is ".concat(o.config.id," or this.config.el does not exist"))),(0,n.GM)(o);var u=o.config,h=u.definition,f=void 0===h?{}:h;if(!u.url&&f.list&&f.list.length>0){var p=f.list.find((function(e){return e.definition&&e.definition===f.defaultDefinition}));p||(f.defaultDefinition=f.list[0].definition,p=f.list[0]),o.config.url=p.url,o.curDefinition=p}return o._bindEvents(),o._registerPresets(),o._registerPlugins(),O.onPluginsReady((0,n.V5)(o)),o.getInitDefinition(),o.setState(z.READY),r.Ay.setTimeout((0,n.V5)(o),(function(){o.emit(d.READY)}),0),o.onReady&&o.onReady(),(o.config.videoInit||o.config.autoplay)&&(!o.hasStart||o.state<z.ATTACHED)&&o.start(),o}return(0,n.j6)(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.nodeType)return this.emit(d.ERROR,new h.A("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=i}var n=function(e){for(var t=Object.keys(K),i=0;i<t.length;i++){var n=K[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(b.A.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(_,this.playerId),this.media.setAttribute(_,this.playerId),null===(e=$)||void 0===e||e.add(this),O.init(this),this._initBaseDoms(),this.config.controls){var o=this.config.controls.root||null,s=O.register(this,M,{root:o});this.controls=s}var r="mobile"===this.config.isMobileSimulateMode?"mobile":c.device;if(this.addClass("".concat(L.DEFAULT," ").concat(L.INACTIVE," xgplayer-").concat(r," ").concat(this.config.controls?"":L.NO_CONTROLS)),this.config.autoplay?this.addClass(L.ENTER):this.addClass(L.NO_START),this.config.fluid){var a=this.config,l=a.width,u=a.height;"number"==typeof l&&"number"==typeof u||(l=600,u=337.5);var f={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*u/l,"%")};Object.keys(f).forEach((function(e){t.root.style[e]=f[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var p=this.root.getBoundingClientRect(),g=p.width,v=p.height,m=p.left,y=p.top;return this.sizeInfo.width=g,this.sizeInfo.height=v,this.sizeInfo.left=m,this.sizeInfo.top=y,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=r.Ay.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),v.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),c.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(d.LOADED_DATA,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(d.PLAY,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),v.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(d.PLAY,this.playFunc),this.off(d.CANPLAY,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(r.Ay.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.media&&(e&&""!==e&&("Array"!==r.Ay.typeOf(e)||0!==e.length)||(e="",this.emit(d.URL_NULL),b.A.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){r.Ay.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===r.Ay.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e),"Number"===r.Ay.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var o=this.media.readyState;b.A.logInfo("_startInit readyState",o),this.config.autoplay&&(!r.Ay.isMSE(this.media)&&this.load(),(c.os.isIpad||c.os.isPhone)&&this.mediaPlay());var s=this.config.startTime;this.__startTime=s>0?s:-1,this.config.startTime=0,o>=2&&this.duration>0?this.canPlayFunc():this.on(d.CANPLAY,this.canPlayFunc),(!this.hasStart||this.state<z.ATTACHED)&&O.afterInit(this),this.hasStart=!0,this.setState(z.ATTACHED),r.Ay.setTimeout(this,(function(){t.emit(d.COMPLETE)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var i=this.config.ignores||[],n=this.config.plugins||[],o=this.config.i18n||[];t&&V.extend(o,this.__i18n);var s=i.join("||").toLowerCase().split("||"),r=this.plugins;n.forEach((function(i){try{var n=i.plugin?i.plugin.pluginName:i.pluginName;if(n&&s.indexOf(n.toLowerCase())>-1)return null;if(!t&&r[n.toLowerCase()])return;if(i.lazy&&i.loader){var o=O.lazyRegister(e,i);return void(i.forceBeforeInit&&(o.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(o),1)})).catch((function(t){b.A.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(o),1)})),e._loadingPlugins.push(o)))}return e.registerPlugin(i)}catch(e){b.A.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var i,o,s=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),r=s.plugins,a=void 0===r?[]:r,l=s.ignores,u=void 0===l?[]:l,c=s.icons,h=void 0===c?{}:c,d=s.i18n,f=void 0===d?[]:d;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(i=e.config.plugins).push.apply(i,(0,n.Og)(a)),(o=e.config.ignores).push.apply(o,(0,n.Og)(u)),Object.keys(h).map((function(t){e.config.icons[t]||(e.config.icons[t]=h[t])}));var p=e.config.i18n||[];f.push.apply(f,(0,n.Og)(p)),e.config.i18n=f}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case C.ROOT_RIGHT:this.rightBar||(this.rightBar=r.Ay.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case C.ROOT_LEFT:this.leftBar||(this.leftBar=r.Ay.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case C.ROOT_TOP:this.topBar||(this.topBar=r.Ay.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&r.Ay.addClass(this.topBar,L.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=O.formatPluginInfo(e,t),n=i.PLUFGIN,o=i.options,s=this.config.plugins;!O.checkPluginIfExits(n.pluginName,s)&&s.push(n);var r=O.getRootByConfig(n.pluginName,this.config);r.root&&(o.root=r.root),r.position&&(o.position=r.position);var a,l=o.position?o.position:o.config&&o.config.position||n.defaultConfig&&n.defaultConfig.position;return!o.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(a=this.controls)||void 0===a?void 0:a.registerPlugin(n,o,n.pluginName):(o.root||(o.root=this._getRootByPosition(l)),O.register(this,n,o))}},{key:"deregister",value:function(e){"string"==typeof e?O.unRegister(this,e):e instanceof k.Ay&&O.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof k.Ay&&(t=e.pluginName),t)for(var i=this.config.plugins.length-1;i>-1;i--)if(this.config.plugins[i].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(i,1);break}}},{key:"plugins",get:function(){return O.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=O.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(r.Ay.hasClass(this.root,e)||r.Ay.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&r.Ay.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return r.Ay.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>z.ATTACHING)){var i=this._playSessionId;return r.Ay.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(z.ATTACHING),this._registerPlugins(!1),O.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url,{playSessionId:i})}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",b.A.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===r.Ay.typeOf(e)&&(n=e.url),n=this.preProcessUrl(n).url;var o=this.currentTime;this.__startTime=o;var s=this.paused&&!this.isError;return this.src=n,new Promise((function(e,t){var o=function(e){i.off("timeupdate",r),i.off("canplay",r),t(e)},r=function(){i._seekToStartTime(),s&&i.pause(),i.off("error",o),e(!0)};i.once("error",o),n?(c.os.isAndroid?i.once("timeupdate",r):i.once("canplay",r),i.play()):i.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<z.ATTACHED)return this.removeClass(L.NO_START),this.addClass(L.ENTER),this.start(),void(this._useAutoplay=!0);this.state<z.RUNNING&&(this.removeClass(L.NO_START),!this.isCanplay&&this.addClass(L.ENTER));var t=(0,n.Jt)((0,n.U6)(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(L.NOT_ALLOW_AUTOPLAY),e.addClass(L.PLAYING),e.state<z.RUNNING&&(b.A.logInfo(">>>>playPromise.then"),e.setState(z.RUNNING),e.emit(d.AUTOPLAY_STARTED))})).catch((function(t){if(b.A.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(L.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=r.Ay.setTimeout(e,(function(){e._errorTimer=null,e.emit(d.AUTOPLAY_PREVENTED),e.addClass(L.NOT_ALLOW_AUTOPLAY),e.removeClass(L.ENTER),e.pause(),e.setState(z.NOTALLOW)}),0))})):(b.A.logWarn("video.play not return promise"),this.state<z.RUNNING&&(this.setState(z.RUNNING),this.removeClass(L.NOT_ALLOW_AUTOPLAY),this.removeClass(L.NO_START),this.removeClass(L.ENTER),this.addClass(L.PLAYING),this.emit(d.AUTOPLAY_STARTED))),t}},{key:"mediaPause",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(L.PAUSED),(0,N.Eu)(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;(0,N.Eu)(this,"pause",(function(){(0,n.Jt)((0,n.U6)(i.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var i=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var n=this.config,o=n.isSeekedPlay,s=n.seekedStatus,r=t||(o?"play":s);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(d.SEEKED,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(L.ENTER),i.isSeeking=!1,r){case"play":i.play();break;case"pause":i.pause();break;default:i._isPauseBeforeSeek>1||i.paused?i.pause():i.play()}i._isPauseBeforeSeek=0,i._onceSeekCanplay=null},this.once(d.SEEKED,this._onceSeekCanplay),this.state<z.RUNNING?(this.removeClass(L.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,i=t.definition;!t.url&&i&&i.list&&i.list.length>0&&i.defaultDefinition&&i.list.map((function(t){t.definition===i.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var i=this,o=this.config.definition;if(Array.isArray(null==o?void 0:o.list)&&o.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(i.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(d.DEFINITION_CHANGE,{from:t,to:e}),this.hasStart){var s=this.switchURL(e.url,(0,n.T1)({seamless:!1!==o.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));s&&s.then?s.then((function(){i.emit(d.AFTER_DEFINITION_CHANGE,{from:t,to:e})})):this.emit(d.AFTER_DEFINITION_CHANGE,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(d.LOADED_DATA,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[L.NOT_ALLOW_AUTOPLAY,L.PLAYING,L.NO_START,L.PAUSED,L.REPLAY,L.ENTER,L.ENDED,L.ERROR,L.LOADING];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(L.NO_START),this.emit(d.RESET)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var n=D();Object.keys(this.config).forEach((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e,t=this,o=this.innerContainer,s=this.root,a=this.media;if(s&&a){if(this.hasStart=!1,this._useAutoplay=!1,s.removeAttribute(_),a.removeAttribute(_),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),r.Ay.clearAllTimers(this),this.emit(d.DESTROY),null===(e=$)||void 0===e||e.remove(this),O.destroy(this),(0,N.Vj)(this),(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),o)for(var l=o.children,u=0;u<l.length;u++)o.removeChild(l[u]);!o&&a instanceof window.Node&&s.contains(a)&&!this.config.remainMediaAfterDestroy&&s.removeChild(a),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&s.removeChild(t[e]),t[e]=null}));var c=s.className.split(" ");c.length>0?s.className=c.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):s.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(L.ENDED),this.currentTime=0,this.isSeeking=!1,(0,N.Eu)(this,"replay",(function(){e.once(d.SEEKED,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(d.REPLAY),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(L.ERROR),this.addClass(L.LOADING),(0,N.Eu)(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=r.Ay.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(d.CANPLAY,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=L.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=r.Ay.filterStyleFromText(e)),r.Ay.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=r.Ay.filterStyleFromText(t),r.Ay.addClass(t,n),t.setAttribute(_,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=L.PARENT_FULLSCREEN),this._orgCss&&(r.Ay.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),r.Ay.removeClass(e,i),t&&t!==e&&this._orgPCss&&(r.Ay.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",r.Ay.removeClass(t,n),t.removeAttribute(_))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:r.Ay.scrollTop(),left:r.Ay.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",r.Ay.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<m.length;n++){var o=m[n];if(e[o]){var s="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return s&&s.then?s:Promise.resolve()}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||r.Ay.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<y.length;i++){var n=y[i];if(document[n]){var o=document[n]();return o&&o.then?o:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(e){return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var t=e?"".concat(L.INNER_FULLSCREEN," ").concat(L.CSS_FULLSCREEN):L.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i;(!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(this.fullscreen=!0,this.emit(d.FULLSCREEN_CHANGE,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(d.CSS_FULLSCREEN_CHANGE,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(L.INNER_FULLSCREEN," ").concat(L.CSS_FULLSCREEN):L.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,i=void 0===t?{}:t;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(d.FULLSCREEN_CHANGE,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(d.CSS_FULLSCREEN_CHANGE,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(L.INNER_FULLSCREEN," ").concat(L.ROTATE_FULLSCREEN):L.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,L.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style");var i=90===Math.abs(window.orientation)||90===Math.abs(screen.orientation.angle);this.root.style.width="".concat(i?window.innerWidth:window.innerHeight,"px"),this.emit(d.FULLSCREEN_CHANGE,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(L.INNER_FULLSCREEN," ").concat(L.ROTATE_FULLSCREEN):L.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,L.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(d.FULLSCREEN_CHANGE,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(d.PLAYER_FOCUS,(0,n.T1)({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?(this._clearUserTimer(),this.emit(d.PLAYER_BLUR,(0,n.T1)({paused:this.paused,ended:this.ended},e))):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},i=this.innerStates;if(this.isActive=!0,this.removeClass(L.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=r.Ay.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||i||!this.paused&&!this.ended)&&this.addClass(L.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(L.ENTER),this.removeClass(L.ERROR),this.removeClass(L.LOADING),this.isCanplay=!0,this.waitTimer&&r.Ay.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(d.DURATION_CHANGE,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(L.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===z.ENDED&&this.setState(z.RUNNING),this.removeClass(L.PAUSED),this.ended&&this.removeClass(L.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(L.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(L.ENDED),this.setState(z.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(L.NOT_ALLOW_AUTOPLAY),this.removeClass(L.NO_START),this.removeClass(L.ENTER),this.removeClass(L.LOADING),this.addClass(L.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(L.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&r.Ay.clearTimeout(this,this.waitTimer),this.removeClass(L.LOADING),this.removeClass(L.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&r.Ay.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=r.Ay.setTimeout(this,(function(){e.addClass(L.LOADING),e.emit(d.LOADING),r.Ay.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[L.NO_START,L.PAUSED,L.ENDED,L.ERROR,L.REPLAY,L.LOADING].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(L.LOADING))&&this.media.readyState>2&&(this.removeClass(L.LOADING),r.Ay.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===z.NOTALLOW&&this.duration&&(this.setState(z.RUNNING),this.emit(d.AUTOPLAY_STARTED)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===r.Ay.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,i){if(this.media&&t&&e){var o="String"===r.Ay.typeOf(e)?e:e.type||"";i.props&&"Array"!==r.Ay.typeOf(i.props)&&(i.props=[i.props]),this.emit(d.USER_ACTION,(0,n.T1)({eventType:o,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},i))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,n=void 0===i?0:i,o=t.endDiff,s=void 0===o?0:o,r=this.media.buffered;if(!r||0===r.length||!this.duration)return!0;for(var a=e||this.media.currentTime||.2,l=r.length,u=0;u<l;u++)if(r.start(u)+n<=a&&r.end(u)-s>a)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,t=this.videoPos,i=t.vy,n=t.vx,o=t.h,s=t.w,a=this.videoPos.rotate;if(!(a<0&&o<0&&s<0)){var l=this.videoPos._pi;if(!l&&this.media.videoHeight&&(l=this.media.videoWidth/this.media.videoHeight*100),l){this.videoPos.pi=l;var u={rotate:a=a<0?0:a},c=0,h=0,d=1,f=Math.abs(a/90),p=this.root,g=this.innerContainer,v=p.offsetWidth,m=g?g.offsetHeight:p.offsetHeight,y={},_=m,k=v;if(f%2==0)d=o>0?100/o:s>0?100/s:1,u.scale=d,c=i>0?(100-o)/2-i:0,u.y=2===f?0-c:c,h=n>0?(100-s)/2-n:0,u.x=2===f?0-h:h,y.width="".concat(k,"px"),y.height="".concat(_,"px"),y.maxWidth="",y.maxHeight="";else if(f%2==1){_=v;var T=m-v;h=-T/2/(k=m)*100,u.x=3===f?h+i/2:h-i/2,c=T/2/_*100,u.y=3===f?c+n/2:c-n/2,u.scale=d,y.width="".concat(k,"px"),y.maxWidth="".concat(k,"px"),y.height="".concat(_,"px"),y.maxHeight="".concat(_,"px")}var E=r.Ay.getTransformStyle(u,this.media.style.transform||this.media.style.webkitTransform);y.transform=E,y.webkitTransform=E,Object.keys(y).map((function(t){e.media.style[t]=y[t]}))}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){if("plugins"!==i){t.config[i]=e[i];var n=t.plugins[i.toLowerCase()];n&&"Function"===r.Ay.typeOf(n.setConfig)&&n.setConfig(e[i])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,(0,N.Eu)(this,"playnext",(function(){t.start(),t.emit(d.PLAYNEXT,e)}))}},{key:"resize",value:function(){var e=this;if(this.media&&this.root){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var i=this.media,n=i.videoWidth,o=i.videoHeight,s=this.config,r=s.fitVideoSize,a=s.videoFillMode;if("fill"!==a&&"cover"!==a&&"contain"!==a||this.setAttribute("data-xgfill",a),o&&n){this._videoHeight=o,this._videoWidth=n;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,c=t.height-l,h=parseInt(n/o*1e3,10),f=parseInt(u/c*1e3,10),p=u,g=c,v={};"auto"===r&&f>h||"fixWidth"===r?(g=u/h*1e3,this.config.fluid?v.paddingTop="".concat(100*g/p,"%"):v.height="".concat(g+l,"px")):("auto"===r&&f<h||"fixHeight"===r)&&(p=h*c/1e3,v.width="".concat(p,"px")),this.fullscreen||this.cssfullscreen||Object.keys(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===a&&f<h||"fillWidth"===a&&f>h)&&this.setAttribute("data-xgfill","cover");var m={videoScale:h,vWidth:p,vHeight:g,cWidth:p,cHeight:g+l};this.resizePosition(),this.emit(d.VIDEO_RESIZE,m)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(e,t):this.media.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){b.A.logInfo("setState","state from:".concat(G[this.state]," to:").concat(G[e])),this._state=e}},{key:"preProcessUrl",value:function(e,t){var i=this.config,n=i.preProcessUrl,o=i.preProcessUrlOptions,s=Object.assign({},o,t);return r.Ay.isBlob(e)||"function"!=typeof n?{url:e}:n(e,s)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(z.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===z.RUNNING||this._state===z.ENDED},set:function(e){e?this.setState(z.RUNNING):this._state>=z.RUNNING&&this.setState(z.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,i=this.config.definition,n=null,o=null;i.list=e,this.emit("resourceReady",e),e.forEach((function(e){var s;(null===(s=t.curDefinition)||void 0===s?void 0:s.definition)===e.definition&&(n=e),i.defaultDefinition===e.definition&&(o=e)})),!o&&e.length>0&&(o=e[0]),n?this.changeDefinition(n):o&&this.changeDefinition(o)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==V.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,O.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(V.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return W.A}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return(0,n.Jt)((0,n.U6)(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=(0,n.Jt)((0,n.U6)(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return(0,n.Jt)((0,n.U6)(i.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,i=e.t;return i?(new Date).getTime()-i+t:t}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=r.Ay.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Z},set:function(e){Z=e}},{key:"realTimeSpeed",get:function(){return J},set:function(e){J=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,t){return N.A_.call.apply(N.A_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return N.uQ.call.apply(N.uQ,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return N.j.call.apply(N.j,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,i){for(var n=arguments.length,o=new Array(n>3?n-3:0),s=3;s<n;s++)o[s-3]=arguments[s];return N.tC.call.apply(N.tC,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,i){for(var n=arguments.length,o=new Array(n>3?n-3:0),s=3;s<n;s++)o[s-3]=arguments[s];return N.oq.call.apply(N.oq,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),r.Ay.typeOf(t)===Boolean&&(this.muted=t)),null===(i=$)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return b.A.config.debug},set:function(e){b.A.config.debug=e}},{key:"instManager",get:function(){return $},set:function(e){$=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=$)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=$)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return c.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return c.probeConfigSupported(e)}},{key:"install",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=t)}},{key:"use",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]=t}}]),i}(p);function ee(e,t,i){try{return' <div class="xg-tips '.concat(i?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(e){return'<div class="xg-tips hide"></div>'}}(0,n.n8)(Q,"defaultPreset",null),(0,n.n8)(Q,"XgVideoProxy",null),Q.instManager=X.getInstance();var te=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),(0,n.n8)((0,n.V5)(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(I);function ie(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ne(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var oe=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(d.CSS_FULLSCREEN_CHANGE,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,i=this.find(".xg-tips");i&&this.changeLangTextKey(i,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:ie,class:"xg-get-cssfull"},exitCssFullscreen:{icon:ne,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(ee(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(te);function se(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var re=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:se,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){r.Ay.addClass(this.root,"show")}},{key:"hide",value:function(){r.Ay.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:C.ROOT_TOP,index:0}}}]),i}(I);function ae(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function le(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var ue=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.player.setRotateDeg(0):e.player.setRotateDeg(90))})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this);var t=this.config,o=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var s=r.Ay.getFullScreenEl();o.fullscreenTarget===s&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var i=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:i,to:!i})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(d.FULLSCREEN_CHANGE,(function(t){var i=e.find(".xg-tips");i&&e.changeLangTextKey(i,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:re,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===c.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:ae,class:"xg-get-fullscreen"},exitFullscreen:{icon:le,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===c.device?"touchend":"click",this.handleFullscreen),"mobile"===c.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e instanceof Event&&(e.preventDefault(),e.stopPropagation());var t=this.player,i=this.config;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):i.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):i.switchCallback&&"function"==typeof i.switchCallback?i.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(ee(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(e){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(te);function ce(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function he(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var de=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=(0,n.V5)(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([d.PLAY,d.PAUSE,d.ERROR,d.EMPTIED],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:ce,class:"xg-icon-play"},pause:{icon:he,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,i=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),i&&this.changeLangTextKey(i,t.PLAY_TIPS)):(this.setAttr("data-state","play"),i&&this.changeLangTextKey(i,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(ee(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_LEFT,index:0,disable:!1}}}]),i}(te),fe=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],pe=function(){function e(t){(0,n.xs)(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return(0,n.j6)(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var i=0,n=this.fragments;this.fragments=n.map((function(e){return e.start=parseInt(i,10),e.end=parseInt(i+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),i+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},i=this.progressList,n=this.fragments;if(!(i.length<1)){var o=t.newIndex,s=t.curIndex,r=t.millisecond;o!==s&&i.map((function(t,i){i<o?t[e].style.width="100%":i>o&&(t[e].style.width=0)}));var a=n[o],l=0===r?0:(r-a.start)/a.duration;i[o][e].style.width=l<0?0:"".concat(100*l,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var i={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(i)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var i=this.playedIndex,n=this.cachedIndex;if("Undefined"!==r.Ay.typeOf(e.played)){var o=this.findIndex(1e3*e.played,i);if(o<0)return;this.updateProgress("played",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=o}if("Undefined"!==r.Ay.typeOf(e.cached)){var s=this.findIndex(1e3*e.cached,n);if(s<0)return;this.updateProgress("cached",{newIndex:s,curIndex:n,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=s}}},{key:"findIndex",value:function(e,t){var i=this.fragments;if(!i||0===i.length)return-1;if(1===i.length)return 0;if(t>-1&&t<i.length&&e>i[t].start&&e<i[t].end)return t;if(e>i[i.length-1].start)return i.length-1;for(var n=0;n<i.length;n++)if(e>i[n].start&&e<=i[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(r.Ay.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)r.Ay.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return r.Ay.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(i){void 0!==e[i]&&(t.fragConfig[i]=e[i])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var i=this.root.children;i.length>0;)this.root.removeChild(i[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=r.Ay.createDom("xg-inners","",{},"progress-list")),this.fragments){var i=this.fragConfig,n=i.fragClass,o=i.fragFocusClass;this.progressList=this.fragments.map((function(i){var s=r.Ay.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(i.percent):"flex: ".concat(i.percent)},"".concat(i.isFocus?o:""," xgplayer-progress-inner ").concat(n));return e.root.appendChild(s),fe.forEach((function(t){s.appendChild(r.Ay.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:s.children[0],played:s.children[1]}}))}return this.root}}]),e}(),ge={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},ve=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"onMoveOnly",(function(e,t){var i=(0,n.V5)(o),s=i.pos,a=i.config,l=i.player,u=t;if(e){r.Ay.event(e);var c=r.Ay.getEventPos(e,l.zoom),h=90===l.rotateDeg?c.clientY:c.clientX;if(s.moving&&Math.abs(s.x-h)<a.miniMoveStep)return;s.moving=!0,s.x=h,u=o.computeTime(e,h)}o.triggerCallbacks("dragmove",u,e),o._updateInnerFocus(u)})),(0,n.n8)((0,n.V5)(o),"onBodyClick",(function(e){o.pos.isLocked&&(o.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),(0,n.n8)((0,n.V5)(o),"_mouseDownHandler",(function(e,t){o._state.time=t.currentTime,o.updateWidth(t.currentTime,t.seekTime,t.percent,0),o._updateInnerFocus(t)})),(0,n.n8)((0,n.V5)(o),"_mouseUpHandler",(function(e,t){(0,n.V5)(o).pos.moving&&o.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),(0,n.n8)((0,n.V5)(o),"_mouseMoveHandler",(function(e,t){var i=(0,n.V5)(o),s=i._state,r=i.pos,a=i.config,l=i.player;s.time<t.currentTime?t.forward=!0:t.forward=!1,s.time=t.currentTime,r.isDown&&!r.moving&&(r.moving=!0,a.isPauseMoving&&l.pause(),o.triggerCallbacks("dragstart",t,e),o.emitUserAction("drag","dragstart",t)),o.updateWidth(t.currentTime,t.seekTime,t.percent,1),o.triggerCallbacks("dragmove",t,e),o._updateInnerFocus(t)})),(0,n.n8)((0,n.V5)(o),"onMouseDown",(function(e){var t=(0,n.V5)(o),i=t._state,s=t.player,a=t.pos,l=t.config,u=t.playerConfig,c=r.Ay.getEventPos(e,s.zoom),h=90===s.rotateDeg?c.clientY:c.clientX;if(!(s.isMini||l.closeMoveSeek||!u.allowSeekAfterEnded&&s.ended)){if(s.duration||s.isPlaying){e.stopPropagation(),o.focus(),r.Ay.checkIsFunction(u.disableSwipeHandler)&&u.disableSwipeHandler(),r.Ay.checkIsFunction(l.onMoveStart)&&l.onMoveStart(),r.Ay.event(e),a.x=h,a.isDown=!0,a.moving=!1,i.prePlayTime=s.currentTime,s.focus({autoHide:!1}),o.isProgressMoving=!0,r.Ay.addClass(o.progressBtn,"active");var d=o.computeTime(e,h);return d.prePlayTime=i.prePlayTime,o._mouseDownHandlerHook(e,d),"touchstart"===e.type?(o.root.addEventListener("touchmove",o.onMouseMove),o.root.addEventListener("touchend",o.onMouseUp),o.root.addEventListener("touchcancel",o.onMouseUp)):(o.unbind("mousemove",o.onMoveOnly),document.addEventListener("mousemove",o.onMouseMove,!1),document.addEventListener("mouseup",o.onMouseUp,!1)),!0}s.play()}})),(0,n.n8)((0,n.V5)(o),"onMouseUp",(function(e){var t=(0,n.V5)(o),i=t.player,s=t.config,a=t.pos,l=t.playerConfig,u=t._state;if(a){e.stopPropagation(),e.preventDefault(),r.Ay.checkIsFunction(l.enableSwipeHandler)&&l.enableSwipeHandler(),r.Ay.checkIsFunction(s.onMoveEnd)&&s.onMoveEnd(),r.Ay.event(e),r.Ay.removeClass(o.progressBtn,"active");var c=o.computeTime(e,a.x);c.prePlayTime=u.prePlayTime,a.moving?(o.triggerCallbacks("dragend",c,e),o.emitUserAction("drag","dragend",c)):(o.triggerCallbacks("click",c,e),o.emitUserAction("click","click",c)),o._mouseUpHandlerHook(e,c),a.moving=!1,a.isDown=!1,a.x=0,a.y=0,a.isLocked=!0,u.prePlayTime=0,u.time=0;var h=e.type;"touchend"===h||"touchcancel"===h?(o.root.removeEventListener("touchmove",o.onMouseMove),o.root.removeEventListener("touchend",o.onMouseUp),o.root.removeEventListener("touchcancel",o.onMouseUp),o.blur()):(document.removeEventListener("mousemove",o.onMouseMove,!1),document.removeEventListener("mouseup",o.onMouseUp,!1),a.isEnter?"mobile"!==l.isMobileSimulateMode&&o.bind("mousemove",o.onMoveOnly):o.onMouseLeave(e)),r.Ay.setTimeout((0,n.V5)(o),(function(){o.resetSeekState()}),1),i.focus()}})),(0,n.n8)((0,n.V5)(o),"onMouseMove",(function(e){var t=(0,n.V5)(o),i=t._state,s=t.pos,a=t.player,l=t.config;r.Ay.checkTouchSupport()&&e.preventDefault(),r.Ay.event(e);var u=r.Ay.getEventPos(e,a.zoom),c=90===a.rotateDeg?u.clientY:u.clientX,h=Math.abs(s.x-c);if(!(s.moving&&h<l.miniMoveStep||!s.moving&&h<l.miniStartStep)){s.x=c;var d=o.computeTime(e,c);d.prePlayTime=i.prePlayTime,o._mouseMoveHandlerHook(e,d)}})),(0,n.n8)((0,n.V5)(o),"onMouseOut",(function(e){o.triggerCallbacks("mouseout",null,e)})),(0,n.n8)((0,n.V5)(o),"onMouseOver",(function(e){o.triggerCallbacks("mouseover",null,e)})),(0,n.n8)((0,n.V5)(o),"onMouseEnter",(function(e){var t=(0,n.V5)(o),i=t.player,s=t.pos;if(!(s.isDown||s.isEnter||i.isMini||!i.config.allowSeekAfterEnded&&i.ended)){s.isEnter=!0,o.bind("mousemove",o.onMoveOnly),o.bind("mouseleave",o.onMouseLeave),r.Ay.event(e);var a=r.Ay.getEventPos(e,i.zoom),l=90===i.rotateDeg?a.clientY:a.clientX,u=o.computeTime(e,l);o.triggerCallbacks("mouseenter",u,e),o.focus()}})),(0,n.n8)((0,n.V5)(o),"onMouseLeave",(function(e){o.triggerCallbacks("mouseleave",null,e),o.unlock(),o._updateInnerFocus(null)})),(0,n.n8)((0,n.V5)(o),"onVideoResize",(function(){var e=o.pos,t=e.x,i=e.isDown;if(e.isEnter&&!i){var n=o.computeTime(null,t);o.onMoveOnly(null,n)}})),o.useable=!1,o.isProgressMoving=!1,o.__dragCallBacks=[],o._state={now:-1,direc:0,time:0,prePlayTime:-1},o._disableBlur=!1,"boolean"==typeof o.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),o.config.isDraggingSeek=o.config.isDragingSeek),o}return(0,n.j6)(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i+this.timeOffset}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var o=(0,n.T1)((0,n.T1)({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(o):(this.innerList=new pe(o),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===c.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(d.DURATION_CHANGE,(function(){e.onMouseLeave()})),this.on(d.TIME_UPDATE,(function(){e.onTimeupdate()})),this.on(d.SEEKED,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(d.PROGRESS,(function(){e.onCacheUpdate()})),this.on(d.ENDED,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(d.EMPTIED,(function(){e.onReset()})),this.on(d.VIDEO_RESIZE,(function(){e.onVideoResize()}))}},{key:"setConfig",value:function(e){var t=this,i=null;Object.keys(e).forEach((function(n){t.config[n]=e[n],"fragments"===n&&(i=e[n])})),i&&this._initInner(i,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===(0,n.uk)(e)&&Object.keys(e).map((function(i){t.style[i]=e[i]})))}},{key:"triggerCallbacks",value:function(e,t,i){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,i)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),e)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var i=this.__dragCallBacks,n=-1;i.map((function(i,o){i&&i.type===e&&i.handler===t&&(n=o)})),n>-1&&i.splice(n,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,t.isLocked=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||this.root.addEventListener("touchstart",this.onMouseDown),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),r.Ay.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),r.Ay.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,i,n){var o=this.config,s=this.player;if(!o.isCloseClickSeek||0!==n){var r=t=t>=s.duration?s.duration-o.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==n||o.isDraggingSeek&&"audio"!==s.config.mediaType)&&(this._state.now=r,this._state.direc=r>s.currentTime?0:1,s.seek(r))}}},{key:"computeTime",value:function(e,t){var i,n,o=this.player,s=this.root.getBoundingClientRect(),a=s.width,l=s.height,u=s.top,c=s.left,h=t;90===o.rotateDeg?(i=l,n=u):(i=a,n=c);var d=h-n,f=(d=d>i?i:d<0?0:d)/i;f=f<0?0:f>1?1:f,Number.isNaN(f)&&(f=this.player.currentTime/this.offsetDuration);var p=parseInt(f*this.offsetDuration*1e3,10)/1e3;return{percent:f,currentTime:p,seekTime:r.Ay.getCurrentTimeByOffset(p,o.timeSegments),offset:d,width:i,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,i=this.duration;e>i?e=i:e<0&&(e=0);var n=t.plugins.time;n&&n.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var i=this.player.plugins.miniprogress;i&&i.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,i=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(i.now>-1){var o=parseInt(1e3*i.now,10)-parseInt(1e3*t.currentTime,10);if(0===i.direc&&o>300||1===i.direc&&o>-300)return void(i.now=-1);i.now=-1}var s=this.currentTime;s=r.Ay.adjustTimeByDuration(s,n,e),this.innerList.update({played:s},n),this.progressBtn.style.left="".concat(s/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=r.Ay.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:ge.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return ge}}]),i}(I),me=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).isActiving=!1,o}return(0,n.j6)(i,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,i=e.duration;return this.playerConfig.customDuration||t||i}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this.player.controls.config.mode;this.mode="flex"===e?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([d.DURATION_CHANGE,d.SEEKED,d.TIME_UPDATE],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(d.ENDED,(function(){e.onTimeUpdate(!0)})),this.on(d.EMPTIED,(function(){e.onReset()}))}},{key:"show",value:function(e){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="block"),void(this.centerDurDom&&(this.centerDurDom.style.display="block"));this.root.style.display="block"}},{key:"hide",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="none"),void(this.centerDurDom&&(this.centerDurDom.style.display="none"));this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var t=this.player,i=this.config,n=this.duration;if(!i.disable&&!this.isActiving&&t.hasStart){var o=this.currentTime+this.timeOffset;o=r.Ay.adjustTimeByDuration(o,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(r.Ay.format(o)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=r.Ay.format(n))):(this.timeDom.innerHTML=this.minWidthTime(r.Ay.format(o)),n!==1/0&&n>0&&(this.durationDom.innerHTML=r.Ay.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(r.Ay.format(0)),this.centerDurDom.innerHTML=r.Ay.format(0)):(this.timeDom.innerHTML=this.minWidthTime(r.Ay.format(0)),this.durationDom.innerHTML=r.Ay.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=r.Ay.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=r.Ay.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom),this.extraEls=[this.centerCurDom,this.centerDurDom]}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(r.Ay.hide(this.durationDom),r.Ay.hide(this.timeDom),r.Ay.hide(this.find(".time-separator")),r.Ay.show(this.find(".time-live-tag"))):r.Ay.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(r.Ay.hide(this.durationDom),r.Ay.hide(this.timeDom),r.Ay.hide(this.find(".time-separator")),r.Ay.show(this.find(".time-live-tag"))):(r.Ay.hide(this.find(".time-live-tag")),r.Ay.show(this.find(".time-separator")),r.Ay.show(this.durationDom),r.Ay.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=this.minWidthTime(r.Ay.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(r.Ay.format(e)))}},{key:"minWidthTime",value:function(e){return e.split(":").map((function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,i=function(){e.isActiving=!1};this.off(d.SEEKED,i),t.isSeeking&&t.media.seeking?this.once(d.SEEKED,i):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(I);function ye(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function _e(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ke(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Te=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onBarMousedown",(function(t){var i=(0,n.V5)(e).player,o=e.find(".xgplayer-bar");r.Ay.event(t);var s=o.getBoundingClientRect(),a=r.Ay.getEventPos(t,i.zoom),l=s.height-(a.clientY-s.top);if(a.h=l,a.barH=s.height,e.pos=a,!(l<-2))return e.updateVolumePos(l,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),(0,n.n8)((0,n.V5)(e),"onBarMouseMove",(function(t){var i=(0,n.V5)(e)._d;if(i.isStart){var o=(0,n.V5)(e),s=o.pos,a=o.player;t.preventDefault(),t.stopPropagation(),r.Ay.event(t);var l=r.Ay.getEventPos(t,a.zoom);i.isMoving=!0;var u=s.h-l.clientY+s.clientY;u>s.barH||e.updateVolumePos(u,t)}})),(0,n.n8)((0,n.V5)(e),"onBarMouseUp",(function(t){r.Ay.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=(0,n.V5)(e)._d;i.isStart=!1,i.isMoving=!1})),(0,n.n8)((0,n.V5)(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),(0,n.n8)((0,n.V5)(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),(0,n.n8)((0,n.V5)(e),"onVolumeChange",(function(t){if(e.player){var i=e.player,n=i.muted,o=i.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=n||0===o?"4px":"".concat(100*o,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(n,o)}})),e}return(0,n.j6)(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:_e,class:"xg-volume-small"},volumeLarge:{icon:ye,class:"xg-volume"},volumeMuted:{icon:ke,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,i=t.commonStyle,n=t.volume;i.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=i.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==c.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(d.VOLUME_CHANGE,this.onVolumeChange),this.once(d.LOADED_DATA,this.onVolumeChange),"Number"!==r.Ay.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var i=this.player,n=this.find(".xgplayer-drag"),o=this.find(".xgplayer-bar");if(o&&n){var s=parseInt(e/o.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var r=Math.max(Math.min(s/1e3,1),0),a={volume:{from:i.volume,to:r}};i.muted&&(a.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:a}),i.volume=Math.max(Math.min(s/1e3,1),0),i.muted&&(i.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,i=e.muted,n=this.find(".xgplayer-value-label"),o=Math.max(Math.min(t,1),0);n.innerText=i?0:Math.round(100*o)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(r.Ay.clearTimeout(this,this._timerId),this._timerId=null),r.Ay.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=this._d,s=this.player;o.isActive||(this._timerId&&(r.Ay.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=r.Ay.setTimeout(this,(function(){o.isActive||(i?s.blur():s.focus(),r.Ay.removeClass(e.root,"slide-show"),o.isStart&&e.onBarMouseUp(n)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(r.Ay.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===c.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}(I);function Ee(){return(new Date).getTime()}var be="waitingStart",Ae=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(b.A.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),(0,n.n8)((0,n.V5)(e),"_onAutoplayStart",(function(){b.A.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),(0,n.n8)((0,n.V5)(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=Ee(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&r.Ay.clearTimeout((0,n.V5)(e),e._waitTimer),e._waittTimer&&r.Ay.clearTimeout((0,n.V5)(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),(0,n.n8)((0,n.V5)(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=Ee(),e.emitLog("seekStart",{start:Ee()}))})),(0,n.n8)((0,n.V5)(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),(0,n.n8)((0,n.V5)(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=Ee(),e.fixedWaitingStart=Ee(),e._waitType=1,e.emitLog(be,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),(0,n.n8)((0,n.V5)(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=Ee(),e._waitTimer=r.Ay.setTimeout((0,n.V5)(e),(function(){e._isWaiting&&(e.waitingStart=Ee(),r.Ay.clearTimeout((0,n.V5)(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(be,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),(0,n.n8)((0,n.V5)(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),(0,n.n8)((0,n.V5)(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=Ee(),this.loadedCostTime=0,this.startCostTime=0,this.on(d.LOAD_START,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=Ee()-e.newPointTime,b.A.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(i," isFFSend:").concat(n," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),n||(!t.isLs&&e.emitLog("loadstart",{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=Ee(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(d.LOADED_DATA,(function(){e.vt=Ee(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,i=t.isTimeUpdate,n=t.isFFSend,o=t.autoplayStart;b.A.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(i||o)&&e._sendFF("loadedData"),n||e.emitLog("loadeddata",{}),e.suspendWaitingStatus("loadeddata")})),this.on(d.SEEKING,this._onSeeking),this.on(d.SEEKED,this._onSeeked),this.on(d.DESTROY,(function(){e.endState("destroy")})),this.on(d.URL_CHANGE,(function(){e.endState("urlChange"),b.A.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([d.PLAYING,d.CANPLAY],this._onPlaying),this.on(d.WAITING,this._onWaiting),this.on(d.ERROR,this._onError),this.on(d.RESET,(function(){b.A.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(d.AUTOPLAY_STARTED,this._onAutoplayStart),this.off(d.TIME_UPDATE,this._onTimeupdate),this.once(d.AUTOPLAY_STARTED,this._onAutoplayStart),this.once(d.TIME_UPDATE,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=Ee();var t=this._state,i=t.isFFLoading,n=t.isFFSend;b.A.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(b.A.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog("firstFrame",{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&r.Ay.clearTimeout(this,this._waittTimer),this._waittTimer=r.Ay.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),r.Ay.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=Ee(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog("seekEnd",{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(r.Ay.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(r.Ay.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=Ee(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,o=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog("waitingEnd",{fixedCostTime:n>o?o:n,costTime:i>o?o:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var i=this.player;this.emit(d.XGLOG,(0,n.T1)({t:Ee(),host:r.Ay.getHostFromUrl(i.currentSrc),vtype:i.vtype,eventType:e,currentTime:this.player.currentTime,readyState:i.video.readyState,networkState:i.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),i}(I);function Ce(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Se=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"registerIcons",value:function(){return{replay:Ce}}},{key:"afterCreate",value:function(){var e=this;I.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(d.ENDED,(function(){if(e.playerConfig.loop||r.Ay.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var i=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof i&&i.indexOf("none")>-1)return null;t.setAttribute("transform",i)}}})),this.on(d.PLAY,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),r.Ay.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),i}(I),xe=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){r.Ay.addClass(this.root,"hide")}},{key:"show",value:function(e){r.Ay.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(d.ENDED,(function(){e.isEndedShow&&r.Ay.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(d.TIME_UPDATE,(function(){e.onTimeUpdate()})),this.on(d.URL_CHANGE,(function(){r.Ay.removeClass(e.root,"hide"),r.Ay.addClass(e.root,"xg-showplay"),e.once(d.TIME_UPDATE,(function(){e.onTimeUpdate()}))}))):this.on(d.PLAY,(function(){r.Ay.addClass(e.root,"hide")}))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}));var i=this.config.poster;this.update(i)}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?r.Ay.removeClass(this.root,"xg-showplay"):this.once(d.TIME_UPDATE,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"getBgSize",value:function(e){var t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;default:t=""}return t?"background-size: ".concat(t,";"):""}},{key:"render",value:function(){var e=this.config,t=e.poster,i=e.hideCanplay,n=e.fillMode,o=e.notHidden,s=this.getBgSize(n),r=t?"background-image:url(".concat(t,");").concat(s):s;return'<xg-poster class="xgplayer-poster '.concat(o?"xg-not-hidden":i?"xg-showplay":"",'" style="').concat(r,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),i}(I),we={};function Ie(e){e?window.clearTimeout(e):Object.keys(we).map((function(e){window.clearTimeout(we[e].id),delete we[e]}))}var Re=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"onPlayerReset",(function(){o.autoPlayStart=!1;var e="auto"===o.config.mode?"auto-hide":"hide";o.setAttr("data-state","play"),r.Ay.removeClass(o.root,e),o.show()})),(0,n.n8)((0,n.V5)(o),"onAutoplayStart",(function(){if(!o.autoPlayStart){var e="auto"===o.config.mode?"auto-hide":"hide";r.Ay.addClass(o.root,e),o.autoPlayStart=!0,o.toggleTo("play")}})),o.autoPlayStart=!1,o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(d.READY,(function(){i&&(i.lang&&"en"===i.lang?r.Ay.addClass(t.root,"lang-is-en"):"jp"===i.lang&&r.Ay.addClass(t.root,"lang-is-jp"))})),this.on(d.AUTOPLAY_STARTED,this.onAutoplayStart),this.on(d.AUTOPLAY_PREVENTED,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),r.Ay.removeClass(e.root,t),e.show()})),this.on(d.PLAY,(function(){e.toggleTo("play")})),this.on(d.PAUSE,(function(){e.toggleTo("pause")})),this.on(d.RESET,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var i=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:i,to:!i})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:ce,class:"xg-icon-play"},startPause:{icon:he,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){r.Ay.addClass(this.root,"hide")}},{key:"show",value:function(e){r.Ay.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){r.Ay.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){r.Ay.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return we[e]&&window.clearTimeout(we[e].id),we[e]={},i.start&&i.start(),we[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(we[e].id),delete we[e]}),t),we[e].id}("pauseplay",400,{start:function(){r.Ay.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){r.Ay.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){r.Ay.removeClass(this.root,"interact"),Ie(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<z.READY||(this.player.paused||t.state!==z.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<z.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&i.paused&&!i.ended||t.isShowEnd&&i.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||i.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Ie(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),i}(I),Pe=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=r.Ay.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var i="",n=1;n<=12;n++)i+='<div class="xgplayer-enter-bar'.concat(n,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(i,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),i}(I),Oe=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:10}}}]),i}(I);function Le(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var De=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Ne=De.length;function Me(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===(0,n.uk)(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<Ne;t++)e[De[t]]=0;return e}();var i={};i.width=e.offsetWidth,i.height=e.offsetHeight;for(var o=i.isBorderBox="border-box"===t.boxSizing,s=0;s<Ne;s++){var r=De[s],a=t[r],l=parseFloat(a);i[r]=Number.isNaN(l)?0:l}var u=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,h=i.marginLeft+i.marginRight,d=i.marginTop+i.marginBottom,f=i.borderLeftWidth+i.borderRightWidth,p=i.borderTopWidth+i.borderBottomWidth,g=o,v=Le(t.width);!1!==v&&(i.width=v+(g?0:u+f));var m=Le(t.height);return!1!==m&&(i.height=m+(g?0:c+p)),i.innerWidth=i.width-(u+f),i.innerHeight=i.height-(c+p),i.outerWidth=i.width+h,i.outerHeight=i.height+d,i}}function Fe(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var He={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Ue=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.xs)(this,i),(o=t.call(this)).isEnabled=!0,o.isDragging=!1,o.isDown=!1,o.position={},o.downPoint={},o.dragPoint={x:0,y:0},o.startPos={x:0,y:0},o._root=e instanceof Element?e:document.querySelector(e),o._handlerDom=s.handle instanceof Element?s.handle:document.querySelector(s.handle),o._root&&o._handlerDom?(o._bindStartEvent(),o):(0,n.GM)(o)}return(0,n.j6)(i,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),He[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var i=He[this._startKey];i.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=i}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=Fe(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Fe(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Fe(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var i=Me(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-i.height,this.startPos.maxX=window.innerWidth-i.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit("dragStart",this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit("dragEnded")),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var i={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this.dragRealStart(e,t),i}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var i=this.startPos,n=i.x,o=i.y,s=this._dragPointerMove(e,t),r=s.x,a=s.y;r=this.checkContain("x",r,n),a=this.checkContain("y",a,o),this.position.x=n+r,this.position.y=o+a,this.dragPoint.x=r,this.dragPoint.y=a,this.emit("dragMove",this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,i){return t+i<0?0-i:"x"===e&&t+i>this.startPos.maxX?this.startPos.maxX-i:"y"===e&&t+i>this.startPos.maxY?this.startPos.maxY-i:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),i=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(i)?0:i,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var i=t.split(","),n=0===t.indexOf("matrix3d")?12:4,o=parseInt(i[n],10),s=parseInt(i[n+1],10);this.position.x+=o,this.position.y+=s}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var i=Me(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(s()),je=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"onCancelClick",(function(e){o.exitMini(),o.isClose=!0})),(0,n.n8)((0,n.V5)(o),"onCenterClick",(function(e){var t=(0,n.V5)(o).player;t.paused?t.play():t.pause()})),(0,n.n8)((0,n.V5)(o),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-o.pos.scrollY)<50)){var t=parseInt(r.Ay.getCss(o.player.root,"height"));t+=o.config.scrollTop,o.pos.scrollY=window.scrollY,window.scrollY>t+5?!o.isMini&&!o.isClose&&o.getMini():window.scrollY<=t&&(o.isMini&&o.exitMini(),o.isClose=!1)}})),o.isMini=!1,o.isClose=!1;var s=(0,n.V5)(o).config;return o.pos={left:s.left<0?window.innerWidth-s.width-20:s.left,top:s.top<0?window.innerHeight-s.height-20:s.top,height:o.config.height,width:o.config.width,scrollY:window.scrollY||0},o.lastStyle=null,o}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(d.PAUSE,(function(){e.setAttr("data-state","pause")})),this.on(d.PLAY,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var i={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(Oe,i,Oe.pluginName)}var n=r.Ay.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Ue(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:ce,class:"xg-icon-play"},pause:{icon:he,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;this.lastStyle={},r.Ay.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=n.style[t],n.style[t]="".concat(e.pos[t],"px")})),i.fluid&&(n.style["padding-top"]=""),this.emit(d.MINI_STATE_CHANGE,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;r.Ay.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){n.style[t]=e.lastStyle[t]})),this.lastStyle=null,i.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*i.height/i.width,"%")),this.emit(d.MINI_STATE_CHANGE,!1),this.isMini=t.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=r.Ay.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(ee(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),i}(I),Be={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Ve=["videoClick","videoDbClick"],We=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onMouseMove",(function(t){var i=(0,n.V5)(e),o=i.player,s=i.playerConfig;o.isActive||(o.focus({autoHide:!s.closeDelayBlur}),!s.closeFocusVideoFocus&&o.media.focus())})),(0,n.n8)((0,n.V5)(e),"onMouseEnter",(function(t){var i=(0,n.V5)(e),o=i.playerConfig,s=i.player;!o.closeFocusVideoFocus&&s.media.focus(),o.closeDelayBlur?s.focus({autoHide:!1}):s.focus(),e.emit(d.ENTER_PLAYER)})),(0,n.n8)((0,n.V5)(e),"onMouseLeave",(function(t){var i=e.playerConfig,n=i.closePlayerBlur,o=i.leavePlayerTime,s=i.closeDelayBlur;n||s||(o?e.player.focus({autoHide:!0,delay:o}):e.player.blur({ignorePaused:!0})),e.emit(d.LEAVE_PLAYER)})),(0,n.n8)((0,n.V5)(e),"onVideoClick",(function(t){var i=(0,n.V5)(e),o=i.player,s=i.playerConfig;t.target&&s.closeVideoClick||t.target!==o.root&&t.target!==o.media&&t.target!==o.innerContainer&&t.target!==o.media.__canvas||(t.preventDefault(),s.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,(0,N.Eu)((0,n.V5)(e),Ve[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:o.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),(0,n.n8)((0,n.V5)(e),"onVideoDblClick",(function(t){var i=(0,n.V5)(e),o=i.player,s=i.playerConfig;s.closeVideoDblclick||!t.target||t.target!==o.media&&t.target!==o.media.__canvas||(!s.closeVideoClick&&e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),(0,N.Eu)((0,n.V5)(e),Ve[1],(function(t,i){e.emitUserAction(i.e,"switch_fullscreen",{props:"fullscreen",from:o.fullscreen,to:!o.fullscreen}),o.fullscreen?o.exitFullscreen():o.getFullscreen()}),{e:t,fullscreen:o.fullscreen})))})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Ve.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===c.device&&!c.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,i=t.media,n=t.root,o=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(Be).map((function(t){n.addEventListener(t,e[Be[t]],!1)})),!o&&i&&i.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,i=t.video,n=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),i.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(Be).map((function(t){n.removeEventListener(t,e[Be[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(k.Ay),ze="pressend",Ge={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Ke={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function Ye(e){return e&&e.length>0?e[e.length-1]:null}var Xe=function(){function e(t){var i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};(0,n.xs)(this,e),(0,n.n8)(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,o=Ye(e.touches);t.x=o?parseInt(o.pageX,10):e.pageX,t.y=o?parseInt(o.pageX,10):e.pageX,t.start=!0,i.__setPress(e),n.addEventListener(i.events.end,i.onTouchEnd),n.addEventListener(i.events.cancel,i.onTouchCancel),n.addEventListener(i.events.move,i.onTouchMove),i.trigger("touchstart",e)})),(0,n.n8)(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),(0,n.n8)(this,"onTouchEnd",(function(e){var t=i._pos,n=i.root;i.__clearPress(),n.removeEventListener(i.events.cancel,i.onTouchCancel),n.removeEventListener(i.events.end,i.onTouchEnd),n.removeEventListener(i.events.move,i.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&i.trigger(ze,e),i.trigger("touchend",e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),(0,n.n8)(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,o=Ye(e.touches),s=o?parseInt(o.pageX,10):e.pageX,r=o?parseInt(o.pageY,10):e.pageX,a=s-t.x,l=r-t.y;Math.abs(l)<n.miniStep&&Math.abs(a)<n.miniStep||(i.__clearPress(),t.press&&i.trigger(ze,e),t.press=!1,t.moving=!0,i.trigger("touchmove",e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(o).map((function(e){i.config[e]=o[e]})),this.root=t,this.events="mouse"===o.eventType?Ke:Ge,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return(0,n.j6)(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,i=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger("press",e),t._pos.press=!0,t.__clearPress()}),i.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,i=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger("doubleclick",e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger("click",e)}),i.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var i=this.__handlers[e],n=-1,o=0;o<i.length;o++)if(i[o]===t){n=o;break}n>=0&&this.__handlers[e].splice(n,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(i){try{i(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(i){e.root.removeEventListener(i,e[t[i]])}))}}]),e}();function qe(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var Je="auto",Ze=["videoClick","videoDbClick"],$e=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"onTouchStart",(function(e){var t=(0,n.V5)(o),i=t.player,s=t.config,a=t.pos,l=t.playerConfig,u=o.getTouche(e);if(u&&!s.disableGesture&&o.duration>0&&!i.ended){a.isStart=!0,o.timer&&clearTimeout(o.timer),r.Ay.checkIsFunction(l.disableSwipeHandler)&&l.disableSwipeHandler(),o.find(".xg-dur").innerHTML=r.Ay.format(o.duration);var c=o.root.getBoundingClientRect();90===i.rotateDeg?(a.top=c.left,a.left=c.top,a.width=c.height,a.height=c.width):(a.top=c.top,a.left=c.left,a.width=c.width,a.height=c.height);var h=parseInt(u.pageX-a.left,10),d=parseInt(u.pageY-a.top,10);a.x=90===i.rotateDeg?d:h,a.y=90===i.rotateDeg?h:d,a.scopeL=s.scopeL*a.width,a.scopeR=(1-s.scopeR)*a.width,a.scopeM1=a.width*(1-s.scopeM)/2,a.scopeM2=a.width-a.scopeM1}})),(0,n.n8)((0,n.V5)(o),"onTouchMove",(function(e){var t=o.getTouche(e),i=(0,n.V5)(o),s=i.pos,r=i.config,a=i.player;if(t&&!r.disableGesture&&o.duration&&s.isStart){var l=r.miniMoveStep,u=r.hideControlsActive,c=parseInt(t.pageX-s.left,10),h=parseInt(t.pageY-s.top,10),d=90===a.rotateDeg?h:c,f=90===a.rotateDeg?c:h;if(Math.abs(d-s.x)>l||Math.abs(f-s.y)>l){var p=d-s.x,g=f-s.y,v=s.scope;if(-1===v&&(0===(v=o.checkScope(d,f,p,g,s))&&(u?a.blur():a.focus({autoHide:!1}),!s.time&&(s.time=parseInt(1e3*a.currentTime,10)+1e3*o.timeOffset)),s.scope=v),-1===v||v>0&&!r.gestureY||0===v&&!r.gestureX)return;o.executeMove(p,g,v,s.width,s.height),s.x=d,s.y=f}}})),(0,n.n8)((0,n.V5)(o),"onTouchEnd",(function(e){var t=(0,n.V5)(o),i=t.player,s=t.pos,a=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),s.isStart){s.scope>-1&&e.cancelable&&e.preventDefault();var l=o.config,u=l.disableGesture,c=l.gestureX;!u&&c?o.endLastMove(s.scope):s.time=0,s.scope=-1,o.resetPos(),r.Ay.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),o.changeAction(Je)}})),(0,n.n8)((0,n.V5)(o),"onRootTouchMove",(function(e){!o.config.disableGesture&&o.config.gestureX&&o.checkIsRootTarget(e)&&(e.stopPropagation(),o.pos.isStart?o.onTouchMove(e):o.onTouchStart(e))})),(0,n.n8)((0,n.V5)(o),"onRootTouchEnd",(function(e){o.pos.scope>-1&&o.onTouchEnd(e)})),o.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},o.timer=null,o}return(0,n.j6)(i,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:qe,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;Ze.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,i=this.config,n=this.player;!0===t.closeVideoDblclick&&(i.closedbClick=!0),this.resetPos(),r.Ay.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=r.Ay.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var o="mouse"===this.domEventType?"mouse":"touch";this.touch=new Xe(this.root,{eventType:o,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),n.root.addEventListener("touchmove",this.onRootTouchMove,!0),n.root.addEventListener("touchend",this.onRootTouchEnd,!0),n.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var s=this.player.controls;s&&s.center&&(s.center.addEventListener("touchmove",this.onRootTouchMove,!0),s.center.addEventListener("touchend",this.onRootTouchEnd,!0),s.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(d.DURATION_CHANGE,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([d.CANPLAY,d.ENDED],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var a={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(a).map((function(t){e.touch.on(t,(function(i){e[a[t]](i)}))})),!i.disableActive){var l=n.plugins.progress;l&&(l.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){l.addCallBack(t,(function(){e.changeAction(Je)}))})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,i=e.progressColor,n=e.timePreviewStyle,o=e.curTimeColor,s=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),n){var a=this.find(".time-preview");Object.keys(n).forEach((function(e){a.style[e]=n[e]}))}var l=o||t,u=s;l&&(this.find(".xg-cur").style.color=l),u&&(this.find(".xg-dur").style.color=u),this.config.disableTimeProgress&&r.Ay.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var i=t.plugins.start;i&&i.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,i,n,o){var s=o.width,r=-1;if(e<0||e>s)return r;var a=0===n?Math.abs(i):Math.abs(i/n);return Math.abs(i)>0&&a>=1.73&&e>o.scopeM1&&e<o.scopeM2?r=0:(0===Math.abs(i)||a<=.57)&&(r=e<o.scopeL?1:e>o.scopeR?2:3),r}},{key:"executeMove",value:function(e,t,i,n,o){switch(i){case 0:this.updateTime(e/n*this.config.scopeM);break;case 1:this.updateBrightness(t/o);break;case 2:c.os.isIos||this.updateVolume(t/o)}}},{key:"endLastMove",value:function(e){var t=this,i=this.pos,n=this.player,o=this.config,s=(i.time-this.timeOffset)/1e3;0===e&&(n.seek(Number(s).toFixed(1)),o.hideControlsEnd?n.blur():n.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500)),this.changeAction(Je)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,i=this.config,n=this.playerConfig;t.state<z.RUNNING?n.closeVideoClick||(this.sendUseAction(r.Ay.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(r.Ay.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=z.RUNNING&&(this.sendUseAction(r.Ay.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;(0,N.Eu)(this,Ze[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;(0,N.Eu)(this,Ze[1],(function(e,i){t.dbClickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onPress",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:n.playbackRate,to:i.pressRate}),n.playbackRate=i.pressRate,this.changeAction("playbackrate"))}},{key:"onPressEnd",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:n.playbackRate,to:t.rate}),n.playbackRate=t.rate,t.rate=1,this.changeAction(Je))}},{key:"updateTime",value:function(e){var t=this.player,i=this.config,n=this.player.duration;e=Number(e.toFixed(4));var o=parseInt(e*i.moveDuration,10)+this.timeOffset;o=(o+=this.pos.time)<0?0:o>1e3*n?1e3*n-200:o,t.getPlugin("time")&&t.getPlugin("time").updateTime(o/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(o/1e3/this.duration,!0),this.activeSeekNote(o/1e3,e>0),i.isTouchingSeek&&t.seek(Number((o-this.timeOffset)/1e3).toFixed(1)),this.pos.time=o}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,i=this.pos;if(e=parseInt(100*e,10),i.volume+=e,!(Math.abs(i.volume)<10)){var n=parseInt(10*t.volume,10)-parseInt(i.volume/10,10);n=n>10?10:n<1?0:n,t.volume=n/10,i.volume=0}}},{key:"updateBrightness",value:function(e){var t=this.pos,i=this.config,n=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var o=t.light+.8*e;o=o>i.maxDarkness?i.maxDarkness:o<0?0:o,n&&(n.style.backgroundColor="rgba(0,0,0,".concat(o,")")),t.light=o}}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player,n=this.config,o=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!o&&!n.disableActive){e<0?e=0:e>i.duration&&(e=i.duration-.2),this.changeAction("seeking");var s=i.plugins.start;s&&s.focusHide(),this.find(".xg-dur").innerHTML=r.Ay.format(this.duration),this.find(".xg-cur").innerHTML=r.Ay.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?r.Ay.removeClass(this.find(".xg-seek-show"),"xg-back"):r.Ay.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<z.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),i}(I);function Qe(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var et=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,o=i.keyCode,s=(0,n.V5)(e),r=s._keyState,a=s.player,l=e.config,u=l.disable,c=l.disableBodyTrigger,h=l.isIgnoreUserActive;u||c||!a.isUserActive&&!h||Qe(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?r.isBodyKeyDown=!1:(t.repeat||r.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!Qe(i.target))&&e.checkCode(o,!0)&&(r.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),r.isBodyKeyDown&&e.handleKeyDown(i))}})),(0,n.n8)((0,n.V5)(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),(0,n.n8)((0,n.V5)(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,o=(0,n.V5)(e)._keyState;if(!i.repeat){if(e.config.disable||e.config.disableRootTrigger||i.metaKey||i.altKey||i.ctrlKey)return;!i||37!==i.keyCode&&!e.checkCode(i.keyCode)||i.target!==e.player.root&&i.target!==e.player.video&&i.target!==e.player.controls.el||(o.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}o.isKeyDown&&e.handleKeyDown(i)}})),(0,n.n8)((0,n.V5)(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return(0,n.j6)(i,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(i){e.keyCodeMap[i]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(n){t[i][n]&&(e.keyCodeMap[i][n]=t[i][n])})):e.keyCodeMap[i]=t[i]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,i=e.top,n=e.bottom,o=window.innerHeight;return!(i<0&&i<0-.9*t||n>0&&n-o>.9*t)}},{key:"checkCode",value:function(e,t){var i=this,n=!1;return Object.keys(this.keyCodeMap).map((function(o){i.keyCodeMap[o]&&e===i.keyCodeMap[o].keyCode&&!i.keyCodeMap[o].disable&&(n=!t||t&&!i.keyCodeMap[o].noBodyTarget)})),n}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var i=parseFloat((t.volume-.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i>=0?i:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var i=parseFloat((t.volume+.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i<=1?i:1}}},{key:"seek",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,o=t.duration,s=t.offsetDuration,a=t.timeSegments,l=n>-1?n:i,u=s||o,c=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;l+c<=u?l+=c:l=u;var h=r.Ay.getCurrentTimeByOffset(l,a),d={currentTime:{from:i,to:h}};this.emitUserAction(e,"seek",{props:d}),this.player.currentTime=h}},{key:"seekBack",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,o=t.timeSegments,s=(n>-1?n:i)-(e.repeat?parseInt(this.seekStep/2,10):this.seekStep);s<0&&(s=0);var a={currentTime:{from:i,to:s=r.Ay.getCurrentTimeByOffset(s,o)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=s}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var o,s=Object.keys(this.keyCodeMap),r=0;r<s.length;r++){var a=this.keyCodeMap[s[r]],l=a.action,u=a.keyCode,c=a.disable,h=a.pressAction,f=a.disablePress;if(u===e){if(!(c||i&&f)){var p=i&&h||l;"function"==typeof p?l(t,this.player,i):"string"==typeof p&&"function"==typeof this[p]&&this[p](t,this.player,i),this.emit(d.SHORTCUT,(0,n.T1)({key:s[r],target:t.target,isPress:i},this.keyCodeMap[s[r]]))}(o=t).preventDefault(),o.returnValue=!1,t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),i}(k.Ay);function tt(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var it=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"registerIcons",value:function(){return{loadingIcon:tt}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:C.ROOT}}}]),i}(I),nt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"_onDurationChange",(function(){e.updateSegments();var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var o=r.Ay.getIndexByTime(i,n),s=r.Ay.getOffsetCurrentTime(i,n,o);e.player.offsetCurrentTime=s,e.changeIndex(o,n)}})),(0,n.n8)((0,n.V5)(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=r.Ay.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),(0,n.n8)((0,n.V5)(e),"_onTimeupdate",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var o=n.length;e.lastCurrentTime=i;var s=r.Ay.getIndexByTime(i,n);s!==e.curIndex&&e.changeIndex(s,n);var a=r.Ay.getOffsetCurrentTime(i,n,s);if(e.player.offsetCurrentTime=a,e.curPos){var l=e.curPos,u=l.start,c=l.end;i<u?e.player.currentTime=u:i>c&&s>=o-1&&e.player.pause()}}})),(0,n.n8)((0,n.V5)(e),"_onSeeking",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n))if(i<n[0].start)e.player.currentTime=n[0].start;else if(i>n[n.length-1].end)e.player.currentTime=n[n.length-1].end;else{var o=r.Ay.getIndexByTime(i,n);if(o>=0){var s=e.getSeekTime(i,e.lastCurrentTime,o,n);s>=0&&(e.player.currentTime=s)}}})),(0,n.n8)((0,n.V5)(e),"_onPlay",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;e._checkIfEnabled(n)&&i>=n[n.length-1].end&&(e.player.currentTime=n[0].start)})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(d.DURATION_CHANGE,this._onDurationChange),this.on(d.LOADED_DATA,this._onLoadedData),this.on(d.TIME_UPDATE,this._onTimeupdate),this.on(d.SEEKING,this._onSeeking),this.on(d.PLAY,this._onPlay)}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,t=e.disable,i=e.segments,n=this.player;if(t||!i||0===i.length)n.timeSegments=[],n.offsetDuration=0,n.offsetCurrentTime=-1;else{var o=this.formatTimeSegments(i,n.duration);n.timeSegments=o,n.offsetDuration=o.length>0?o[o.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,t){var i=[];return e?(e.sort((function(e,t){return e.start-t.start})),e.forEach((function(e,n){var o={};if(o.start=e.start<0?0:e.start,o.end=t>0&&e.end>t?t:e.end,!(t>0&&o.start>t)){i.push(o);var s=o.end-o.start;if(0===n)o.offset=e.start,o.cTime=0,o.segDuration=s,o.duration=s;else{var r=i[n-1];o.offset=r.offset+(o.start-r.end),o.cTime=r.duration+r.cTime,o.segDuration=s,o.duration=r.duration+s}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,n){var o=-1,s=n[i],r=s.start,a=s.end;if(e>=r&&e<=a)return o;var l=e-t;if(l<0&&e<r){var u=t>r?t-r:0;return i-1>=0?n[i-1].end+l+u:0}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),i}(k.Ay);function ot(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g>\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var st=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).rotateDeg=o.config.rotateDeg||0,o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(d.VIDEO_RESIZE,(function(){e.rotateDeg&&e.config.innerRotate&&r.Ay.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){if(e||(e=0),t)this.player.videoRotateDeg=e;else{var i=this.player,n=this.rootWidth,o=this.rootHeight,s=i.root,r=i.innerContainer,a=i.media,l=s.offsetWidth,u=r&&t?r.offsetHeight:s.offsetHeight,c=n,h=o,d=0,f=0;.75!==e&&.25!==e||(c="".concat(u,"px"),h="".concat(l,"px"),d=-(u-l)/2,f=-(l-u)/2);var p="translate(".concat(d,"px,").concat(f,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:p,webKitTransform:p,height:h,width:c},v=t?a:s,m=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){v.style[e]=g[e],m&&m.root&&(m.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.player;this.rotateDeg||(this.rotateDeg=0);var o=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*o*i)%1,this.updateRotateDeg(this.rotateDeg,t),n.emit(d.ROTATE,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:ot}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(ee(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}(te);function rt(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function at(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var lt="picture-in-picture",ut="inline",ct="fullscreen",ht=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!0,to:!1}),e.setAttr("data-state","normal")):4===e.player.media.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&((0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.pMode=ut,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(d.COMPLETE,(function(){e.config.showIcon&&(r.Ay.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:rt,class:"xg-get-pip"},pipIconExit:{icon:at,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var i=t.paused;r.Ay.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(d.PIP_CHANGE,!1)},this.enterPIPCallback=function(i){t.emit(d.PIP_CHANGE,!0),null!=i&&i.pictureInPictureWindow&&(e.pipWindow=i.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(i){var n=t.media.webkitPresentationMode;e.pMode===ct&&n!==ct&&t.onFullscreenChange(null,!1),e.pMode=n,n===lt?e.enterPIPCallback(i):n===ut&&e.leavePIPCallback(i)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=(0,n.Og)(document.styleSheets).map((function(t){try{return(0,n.Og)(t.cssRules).map((function(e){return e.cssText})).join("")}catch(n){var i=document.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media,i.href=t.href,e.document.head.appendChild(i)}return""})).filter(Boolean).join("\n"),i=document.createElement("style");i.textContent=t,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,n=this.playerConfig,o=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var s=n.poster;if(s&&(t.media.poster="String"===r.Ay.typeOf(s)?s:s.poster),o.preferDocument&&this.isDocPIPAvailable()){var a={};if(o.width&&o.height)a.width=o.width,a.height=o.height;else{var l=t.root.getBoundingClientRect();a.width=l.width,a.height=l.height}documentPictureInPicture.requestWindow(a).then((function(i){var n=o.docPiPNode,s=o.docPiPStyle;e.enterPIPCallback();var r=n||t.root,a=r.parentElement,l=r.previousSibling,u=r.nextSibling;e.copyStyleIntoPiPWindow(i);var c=document.createElement("style");if(c.append("body{padding:0; margin:0;}"),s){var h="";"string"==typeof s?h=s:"function"==typeof s&&(h=s.call(o)),h&&c.append(h)}else r===t.root&&c.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(c),i.document.body.append(r),i.addEventListener("pagehide",(function(t){a&&(u?a.insertBefore(r,u):l?a.insertBefore(r,l.nextSibling):a.appendChild(r)),e.leavePIPCallback()}),{once:!0})}))}else i.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;return this.isPIPAvailable()&&this.isPip&&(this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():i.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===lt}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===r.Ay.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===r.Ay.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===r.Ay.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(ee(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),i}(te);function dt(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}var ft=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"playNext",(function(e){var t=(0,n.V5)(o).player;e.preventDefault(),e.stopPropagation(),o.idx+1<o.config.urlList.length?(o.idx++,o.nextHandler(o.config.urlList[o.idx],o.idx),t.emit(d.PLAYNEXT,o.idx+1)):(o.nextHandler(),t.emit(d.PLAYNEXT))})),o.idx=-1,o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:dt}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===c.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(e):t.src=e,t.config.url=e,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n '.concat(ee(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(I),pt=i(8140),gt=i.n(pt);function vt(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}var mt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"download",(function(e){if(!o.isLock){o.emitUserAction(e,"download");var t=o.playerConfig.url,i="";"String"===r.Ay.typeOf(t)?i=t:"Array"===r.Ay.typeOf(t)&&t.length>0&&(i=t[0].src);var n=o.getAbsoluteURL(i);gt()(n),o.isLock=!0,o.timer=window.setTimeout((function(){o.isLock=!1,window.clearTimeout(o.timer),o.timer=null}),300)}})),o.timer=null,o.isLock=!1,o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:vt}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(ee(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(te),yt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(d.VIDEO_RESIZE,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var i,n=document.createElement("a");n.href=e,n.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}catch(e){console.error("MouseEvent unsupported",e)}i&&n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d");this.canvasCtx=n,this.canvas=i,i.width=e||this.config.width,i.height=t||this.config.height,n.imageSmoothingEnabled=!0,n.imageSmoothingEnabled&&(n.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var i=this.config;this.shot(i.width,i.height).then((function(e){t.emit(d.SCREEN_SHOT,e),i.saveImg&&t.saveScreenShot(e,i.name+i.format)}))}},{key:"shot",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},o=this.config,s=this.player,r=n.quality||o.quality,a=n.type||o.type;return new Promise((function(n,l){var u,c=null;if(s.media.canvas)c=s.media.canvas;else{i.canvas?(i.canvas.width=e||o.width,i.canvas.height=t||o.height):i.createCanvas(e,t),c=i.canvas,u=i.canvasCtx;var h,d,f,p,g=s.media.videoWidth/s.media.videoHeight,v=c.width/c.height,m=s.media.videoWidth,y=s.media.videoHeight;g>v?(f=c.width,p=c.width/g,h=0,d=Math.round((c.height-p)/2)):g===v?(f=c.width,p=c.height,h=0,d=0):g<v&&(f=c.height*g,p=c.height,h=Math.round((c.width-f)/2),d=0),u.drawImage(s.media,0,0,m,y,h,d,f,p)}var _=c.toDataURL(a,r).replace(a,"image/octet-stream");n(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(d.VIDEO_RESIZE,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>"),"\n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(te),_t=function(){function e(t){(0,n.xs)(this,e),this.config=t.config,this.parent=t.root,this.root=r.Ay.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var i=this.config.maxHeight;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var o="touch"===this.config.domEventType?"touchend":"click";this._delegates=I.delegate.call(this,this.root,"li",o,this.onItemClick)}return(0,n.j6)(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"option-item selected":"option-item";e["data-index"]=i,t.root.appendChild(r.Ay.createDom("li","<span>".concat(e.showText,"</span>"),e,n))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&r.Ay.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");r.Ay.addClass(t,"selected"),n&&r.Ay.removeClass(n,"selected"),i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){r.Ay.removeClass(this.root,"hide"),r.Ay.addClass(this.root,"active")}},{key:"hide",value:function(){r.Ay.removeClass(this.root,"active"),r.Ay.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),kt="side",Tt="middle",Et="click",bt="mobile"===c.device,At=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"onEnter",(function(e){e.stopPropagation(),o.emit("icon_mouseenter",{pluginName:o.pluginName}),o.switchActiveState(e)})),(0,n.n8)((0,n.V5)(o),"switchActiveState",(function(e){e.stopPropagation(),o.config.toggleMode===Et?o.toggle(!o.isActive):o.toggle(!0)})),(0,n.n8)((0,n.V5)(o),"onLeave",(function(e){e.stopPropagation(),o.emit("icon_mouseleave",{pluginName:o.pluginName}),o.config.listType!==kt&&o.isActive&&o.toggle(!1)})),(0,n.n8)((0,n.V5)(o),"onListEnter",(function(e){o.enterType=2})),(0,n.n8)((0,n.V5)(o),"onListLeave",(function(e){o.enterType=0,o.isActive&&o.toggle(!1)})),o.isIcons=!1,o.isActive=!1,o.curValue=null,o.curIndex=0,o}return(0,n.j6)(i,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),(bt=bt||"touch"===this.domEventType)&&"mobile"===c.device&&"default"===t.listType&&(t.listType=kt),t.hidePortrait&&r.Ay.addClass(this.root,"portrait"),this.on([d.VIDEO_RESIZE,d.FULLSCREEN_CHANGE],(function(){e._resizeList()})),this.once(d.CANPLAY,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),bt&&this.on(d.PLAYER_FOCUS,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),bt?(t.toggleMode=Et,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===Et?"click":"mouseenter",t.toggleMode===Et?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,i=Object.keys(t),n=!1;i.length>0&&(i.forEach((function(i){e.appendChild(".xgplayer-icon",t[i]),!n&&(n=t[i])})),this.isIcons=n),n||(this.appendChild(".xgplayer-icon",r.Ay.createDom("span","",{},"icon-text")),r.Ay.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||r.Ay.addClass(this.root,"show")}},{key:"hide",value:function(){r.Ay.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var o=this.config.list;!i&&(i=this.player.lang),t=!t||r.Ay.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=o[e]);try{return"object"===(0,n.uk)(e[t])?e[t][i]||e[t].en:e[t]}catch(e){return console.warn(e),""}}},{key:"toggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===kt?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===kt?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var i=this.config,n=i.listType,o=i.list;this.curIndex=t.to.index,this.curItem=o[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||bt||n===kt)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var i=this,n=this.config,o=this.optionsList,s=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=n.list[t]),o)return o.renderItemList(e),void this.changeCurrentText();var r,a,l={config:{data:e||[],className:(r=n.listType,a=n.position,r===kt?a===C.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:bt?"touch":"mouse"},root:n.listType===kt?s.innerContainer||s.root:this.root};if(this.config.isShowIcon){var u=this.player.root.getBoundingClientRect().height,c=n.listType===Tt?u-50:u;c&&n.heightLimit&&(l.config.maxHeight="".concat(c,"px")),this.optionsList=new _t(l),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===Tt?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===Et?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:"hover",heightLimit:!0}}}]),i}(I),Ct=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).curTime=0,o.isPaused=!0,o}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(d.DEFINITION_CHANGE,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||r.Ay.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,i=e.defaultDefinition;if(t.length>0){var n=null;t.map((function(e){e.definition===i&&(n=e)})),n||(n=t[0]),this.changeDefinition(n)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],o=arguments.length>1?arguments[1]:void 0,s=o&&o.definition?o.definition:this.config.defaultDefinition;o&&t.forEach((function(e){e.selected=!1}));var r=0,a=t.map((function(t,i){var o=(0,n.T1)((0,n.T1)({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==s)&&(o.selected=!0,r=i),o}));(0,n.Jt)((0,n.U6)(i.prototype),"renderItemList",this).call(this,a,r)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,t){this.player.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var o=this.player.definitionList;(0,n.Jt)((0,n.U6)(i.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var s=0;s<o.length;s++)t.to&&o[s].definition===t.to.definition&&(t.to.url=o[s].url),t.from&&o[s].definition===t.from.definition&&(t.from.url=o[s].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return(0,n.T1)((0,n.T1)({},At.defaultConfig),{},{position:C.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(At),St=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).curRate=1,o}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,i=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(i)&&(e.config.list=i.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.on(d.RATE_CHANGE,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&(0,n.Jt)((0,n.U6)(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){(0,n.Jt)((0,n.U6)(i.prototype),"onItemClick",this).call(this,e,t);var o=e.delegateTarget,s=Number(o.getAttribute("rate"));if(!s||s===this.curValue)return!1;var r={playbackRate:{from:this.player.playbackRate,to:s}};this.emitUserAction(e,"change_rate",{props:r}),this.curValue=s,this.player.playbackRate=s}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var o=-1,s=this.config.list.map((function(i,n){var s={rate:i.rate};return s.rate===t&&(s.selected=!0,o=n),s.showText=e.getTextByLang(i),s}));(0,n.Jt)((0,n.U6)(i.prototype),"renderItemList",this).call(this,s,o)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e,t=this.config.list,i=t[this.curIndex<t.length?this.curIndex:0];e=!i||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(i,"iconText"),this.find(".icon-text").innerHTML=e}}},{key:"destroy",value:function(){(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return(0,n.T1)((0,n.T1)({},At.defaultConfig),{},{position:C.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}(At),xt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(d.ERROR,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,i=e.errorType,n=t.errorNote?this.i18n[t.errorNote]:"";if(!n)switch(i){case"decoder":n=this.i18n.MEDIA_ERR_DECODE;break;case"network":n=this.i18n.MEDIA_ERR_NETWORK;break;default:n=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=n,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),i}(I),wt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(i){t.root.style[i]=e[i]}))}},{key:"showPrompt",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=n;var o=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),r.Ay.addClass(this.root,"show"),"arrow"===i.mode&&r.Ay.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),i.style&&this.setStyle(i.style),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var s=i.interval||o;this.intervalId=setTimeout((function(){t.hide()}),s)}}}},{key:"hide",value:function(){r.Ay.removeClass(this.root,"show"),r.Ay.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(L.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),i}(I),It={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Rt(e){Object.keys(It).map((function(t){void 0===e[t]&&(e[t]=It[t])}))}var Pt={_updateDotDom:function(e,t){if(t){var i=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(i.left,"%"),n.width="".concat(i.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),i.isMini?r.Ay.addClass(t,"mini"):r.Ay.removeClass(t,"mini"),Object.keys(n).map((function(e){t.style[e]=n[e]}))}},initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this.ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player.plugins.progress;if(i&&(t&&(Rt(e),this._ispots.push(e)),this.ispotsInit||!t)){var n=this.calcuPosition(e.time,e.duration),o=e.style||{};o.left="".concat(n.left,"%"),o.width="".concat(n.width,"%");var s="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(s+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",l=r.Ay.createDom("xg-spot",a,{"data-text":e.text,"data-time":e.time,"data-id":e.id},s);Object.keys(o).map((function(e){l.style[e]=o[e]})),i.outer&&i.outer.appendChild(l),this.positionDot(l,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,i){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player.plugins.progress;if(i){var n=this.findDot(e.id);if(n&&Object.keys(e).map((function(t){n[t]=e[t]})),this.ispotsInit){var o=i.find('xg-spot[data-id="'.concat(e.id,'"]'));o&&(this._updateDotDom(e,o),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,i=this.player.plugins.progress;if(i){for(var n=[],o=0;o<t.length;o++)t[o].id===e&&n.push(o);for(var s=n.length-1;s>=0;s--)if(t.splice(n[s],1),this.ispotsInit){var r=i.find('xg-spot[data-id="'.concat(e,'"]'));r&&r.parentElement.removeChild(r)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this.ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),i=t.length-1;i>=0;i--)e.outer.removeChild(t[i]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.player.plugins.progress;if(i)if(this.ispotsInit){this._ispots=[];var n=i.root.getElementsByTagName("xg-spot"),o=n.length;if(o>t.length)for(var s=o-1;s>t.length-1;s--)i.outer.removeChild(n[s]);t.forEach((function(t,i){i<o?(n[i].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},positionDots:function(){var e=this,t=this._ispots,i=this.playerSize,n=this.player.sizeInfo,o=this.player.plugins.progress;o&&n.width!==i.width&&(i.width=n.width,i.left=n.left,t.forEach((function(t){var i=o.find('xg-spot[data-id="'.concat(t.id,'"]'));i&&e.positionDot(i,t.id)})))},positionDot:function(e,t){var i=r.Ay.findDom(e,".xgplayer-spot-pop");if(i){var n=this.playerSize,o=e.getBoundingClientRect(),s=i.getBoundingClientRect(),a=o.left-n.left,l=n.width-a-o.width/2;if(a<s.width/2||n.width<s.width){var u=s.width/2-a;i.style.left="".concat(u,"px")}else if(l<s.width/2){var c=l-s.width/2+o.width/2;i.style.left="".concat(c,"px")}else i.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(i){var n=t.find('xg-spot[data-id="'.concat(i.id,'"]'));e._updateDotDom(i,n)}))},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}},Ot={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},Lt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this,e),(0,n.n8)((0,n.V5)(o),"onMousemove",(function(e){o.config.disable||(r.Ay.hasClass(e.target,"xg-spot-content")&&o.config.isHideThumbnailHover?o.player.plugins.progress.onMouseLeave(e):(o._state.f||r.Ay.hasClass(e.target,"xg-spot-content"))&&(r.Ay.event(e),e.stopPropagation()))})),(0,n.n8)((0,n.V5)(o),"onMousedown",(function(e){o.config.disable||(o._state.f||r.Ay.hasClass(e.target,"xg-spot-content"))&&(r.Ay.event(e),e.stopPropagation())})),(0,n.n8)((0,n.V5)(o),"onMouseup",(function(e){if(o.isDrag){var t=o.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),(0,n.n8)((0,n.V5)(o),"onDotMouseLeave",(function(e){if(!o.config.disable){o._curDot.removeEventListener("mouseleave",o.onDotMouseLeave),o.blurDot(e.target),o._curDot=null;var t=o.player.plugins.progress;t&&t.enableBlur(),o.show()}})),(0,n.n8)((0,n.V5)(o),"onProgressMouseOver",(function(e,t){if(!o.config.disable&&r.Ay.hasClass(t.target,"xgplayer-spot")&&!o._curDot){o._curDot=t.target,o.focusDot(t.target),o._curDot.children.length>0&&o.hide();var i=o.player.plugins.progress;i&&i.disableBlur(),o._curDot.addEventListener("mouseleave",o.onDotMouseLeave)}})),o._ispots=[],o.videoPreview=null,o.videothumbnail=null,o.thumbnail=null,o.timeStr="",o._state={now:0,f:!1},o}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,i){i.seekTime&&e.player.seek(i.seekTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(r.Ay.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(Pt).map((function(t){e[t]=Pt[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return Rt(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(d.DURATION_CHANGE,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(d.VIDEO_RESIZE,(function(){e.positionDots()}))}(this),this.on(d.DURATION_CHANGE,(function(){e.show()})),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){t.config[i]=e[i]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(Ot).map((function(i){e[Ot[i]]=e[Ot[i]].bind(e),t.addCallBack(i,e[Ot[i]])})),"mobile"!==c.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var i=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(n){n.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,n),t&&t.onMouseUp(n)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&r.Ay.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&r.Ay.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||r.Ay.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(i){e[i]=t.target.getAttribute("data-".concat(i))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var i=this.root,n=this.previewLine,o=this.player,s=this.config,r="flex"===o.controls.mode,a=i.getBoundingClientRect().width;if(a||!this._hasThumnail){var l,u=e-(a=this._hasThumnail&&a<s.width?s.width:a)/2;u<0&&!r?(u=0,l=e-a/2):u>t-a&&!r?(l=u-(t-a),u=t-a):l=0,void 0!==l&&(n.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(u.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,i=this.timePoint;t.innerHTML=e,!this.thumbnail&&(i.innerHTML=e)}},{key:"updatePosition",value:function(e,t,i,n){var o=this.root,s=this.config,a=this._state;if(o){a.now=i,this.transformTimeHook(i);var l=this.timeStr;n&&n.target&&r.Ay.hasClass(n.target,"xgplayer-spot")?(this.showTips(n.target.getAttribute("data-text"),!1,l),this.focusDot(n.target),a.f=!0,s.isFocusDots&&a.f&&(a.now=parseInt(n.target.getAttribute("data-time"),10))):s.defaultText?(a.f=!1,this.showTips(s.defaultText,!0,l)):(a.f=!1,this.hideTips("")),this.updateTimeText(l),this.updateThumbnails(a.now),this.updateLinePos(e,t)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,i=this.videoPreview,n=this.config,o=t.plugins.thumbnail;if(o&&o.usable){this.thumbnail&&o.update(this.thumbnail,e,n.width,n.height);var s=i&&i.getBoundingClientRect();this.videothumbnail&&o.update(this.videothumbnail,e,s.width,s.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==c.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){r.Ay.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&r.Ay.addClass(this.root,"short-line"),this._hasThumnail=!0;var o=this.find(".xg-spot-thumbnail");this.thumbnail=n.createThumbnail(o,"progress-thumbnail"),i.isShowCoverPreview&&(this.videoPreview=r.Ay.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else r.Ay.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var i=this.player.plugins.progress,n=this.player,o=i.root.getBoundingClientRect().width,s=n.duration/o*6;return e+t>n.duration&&(t=n.duration-e),n.duration,n.duration,{left:e/n.duration*100,width:t/n.duration*100,isMini:t<s}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var i=this.root.getBoundingClientRect().width,n=t.time/this.player.duration*i;this.updatePosition(n,i,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),r.Ay.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(r.Ay.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";r.Ay.addClass(this.root,"no-timepoint"),e&&(r.Ay.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(r.Ay.addClass(this.root,"product"),this.tipText.textContent=e):(r.Ay.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){r.Ay.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",r.Ay.removeClass(this.find(".xg-spot-content"),"show-text"),r.Ay.removeClass(this.root,"product")}},{key:"hide",value:function(){r.Ay.addClass(this.root,"hide")}},{key:"show",value:function(e){r.Ay.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(Ot).map((function(i){t.removeCallBack(i,e[Ot[i]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===c.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info hide '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),i}(I),Dt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).ratio=1,o.interval=null,o._preloadMark={},o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([d.DURATION_CHANGE],(function(){var t=e.config,i=t.pic_num,n=t.interval;e.usable&&(e.interval=n>0?n:Math.round(1e3*e.player.duration/i)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,i=e.pic_num;return t&&t.length>0&&i>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,i=e.height,n=e.pic_num,o=e.interval;this.ratio=t/i*100,this.interval=o||Math.round(this.player.duration/n),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var i=this.config.urls,n=i.length,o=[];e>0&&o.push(e-1),o.push(e),e>0&&e<n-1&&o.push(e+1),o.map((function(e){!t._preloadMark[e]&&e>=0&&e<n&&(t._preloadMark[e]=1,r.Ay.preloadImg(i[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.config,o=n.pic_num,s=n.row,r=n.col,a=n.width,l=n.height;this.interval=Math.round(this.player.duration/o);var u=Math.ceil(e/this.interval),c=(u=u>o?o:u)<s*r?0:Math.ceil(u/(s*r))-1,h=u-c*(r*s),d=h>0?Math.ceil(h/r)-1:0,f=h>0?h-d*r-1:0,p=0,g=0;t&&i?t/i<a/l?p=(g=i)*(a/l):g=(p=t)/(a/l):i?t||(p=(g=i||l)*(a/l)):g=(p=t||a)/(a/l);var v=this.getUrlByIndex(c);return{urlIndex:c,rowIndex:d,colIndex:f,url:v,height:g,width:p,style:{backgroundImage:"url(".concat(v,")"),backgroundSize:"".concat(p*r,"px auto"),backgroundPosition:"-".concat(f*p,"px -").concat(d*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=this.config,r=s.pic_num,a=s.urls;if(!(r<=0)&&a&&0!==a.length){var l=this.getPosition(t,i,n);this.preload(l.urlIndex),Object.keys(l.style).map((function(t){e.style[t]=l.style[t]})),Object.keys(o).map((function(t){e.style[t]=o[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var i=r.Ay.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(i),i}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),i}(I);function Nt(e){return e?"background:".concat(e,";"):""}var Mt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onTimeupdate",(function(){var t=e.player.ended,i=(0,n.V5)(e).offsetDuration,o=e.currentTime;o=r.Ay.adjustTimeByDuration(o,i,t),e.update({played:o},i)})),e}return(0,n.j6)(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(d.TIME_UPDATE,this.onTimeupdate),this.on(d.EMPTIED,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,n=i.mode,o=i.height,s={cached:Nt(t.cachedColor),played:Nt(t.playedColor),progress:Nt(t.progressColor),height:o>0&&2!==o?"height: ".concat(o,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(s.progress," ").concat(s.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(s.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(s.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(I),Ft="realtime",Ht="firstframe",Ut="poster",jt=null,Bt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(d.TIME_UPDATE,e.renderOnTimeupdate),e.on(d.TIME_UPDATE,e.renderOnTimeupdate))})),(0,n.n8)((0,n.V5)(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),(0,n.n8)((0,n.V5)(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(d.TIME_UPDATE,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),(0,n.n8)((0,n.V5)(e),"start",(function(t,i){var o=e.player.video,s=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),a=e.checkVideoIsSupport(o);a&&e.canvasCtx&&(i||(i=e.interval),e.stop(),o.videoWidth&&o.videoHeight&&(e.videoPI=o.videoHeight>0?parseInt(o.videoWidth/o.videoHeight*100,10):0,(e.config.mode===Ft||s-e.preTime>=i)&&(o&&o.videoWidth&&e.update(a,e.videoPI),e.preTime=s)),e.frameId="timer"===e._loopType?r.Ay.setTimeout((0,n.V5)(e),e.start,i):r.Ay.requestAnimationFrame(e.start))})),(0,n.n8)((0,n.V5)(e),"stop",(function(){e.frameId&&("timer"===e._loopType?r.Ay.clearTimeout((0,n.V5)(e),e.frameId):r.Ay.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),i.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,o=t.mode,s=t.frameRate;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/s,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==Ft&&this.interval>=1e3?"timer":"animation",this.once(d.COMPLETE,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),o!==Ut&&(o!==Ht&&(this.on(d.EMPTIED,(function(){e.stop()})),this.on(d.PLAY,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(d.PAUSE,(function(){e.stop()}))),this.on(d.LOADED_DATA,this.onLoadedData),this.on(d.LOAD_START,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){"root"===i&&e[i]!==t.config[i]?t.reRender(e[i]):"frameRate"===i?t.interval=parseInt(1e3/e[i],10):"disable"===i&&e[i]&&t.stop(),t.config[i]=e[i]}))}},{key:"init",value:function(e){var t=this.player,n=this.config;this.canvasFilter=i.supportCanvasFilter();try{var o=e||n.root;o||(o=n.isInnerRender&&t.innerContainer||t.root),o.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=o.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){b.A.logError("plugin:DynamicBg",e)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var i=this.config.startInterval;this._checkIfCanStart()&&this.start(0,i)}else this.root=null}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==c.browser||!r.Ay.isMSE(t)))return t;var i=t?t.tagName.toLowerCase():"";return"canvas"===i||"img"===i?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===r.Ay.typeOf(e)?e:"String"===r.Ay.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==Ht&&e!==Ut}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var i=this.canvas.getBoundingClientRect(),n=i.width,o=i.height,s=new window.Image;s.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=o,t.canvas.width=n;var e=parseInt(n/o*100,10);t.update(s,e),s=null}},s.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var i=this._pos,n=this.config,o=this.canvas.getBoundingClientRect(),s=o.width,r=o.height;if(s!==i.width||r!==i.height||i.pi!==t){var a=parseInt(s/r*100,10);i.pi=t,i.width!==s&&(i.width=this.canvas.width=s),i.height!==r&&(i.height=this.canvas.height=r);var l=r,u=s;a<t?u=parseInt(r*t/100,10):a>t&&(l=parseInt(100*s/t,10)),i.rwidth=u*n.multiple,i.rheight=l*n.multiple,i.x=(s-i.rwidth)/2,i.y=(r-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=n.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(e){b.A.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof jt?jt:jt=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===c.browser||"firefox"===c.browser)}}]),i}(I),Vt={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},Wt="info",zt=d.STATS_EVENTS,Gt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"_recordUserActions",(function(t){var i=e._getTime(),o=Object.assign({},t,{msg:t.msg||t.action});e._stats[Wt].push((0,n.T1)((0,n.T1)({type:"userAction"},i),{},{payload:o}))})),(0,n.n8)((0,n.V5)(e),"_onReset",(function(){e.reset()})),(0,n.n8)((0,n.V5)(e),"_recordInfo",(function(t){e.info(t)})),(0,n.n8)((0,n.V5)(e),"_downloadStats",(function(){var t=e.getStats(),i=new Blob([JSON.stringify(t)],{type:"application/json"}),n=window.URL.createObjectURL(i),o=document.createElement("a");o.style.display="none",o.href=n,o.download="player.txt",o.disabled=!1,o.click()})),e}return(0,n.j6)(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(d.USER_ACTION,this._recordUserActions),this.on(zt.STATS_INFO,this._recordInfo),this.on(zt.STATS_DOWNLOAD,this._downloadStats),this.on(zt.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats[Wt].push((0,n.T1)((0,n.T1)({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=Date.now()-e.startMs,i=(0,n.T1)({cat:"function",dur:t,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(i)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},(0,n.n8)(e,Wt,[]),(0,n.n8)(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],i=0;i<e.buffered.length;i++)t.push({start:e.buffered.start(i),end:e.buffered.end(i)});var n={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=n,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats[Wt].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[Wt].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(k.Ay),Kt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onGapJump",(function(){var t=(0,n.V5)(e),o=t.player,s=t.config;if(o.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(o.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!o.media.paused||0===o.media.currentTime||!e.hasPlayed){var r=o.media.buffered,a=s.smallGapLimit||.5,l=s.gapDetectionThreshold||.3,u=o.media.currentTime,c=e._getIndex(r,u,l);if(null!==c&&0!==c){console.log("GapJump bufferRange ",r.start(c),r.end(c));var h=r.start(c)+.1;if(!(h>o.media.duration)){var d=h-u,f=d<=a;d<i.BROWSER_GAP_TOLERANCE||f&&(!1!==s.useGapJump&&(o.media.currentTime=e.isSafari?h+.1:h),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",f," currentTime:",o.media.currentTime," jumpSize:",u-o.media.currentTime),.08!==h&&o&&o.emit("log",{type:"oneevent",end_type:"gap",vid:o.config.vid,ext:{video_postion:Math.floor(1e3*h)}}))}}}}})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(d.WAITING,this.onGapJump),this.on(d.PLAY,(function(){e.hasPlayed=!0})),this.on(d.SEEKING,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,i){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var n=this._getBuffered(e),o=null,s=0;s<n.length;s++)if(n[s].start>t&&(0===s||n[s-1].end-t<=i)){o=s;break}return o}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),i}(I);Kt.BROWSER_GAP_TOLERANCE=.001;var Yt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"onWaiting",(function(){var t=(0,n.V5)(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),(0,n.n8)((0,n.V5)(e),"onJump",(function(){var t=(0,n.V5)(e),i=t.player,o=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>o.jumpCntMax||!1===o.useWaitingTimeoutJump||i.media.paused&&0!==i.media.currentTime&&e.hasPlayed)){e.jumpSize=o.jumpSize*(e.jumpCnt+1),e.jumpCnt===o.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var s=i.currentTime+e.jumpSize;s>i.media.duration||(e.jumpCnt++,i.currentTime=s)}})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.useWaitingTimeoutJump,n=t.jumpSize;!1!==i&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=n,this.on(d.WAITING,this.onWaiting),this.on([d.PLAYING,d.CANPLAY],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(d.PLAY,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(I),Xt="cdn",qt=["cdn"],Jt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var i=0;return e.speedListCache[t].map((function(e){i+=e})),Math.floor(i/e.speedListCache[t].length)})),(0,n.n8)((0,n.V5)(e),"startTimer",(function(){r.Ay.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),(0,n.n8)((0,n.V5)(e),"initSpeedList",(function(){e.speedListCache={},qt.forEach((function(t){e.speedListCache[t]=[]}))})),(0,n.n8)((0,n.V5)(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||Xt)})),(0,n.n8)((0,n.V5)(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,i=t.url,n=t.loadSize,o=t.testCnt,s=t.testTimeStep,r=i+(i.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=o)){e.cnt++;try{var a=(new Date).getTime(),l=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",r);var c={},h=Math.floor(10*Math.random());c.Range="bytes="+h+"-"+(n+h),c&&Object.keys(c).forEach((function(e){u.setRequestHeader(e,c[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,l=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,i=Math.round(1e3*t/(l-a));e.appendList(i),e.timer=setTimeout(e.testSpeed,s)}},u.send()}catch(e){console.error(e)}}}})),(0,n.n8)((0,n.V5)(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xt;if(e.speedListCache&&e.speedListCache[i]){var o=e.config.saveSpeedMax;e.speedListCache[i].length>=o&&e.speedListCache[i].shift(),e.speedListCache[i].push(t);var s=(0,n.V5)(e).player;s&&(i===Xt?s.realTimeSpeed=t:s[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),(0,n.n8)((0,n.V5)(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt,i=e.getSpeed(t),o=(0,n.V5)(e).player;if(o)if(t===Xt)o.avgSpeed&&i===o.avgSpeed||(o.avgSpeed=i,o.emit(d.DOWNLOAD_SPEED_CHANGE,{speed:i,realTimeSpeed:o.realTimeSpeed}));else{var s=e.getSpeedName("avg",t);o[s]&&i===o[s]||(o[s]=i,o.emit(d.DOWNLOAD_SPEED_CHANGE,{speed:i,realTimeSpeed:o.realTimeSpeed}))}})),e}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&qt.push.apply(qt,(0,n.Og)(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([d.LOADED_DATA,d.REPLAY],this.startTimer)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([d.LOADED_DATA,d.REPLAY],this.startTimer),qt.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),i}(I),Zt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,n=t.media||t.video;this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled||n.getVideoPlaybackQuality&&(this.on(d.PLAY,(function(){e._startTick()})),this.on(d.PAUSE,(function(){e._stopTick()})),this.on(d.ENDED,(function(){e._stopTick()})),this.on(d.EMPTIED,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,t){for(var i=!1,n=[],o=0;o<t.length;o++){var s=t.start(o),r=t.end(o);if(n.push({start:s,end:r}),s<=e&&e<=r-1){i=!0;break}}return{enoughBuffer:i,buffers:n}}},{key:"_checkStuck",value:function(e,t,i,n){var o=this.player.media||this.player.video,s=document.hidden,r=o.paused,a=o.readyState,l=o.currentTime,u=o.buffered;if(!(s||r||a<4)){var c=this._checkBuffer(l,u),h=c.enoughBuffer,f=c.buffers;h&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:f,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:n}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(d.FPS_STUCK,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,n=t.droppedVideoFrames,o=performance.now();if(i&&this._lastCheckPoint){var s=i-this._lastDecodedFrames,r=o-this._lastCheckPoint;this._checkStuck(s,i,n,r)}this._lastDecodedFrames=i,this._lastCheckPoint=o}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),i}(I);V.use(Vt);var $t=(0,n.j6)((function e(t,i){var o,s,r;(0,n.xs)(this,e);var a=i&&"mobile"===i.isMobileSimulateMode,l=i.isLive,u=[].concat(l?[]:[nt,ve,Mt,Lt,me],[de,ue,st,ft,Ct,St,mt,yt,Te,ht]),h=[Se,xe,Re,it,Pe,xt,wt,Dt,je];this.plugins=[Gt,Ae].concat((0,n.Og)(u),h,[Kt,Yt]);var d=a?"mobile":c.device;switch(d){case"pc":(o=this.plugins).push.apply(o,[et,We,oe,Jt,Zt]);break;case"mobile":(s=this.plugins).push.apply(s,[$e]);break;default:(r=this.plugins).push.apply(r,[et,We,oe])}(c.os.isIpad||"pc"===d)&&this.plugins.push(Bt),c.os.isIpad&&this.plugins.push(We),this.ignores=[],this.i18n=[]})),Qt=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i)}(Q);(0,n.n8)(Qt,"defaultPreset",$t),(0,n.n8)(Qt,"Util",r.Ay),(0,n.n8)(Qt,"Sniffer",c),(0,n.n8)(Qt,"Errors",h.A),(0,n.n8)(Qt,"Events",d),(0,n.n8)(Qt,"Plugin",I),(0,n.n8)(Qt,"BasePlugin",k.Ay),(0,n.n8)(Qt,"I18N",V),(0,n.n8)(Qt,"STATE_CLASS",L),(0,n.n8)(Qt,"InstManager",X),(0,n.n8)(Qt,"PlayIcon",de),(0,n.n8)(Qt,"TimeIcon",me),(0,n.n8)(Qt,"Progress",ve),(0,n.n8)(Qt,"FullscreenIcon",ue),(0,n.n8)(Qt,"CssFullscreenIcon",oe),(0,n.n8)(Qt,"VolumeIcon",Te);var ei=(0,n.j6)((function e(t,i){var o,s,r;(0,n.xs)(this,e);var a=i&&"mobile"===i.isMobileSimulateMode,l=i.isLive,u=[].concat(l?[]:[ve,Mt,Lt,me],[de,ue,st,ft,Ct,St,mt,yt,Te,ht]),h=[Se,xe,Re,it,Pe,xt,wt,Dt,je];this.plugins=[Gt,Ae].concat((0,n.Og)(u),h,[Kt,Yt]);var d=a?"mobile":c.device;switch(d){case"pc":(o=this.plugins).push.apply(o,[et,We,oe,Jt,Zt]);break;case"mobile":(s=this.plugins).push.apply(s,[$e]);break;default:(r=this.plugins).push.apply(r,[et,We,oe])}(c.os.isIpad||"pc"===d)&&this.plugins.push(Bt),this.ignores=[],this.i18n=[]})),ti=(0,n.j6)((function e(){var t,i;(0,n.xs)(this,e);var o=[de,ue,me,Te,st,Ct,St,oe,ht];switch(this.plugins=[xe,Re,it,Pe,xt].concat(o),c.device){case"pc":(t=this.plugins).push.apply(t,[et,We]);break;case"mobile":this.plugins.push($e);break;default:(i=this.plugins).push.apply(i,[et,We])}this.ignores=[],this.i18n=[Vt]})),ii=(0,n.j6)((function e(){(0,n.xs)(this,e);var t=[$e,ve,de,ue,me,st,ft,Ct,St,mt,yt,Te,ht],i=[Se,xe,Re,it,Pe,xt,wt,Dt,Mt];this.plugins=[Ae].concat(t,i),this.ignores=[],this.i18n=[Vt]})),ni={LANG:"zh-hk",TEXT:{ERROR_TYPES:{network:{code:1,msg:"視頻下載錯誤"},mse:{code:2,msg:"流追加錯誤"},parse:{code:3,msg:"解析錯誤"},format:{code:4,msg:"格式錯誤"},decoder:{code:5,msg:"解碼錯誤"},runtime:{code:6,msg:"語法錯誤"},timeout:{code:7,msg:"播放超時"},other:{code:8,msg:"其他錯誤"}},HAVE_NOTHING:"沒有關於音頻/視頻是否就緒的信息",HAVE_METADATA:"音頻/視頻的元數據已就緒",HAVE_CURRENT_DATA:"關於當前播放位置的數據是可用的,但沒有足夠的數據來播放下壹幀/毫秒",HAVE_FUTURE_DATA:"當前及至少下壹幀的數據是可用的",HAVE_ENOUGH_DATA:"可用數據足以開始播放",NETWORK_EMPTY:"音頻/視頻尚未初始化",NETWORK_IDLE:"音頻/視頻是活動的且已選取資源,但並未使用網絡",NETWORK_LOADING:"瀏覽器正在下載數據",NETWORK_NO_SOURCE:"未找到音頻/視頻來源",MEDIA_ERR_ABORTED:"取回過程被用戶中止",MEDIA_ERR_NETWORK:"下載錯誤",MEDIA_ERR_DECODE:"解碼錯誤",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音頻/視頻格式",REPLAY:"重播",ERROR:"網絡連接似乎出現了問題",PLAY_TIPS:"播放",PAUSE_TIPS:"暫停",PLAYNEXT_TIPS:"下壹集",DOWNLOAD_TIPS:"下載",ROTATE_TIPS:"旋轉",RELOAD_TIPS:"重新載入",FULLSCREEN_TIPS:"進入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"進入樣式全屏",EXITCSSFULLSCREEN_TIPS:"退出樣式全屏",TEXTTRACK:"字幕",PIP:"畫中畫",SCREENSHOT:"截圖",LIVE:"正在直播",OFF:"關閉",OPEN:"開啟",MINI_DRAG:"點擊按住可拖動視頻",MINISCREEN:"小屏幕",REFRESH_TIPS:"請試試",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},oi={LANG:"jp",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ビデオダウンロードエラー"},mse:{code:2,msg:"ストリーム追加エラー"},parse:{code:3,msg:"解析エラー"},format:{code:4,msg:"間違ったフォーマット"},decoder:{code:5,msg:"デコードエラー"},runtime:{code:6,msg:"文法エラー"},timeout:{code:7,msg:"再生タイムアウト"},other:{code:8,msg:"その他のエラー"}},HAVE_NOTHING:"オーディオ/ビデオが準備できているか情報がありません",HAVE_METADATA:"オーディオ/ビデオのメタデータは準備できています",HAVE_CURRENT_DATA:"現在の再生位置に関するデータは利用可能ですが、次のフレーム/ミリ秒を再生するのに十分なデータがありません",HAVE_FUTURE_DATA:"現在、少なくとも次のフレームのデータが利用可能です",HAVE_ENOUGH_DATA:"利用可能なデータは再生を開始するのに十分です",NETWORK_EMPTY:"オーディオ/ビデオが初期化されていません",NETWORK_IDLE:"オーディオ/ビデオはアクティブでリソースが選択されていますが、ネットワークが使用されていません",NETWORK_LOADING:"ブラウザーはデータをダウンロードしています",NETWORK_NO_SOURCE:"オーディオ/ビデオ のソースが見つかりません",MEDIA_ERR_ABORTED:"ユーザーによってフェッチプロセスが中止されました",MEDIA_ERR_NETWORK:"ダウンロード中にエラーが発生しました",MEDIA_ERR_DECODE:"デコード中にエラーが発生しました",MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ の形式がサポートされていません",REPLAY:"リプレイ",ERROR:"ネットワークの接続に問題が発生しました",PLAY_TIPS:"プレイ",PAUSE_TIPS:"一時停止",PLAYNEXT_TIPS:"次をプレイ",DOWNLOAD_TIPS:"ダウンロード",ROTATE_TIPS:"回転",RELOAD_TIPS:"再読み込み",FULLSCREEN_TIPS:"フルスクリーン",EXITFULLSCREEN_TIPS:"フルスクリーンを終了",CSSFULLSCREEN_TIPS:"シアターモード",EXITCSSFULLSCREEN_TIPS:"シアターモードを終了",TEXTTRACK:"字幕",PIP:"ミニプレーヤー",SCREENSHOT:"スクリーンショット",LIVE:"生放送",OFF:"オフ",OPEN:"開いた",MINI_DRAG:"ボタンを押して働画をドラッグする",MINISCREEN:"小さな画面",REFRESH:"リフレッシュ",REFRESH_TIPS:"してみてください",FORWARD:"早送り",LIVE_TIP:"生放送"}},si={LANG:"br",TEXT:{ERROR_TYPES:{network:{code:1,msg:"erro de download de vídeo"},mse:{code:2,msg:"erro de anexação de fluxo"},parse:{code:3,msg:"erro de análise"},format:{code:4,msg:"formato incorreto"},decoder:{code:5,msg:"erro de decodificação"},runtime:{code:6,msg:"erros gramaticais"},timeout:{code:7,msg:"tempo limite de reprodução"},other:{code:8,msg:"outros erros"}},HAVE_NOTHING:"Não há informações sobre se o áudio/vídeo está pronto",HAVE_METADATA:"Os metadados de áudio/vídeo estão prontos ",HAVE_CURRENT_DATA:"Os dados sobre a localização de reprodução atual estão disponíveis, mas não há dados suficientes para reproduzir o próximo quadro/milissegundo",HAVE_FUTURE_DATA:"Atual e pelo menos um quadro de dados está disponível",HAVE_ENOUGH_DATA:"Os dados disponíveis são suficientes para começar a jogar",NETWORK_EMPTY:"O áudio/vídeo não foi inicializado",NETWORK_IDLE:"O áudio/vídeo está ativo e foi selecionado para recursos, mas nenhuma rede está sendo usada",NETWORK_LOADING:"O navegador está baixando os dados",NETWORK_NO_SOURCE:"Nenhuma fonte de áudio/vídeo foi encontrada",MEDIA_ERR_ABORTED:"O processo de busca é abortado pelo usuário",MEDIA_ERR_NETWORK:"Ocorreu um erro durante o download",MEDIA_ERR_DECODE:"Ocorreu um erro durante a decodificação",MEDIA_ERR_SRC_NOT_SUPPORTED:"Não há suporte para áudio/vídeo",REPLAY:"Repetir",ERROR:"A rede está offline",PLAY_TIPS:"Reproduzir",PAUSE_TIPS:"Pausar",PLAYNEXT_TIPS:"Reproduzir próximo",DOWNLOAD_TIPS:"Baixar",ROTATE_TIPS:"Girar",RELOAD_TIPS:"Recarregar",FULLSCREEN_TIPS:"Tela cheia",EXITFULLSCREEN_TIPS:"Sair da tela cheia",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Sair da cssfullscreen",TEXTTRACK:"Legenda",PIP:"PIP",SCREENSHOT:"Captura de tela",LIVE:"AO VIVO",OFF:"Desligado",OPEN:"Abrir",MINI_DRAG:"Clique e segure para arrastar",MINISCREEN:"Minitela",REFRESH_TIPS:"Tente",REFRESH:"Atualizar",FORWARD:"encaminhar",LIVE_TIP:"Ao vivo"}},ri={LANG:"de",TEXT:{ERROR_TYPES:{network:{code:1,msg:"Fehler beim Herunterladen des Videos"},mse:{code:2,msg:"Fehler beim Anhängen des Streams"},parse:{code:3,msg:"Fehler beim Parsen"},format:{code:4,msg:"falsches Format"},decoder:{code:5,msg:"Dekodierungsfehler"},runtime:{code:6,msg:"grammatikalische Fehler"},timeout:{code:7,msg:"Wiedergabeunterbrechung"},other:{code:8,msg:"andere Fehler"}},HAVE_NOTHING:"Es sind keine Informationen darüber vorhanden, ob Audio/Video wiedergabebereit ist",HAVE_METADATA:"Audio-/Video-Metadaten können genutzt werden ",HAVE_CURRENT_DATA:"Es sind Daten über die aktuelle Wiedergabeposition verfügbar, jedoch reichen diese nicht aus, um den nächsten Frame / die nächste Millisekunde wiederzugeben",HAVE_FUTURE_DATA:"Das aktuelle und mindestens ein Datenframe ist verfügbar",HAVE_ENOUGH_DATA:"Die verfügbaren Daten reichen aus, um die Wiedergabe zu starten",NETWORK_EMPTY:"Audio/Video wurde nicht initialisiert",NETWORK_IDLE:"Audio/Video ist aktiv und wurde für die Ressourcen ausgewählt, aber es wird kein Netzwerk verwendet",NETWORK_LOADING:"Der Browser lädt die Daten herunter",NETWORK_NO_SOURCE:"Keine Audio-/Videoquelle gefunden",MEDIA_ERR_ABORTED:"Der Abrufvorgang wurde vom Benutzer abgebrochen",MEDIA_ERR_NETWORK:"Beim Herunterladen ist ein Fehler aufgetreten",MEDIA_ERR_DECODE:"Bei der Entschlüsselung ist ein Fehler aufgetreten",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/Video wird nicht unterstützt",REPLAY:"Erneute Wiedergabe",ERROR:"Das Netzwerk ist offline",PLAY_TIPS:"Wiedergabe",PAUSE_TIPS:"Anhalten",PLAYNEXT_TIPS:"Nächstes wiedergeben",DOWNLOAD_TIPS:"Herunterladen",ROTATE_TIPS:"Drehen",RELOAD_TIPS:"Neu laden",FULLSCREEN_TIPS:"Vollbildschirm",EXITFULLSCREEN_TIPS:"Vollbildschirm beenden",CSSFULLSCREEN_TIPS:"CSS-Vollbildschirm",EXITCSSFULLSCREEN_TIPS:"CSS-Vollbildschirm beenden",TEXTTRACK:"Beschriftung",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Aus",OPEN:"Öffnen",MINI_DRAG:"Klicken und zum Ziehen halten",MINISCREEN:"Miniaturbildschirm",REFRESH_TIPS:"Bitte versuchen",REFRESH:"Aktualisieren",FORWARD:"weiterleiten",LIVE_TIP:"Live"}},ai={LANG:"es",TEXT:{ERROR_TYPES:{network:{code:1,msg:"error de descarga de vídeo"},mse:{code:2,msg:"error al añadir emisión"},parse:{code:3,msg:"error de análisis"},format:{code:4,msg:"formato incorrecto"},decoder:{code:5,msg:"error de descodificación"},runtime:{code:6,msg:"errores gramaticales"},timeout:{code:7,msg:"tiempo de espera de reproducción agotado"},other:{code:8,msg:"otros errores"}},HAVE_NOTHING:"No hay información sobre si el audio o el vídeo están listos",HAVE_METADATA:"Los metadatos de audio o vídeo están listos ",HAVE_CURRENT_DATA:"Los datos sobre la ubicación de reproducción actual están disponibles, pero no hay suficientes datos para reproducir el siguiente marco/milisegundo",HAVE_FUTURE_DATA:"El marco de datos actual y al menos uno más están disponibles",HAVE_ENOUGH_DATA:"Los datos disponibles son suficientes para iniciar la reproducción",NETWORK_EMPTY:"El audio o el vídeo no se han iniciado",NETWORK_IDLE:"El audio o el vídeo están activos y se han seleccionado para los recursos, pero no se utiliza ninguna red",NETWORK_LOADING:"El navegador está descargando los datos",NETWORK_NO_SOURCE:"No se ha encontrado ninguna fuente de audio o vídeo",MEDIA_ERR_ABORTED:"El usuario ha cancelado el proceso de recuperación",MEDIA_ERR_NETWORK:"Se ha producido un error al descargar",MEDIA_ERR_DECODE:"Se ha producido un error al descodificar",MEDIA_ERR_SRC_NOT_SUPPORTED:"El audio o el vídeo no son compatibles",REPLAY:"Volver a reproducir",ERROR:"La red está fuera de línea",PLAY_TIPS:"Reproducir",PAUSE_TIPS:"Pausar",PLAYNEXT_TIPS:"Reproducir siguiente",DOWNLOAD_TIPS:"Descargar",ROTATE_TIPS:"Girar",RELOAD_TIPS:"Cargar de nuevo",FULLSCREEN_TIPS:"Pantalla completa",EXITFULLSCREEN_TIPS:"Salir de la pantalla completa",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Salir de cssfullscreen",TEXTTRACK:"Subtítulo",PIP:"PIP",SCREENSHOT:"Captura de pantalla",LIVE:"EN DIRECTO",OFF:"Desactivado",OPEN:"Abrir",MINI_DRAG:"Haz clic y mantén pulsado para arrastrar",MINISCREEN:"Minipantalla",REFRESH_TIPS:"Inténtalo",REFRESH:"Volver a cargar",FORWARD:"reenviar",LIVE_TIP:"En directo"}},li={LANG:"fr",TEXT:{ERROR_TYPES:{network:{code:1,msg:"erreur de téléchargement vidéo"},mse:{code:2,msg:"erreur d'ajout du stream"},parse:{code:3,msg:"erreur d'analyse"},format:{code:4,msg:"format erroné"},decoder:{code:5,msg:"erreur de décodage"},runtime:{code:6,msg:"erreurs grammaticales"},timeout:{code:7,msg:"lecture expirée"},other:{code:8,msg:"autres erreurs"}},HAVE_NOTHING:"Il n'y a pas d'information sur la disponibilité de l'audio/vidéo",HAVE_METADATA:"Les métadonnées audio/vidéo sont prêtes ",HAVE_CURRENT_DATA:"Les données relatives à l'emplacement de lecture actuel sont disponibles, mais les données ne sont pas suffisantes pour lire l'image/la milliseconde suivante",HAVE_FUTURE_DATA:"Trame de données actuelles (au moins une) disponible",HAVE_ENOUGH_DATA:"Les données disponibles sont suffisantes pour démarrer la lecture",NETWORK_EMPTY:"L'audio/vidéo n'a pas été initialisé",NETWORK_IDLE:"L'audio/vidéo est actif et a été sélectionné comme ressource, mais aucun réseau n'est utilisé",NETWORK_LOADING:"Le navigateur télécharge les données",NETWORK_NO_SOURCE:"Aucune source audio/vidéo n'a été trouvée",MEDIA_ERR_ABORTED:"Le processus de recherche est interrompu par l'utilisateur",MEDIA_ERR_NETWORK:"Une erreur s'est produite lors du téléchargement",MEDIA_ERR_DECODE:"Une erreur s'est produite lors du décodage",MEDIA_ERR_SRC_NOT_SUPPORTED:"L'audio/vidéo n'est pas pris en charge",REPLAY:"Relancer",ERROR:"Le réseau est hors ligne",PLAY_TIPS:"Lire",PAUSE_TIPS:"Mettre en pause",PLAYNEXT_TIPS:"Lire l'élément suivant",DOWNLOAD_TIPS:"Télécharger",ROTATE_TIPS:"Pivoter",RELOAD_TIPS:"Actualiser",FULLSCREEN_TIPS:"Plein écran",EXITFULLSCREEN_TIPS:"Quitter le plein écran",CSSFULLSCREEN_TIPS:"Plein écran css",EXITCSSFULLSCREEN_TIPS:"Quitter le plein écran css",TEXTTRACK:"Légende",PIP:"PIP",SCREENSHOT:"Capture d'écran",LIVE:"EN DIRECT",OFF:"Désactivé",OPEN:"Ouvrir",MINI_DRAG:"Cliquer et maintenir pour faire glisser",MINISCREEN:"Mini écran",REFRESH_TIPS:"Essayez",REFRESH:"Actualiser",FORWARD:"transférer",LIVE_TIP:"En direct"}},ui={LANG:"id",TEXT:{ERROR_TYPES:{network:{code:1,msg:"kesalahan unduh video"},mse:{code:2,msg:"kesalahan penambahan stream"},parse:{code:3,msg:"kesalahan penguraian"},format:{code:4,msg:"format salah"},decoder:{code:5,msg:"kesalahan dekode"},runtime:{code:6,msg:"kesalahan tata bahasa"},timeout:{code:7,msg:"waktu pemutaran habis"},other:{code:8,msg:"kesalahan lainnya"}},HAVE_NOTHING:"Tidak ada informasi mengenai apakah audio/video sudah siap",HAVE_METADATA:"Metadata audio/video siap ",HAVE_CURRENT_DATA:"Data mengenai lokasi pemutaran saat ini tersedia, tetapi data tidak cukup untuk memutar bingkai berikutnya/milidetik",HAVE_FUTURE_DATA:"Data saat ini dan setidaknya satu bingkai data tersedia",HAVE_ENOUGH_DATA:"Data yang tersedia cukup untuk mulai memutar",NETWORK_EMPTY:"Audio/video belum diinisialisasi",NETWORK_IDLE:"Audio/video sedang aktif dan telah dipilih untuk sumber daya, tetapi tidak ada jaringan yang digunakan",NETWORK_LOADING:"Peramban sedang mengunduh data",NETWORK_NO_SOURCE:"Tidak ada sumber audio/video yang ditemukan",MEDIA_ERR_ABORTED:"Proses pengambilan dihentikan oleh pengguna",MEDIA_ERR_NETWORK:"Terjadi kesalahan ketika mengunduh",MEDIA_ERR_DECODE:"Terjadi kesalahan ketika mendekode",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video tidak didukung",REPLAY:"Putar ulang",ERROR:"Jaringan offline",PLAY_TIPS:"Putar",PAUSE_TIPS:"Jeda",PLAYNEXT_TIPS:"Putar berikutnya",DOWNLOAD_TIPS:"Unduh",ROTATE_TIPS:"Putar",RELOAD_TIPS:"Muat ulang",FULLSCREEN_TIPS:"Layar penuh",EXITFULLSCREEN_TIPS:"Keluar dari layar penuh",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Keluar dari cssfullscreen",TEXTTRACK:"Keterangan",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LANGSUNG",OFF:"Tidak Aktif",OPEN:"Buka",MINI_DRAG:"Klik dan tahan untuk menarik",MINISCREEN:"Layar mini",REFRESH_TIPS:"Silakan Coba",REFRESH:"Segarkan",FORWARD:"teruskan",LIVE_TIP:"Langsung"}},ci={LANG:"it",TEXT:{ERROR_TYPES:{network:{code:1,msg:"errore di download del video"},mse:{code:2,msg:"errore di accodamento del flusso"},parse:{code:3,msg:"errore di analisi"},format:{code:4,msg:"formato errato"},decoder:{code:5,msg:"errore di decodifica"},runtime:{code:6,msg:"errori grammaticali"},timeout:{code:7,msg:"timeout della riproduzione"},other:{code:8,msg:"altri errori"}},HAVE_NOTHING:"Non ci sono informazioni che indichino se l'audio/il video è pronto",HAVE_METADATA:"I metadati audio/video sono pronti ",HAVE_CURRENT_DATA:"I dati sulla posizione corrente di riproduzione sono disponibili, ma non ci sono dati sufficienti per riprodurre il prossimo frame/millisecondo",HAVE_FUTURE_DATA:"Corrente e almeno un frame di dati è disponibile",HAVE_ENOUGH_DATA:"I dati disponibili sono sufficienti per avviare la riproduzione",NETWORK_EMPTY:"L'audio/Il video non è stato inizializzato",NETWORK_IDLE:"L'audio/Il video è attivo ed è stato selezionato per le risorse, ma non viene utilizzata alcuna rete",NETWORK_LOADING:"Il browser sta scaricando i dati",NETWORK_NO_SOURCE:"Nessuna origine audio/video trovata",MEDIA_ERR_ABORTED:"Il processo di recupero è stato interrotto dall'utente",MEDIA_ERR_NETWORK:"Si è verificato un errore durante il download",MEDIA_ERR_DECODE:"Si è verificato un errore durante la decodificazione",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/Video non supportato",REPLAY:"Riproduci di nuovo",ERROR:"Rete offline",PLAY_TIPS:"Riproduci",PAUSE_TIPS:"Sospendi",PLAYNEXT_TIPS:"Riproduci successivo",DOWNLOAD_TIPS:"Scarica",ROTATE_TIPS:"Ruota",RELOAD_TIPS:"Ricarica",FULLSCREEN_TIPS:"Schermo intero",EXITFULLSCREEN_TIPS:"Esci dallo schermo intero",CSSFULLSCREEN_TIPS:"Schermo intero CSS",EXITCSSFULLSCREEN_TIPS:"Esci dallo schermo intero CSS",TEXTTRACK:"Didascalia",PIP:"Immagine nell'immagine",SCREENSHOT:"Screenshot",LIVE:"IN DIRETTA",OFF:"Inattivo",OPEN:"Apri",MINI_DRAG:"Fai clic e tieni premuto per trascinare",MINISCREEN:"Minischermo",REFRESH_TIPS:"Prova",REFRESH:"Aggiorna",FORWARD:"inoltra",LIVE_TIP:"In diretta"}},hi={LANG:"kr",TEXT:{ERROR_TYPES:{network:{code:1,msg:"동영상 다운로드 오류"},mse:{code:2,msg:"스트림 추가 오류"},parse:{code:3,msg:"구문 분석 오류"},format:{code:4,msg:"잘못된 형식"},decoder:{code:5,msg:"디코딩 오류"},runtime:{code:6,msg:"문법 오류"},timeout:{code:7,msg:"재생 시간 초과"},other:{code:8,msg:"기타 오류"}},HAVE_NOTHING:"오디오/동영상 준비 여부에 대한 정보가 없습니다",HAVE_METADATA:"오디오/동영상 메타데이터가 준비되었습니다 ",HAVE_CURRENT_DATA:"현재 재생 위치에 대한 데이터를 사용할 수 있지만 다음 프레임/밀리초를 재생하기에는 데이터가 충분하지 않습니다",HAVE_FUTURE_DATA:"현재 및 하나 이상의 데이터 프레임을 사용할 수 있습니다",HAVE_ENOUGH_DATA:"사용 가능한 데이터가 재생을 시작하기에 충분합니다",NETWORK_EMPTY:"오디오/동영상이 초기화되지 않았습니다",NETWORK_IDLE:"오디오/동영상이 활성 상태이고 리소스에 대해 선택되었지만 네트워크가 사용되지 않습니다",NETWORK_LOADING:"브라우저에서 데이터를 다운로드하고 있습니다",NETWORK_NO_SOURCE:"오디오/동영상 소스를 찾을 수 없습니다",MEDIA_ERR_ABORTED:"사용자가 가져오기 처리 과정을 중단했습니다",MEDIA_ERR_NETWORK:"다운로드하는 동안 오류가 발생했습니다",MEDIA_ERR_DECODE:"디코딩하는 동안 오류가 발생했습니다",MEDIA_ERR_SRC_NOT_SUPPORTED:"오디오/동영상이 지원되지 않습니다",REPLAY:"재생",ERROR:"네트워크가 오프라인 상태입니다",PLAY_TIPS:"재생",PAUSE_TIPS:"일시 정지",PLAYNEXT_TIPS:"다음 재생",DOWNLOAD_TIPS:"다운로드",ROTATE_TIPS:"회전",RELOAD_TIPS:"다시 로드",FULLSCREEN_TIPS:"전체 화면",EXITFULLSCREEN_TIPS:"전체 화면 종료",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"cssfullscreen 종료",TEXTTRACK:"캡션",PIP:"PIP",SCREENSHOT:"스크린샷",LIVE:"라이브",OFF:"끄기",OPEN:"열기",MINI_DRAG:"클릭하고 길게 눌러 드래그",MINISCREEN:"미니스크린",REFRESH_TIPS:"시도해 보세요",REFRESH:"새로 고침",FORWARD:"전달",LIVE_TIP:"라이브"}},di={LANG:"ms-my",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ralat muat turun video"},mse:{code:2,msg:"ralat menambahkan aliran"},parse:{code:3,msg:"ralat penghuraian"},format:{code:4,msg:"format salah"},decoder:{code:5,msg:"ralat mendekod"},runtime:{code:6,msg:"kesalahan tatabahasa"},timeout:{code:7,msg:"masa putar habis"},other:{code:8,msg:"kesalahan lain"}},HAVE_NOTHING:"Tiada maklumat sama ada audio/video sedia",HAVE_METADATA:"Metadata audio/video sedia ",HAVE_CURRENT_DATA:"Data tentang lokasi putar semasa tersedia, tetapi tidak cukup data untuk memainkan bingkai/milidetik seterusnya",HAVE_FUTURE_DATA:"Data semasa dan sekurang-kurangnya satu bingkai tersedia",HAVE_ENOUGH_DATA:"Data yang tersedia mencukupi untuk memulakan permainan",NETWORK_EMPTY:"Audio/video belum diinisialisasi",NETWORK_IDLE:"Audio/video aktif dan telah dipilih untuk sumber, tetapi tiada rangkaian digunakan",NETWORK_LOADING:"Pelayar sedang memuat turun data",NETWORK_NO_SOURCE:"Tiada sumber audio/video ditemui",MEDIA_ERR_ABORTED:"Proses pengambilan dibatalkan oleh pengguna",MEDIA_ERR_NETWORK:"Ralat berlaku semasa muat turun",MEDIA_ERR_DECODE:"Ralat berlaku semasa mendekod",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video tidak disokong",REPLAY:"Main semula",ERROR:"Rangkaian offline",PLAY_TIPS:"Putar",PAUSE_TIPS:"Jeda",PLAYNEXT_TIPS:"Putar seterusnya",DOWNLOAD_TIPS:"Muat turun",ROTATE_TIPS:"Putar",RELOAD_TIPS:"Muat semula",FULLSCREEN_TIPS:"Skrin penuh",EXITFULLSCREEN_TIPS:"Keluar skrin penuh",CSSFULLSCREEN_TIPS:"Cssskrin penuh",EXITCSSFULLSCREEN_TIPS:"Keluar cssskrin penuh",TEXTTRACK:"Kapsyen",PIP:"PIP",SCREENSHOT:"Tangkapan skrin",LIVE:"LIVE",OFF:"Matikan",OPEN:"Buka",MINI_DRAG:"Klik dan tahan untuk seret",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Sila Cuba",REFRESH:"Segarkan",FORWARD:"ke hadapan",LIVE_TIP:"Langsung"}},fi={LANG:"ru",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ошибка загрузки видео"},mse:{code:2,msg:"ошибка добавления потока"},parse:{code:3,msg:"ошибка синтаксического разбора"},format:{code:4,msg:"неверный формат"},decoder:{code:5,msg:"ошибка декодирования"},runtime:{code:6,msg:"грамматические ошибки"},timeout:{code:7,msg:"тайм-аут воспроизведения"},other:{code:8,msg:"прочие ошибки"}},HAVE_NOTHING:"Нет информации о готовности аудио/видео",HAVE_METADATA:"Метаданные аудио/видео готовы ",HAVE_CURRENT_DATA:"Данные о текущем месте воспроизведения доступны, но недостаточно данных для воспроизведения следующего кадра/миллисекунды",HAVE_FUTURE_DATA:"Доступен текущий и как минимум один кадр данных",HAVE_ENOUGH_DATA:"Доступных данных достаточно для начала воспроизведения",NETWORK_EMPTY:"Аудио/видео не инициализировано",NETWORK_IDLE:"Аудио/видео активны и выбраны для ресурсов, но сеть не используется",NETWORK_LOADING:"Браузер загружает данные",NETWORK_NO_SOURCE:"Источник аудио/видео не найден",MEDIA_ERR_ABORTED:"Процесс выборки прерван пользователем",MEDIA_ERR_NETWORK:"Произошла ошибка при загрузке",MEDIA_ERR_DECODE:"Произошла ошибка при декодировании",MEDIA_ERR_SRC_NOT_SUPPORTED:"Аудио/видео не поддерживается",REPLAY:"Повторить воспроизведение",ERROR:"Сеть не подключена",PLAY_TIPS:"Воспроизвести",PAUSE_TIPS:"Пауза",PLAYNEXT_TIPS:"Воспроизвести следующее",DOWNLOAD_TIPS:"Загрузить",ROTATE_TIPS:"Повернуть",RELOAD_TIPS:"Перезагрузить",FULLSCREEN_TIPS:"Полный экран",EXITFULLSCREEN_TIPS:"Выйти из полноэкранного режима",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Выход из cssfullscreen",TEXTTRACK:"Субтитры",PIP:"Картинка в картинке",SCREENSHOT:"Снимок экрана",LIVE:"В ЭФИРЕ",OFF:"Выкл",OPEN:"Открыть",MINI_DRAG:"Щелкните и удерживайте, чтобы переместить",MINISCREEN:"Мини-экран",REFRESH_TIPS:"Попробуйте",REFRESH:"Обновить",FORWARD:"переслать",LIVE_TIP:"В эфире"}},pi={LANG:"th",TEXT:{ERROR_TYPES:{network:{code:1,msg:"เกิดข้อผิดพลาดในการดาวน์โหลดวิดีโอ"},mse:{code:2,msg:"เกิดข้อผิดพลาดในการผนวกสตรีม"},parse:{code:3,msg:"เกิดข้อผิดพลาดในการแยกวิเคราะห์"},format:{code:4,msg:"รูปแบบไม่ถูกต้อง"},decoder:{code:5,msg:"เกิดข้อผิดพลาดในการถอดรหัส"},runtime:{code:6,msg:"เกิดข้อผิดพลาดทางไวยากรณ์"},timeout:{code:7,msg:"หมดเวลาเล่น"},other:{code:8,msg:"ข้อผิดพลาดอื่น ๆ"}},HAVE_NOTHING:"ไม่มีข้อมูลความพร้อมของเสียง/วิดีโอ",HAVE_METADATA:"ข้อมูลของข้อมูลเสียง/วิดีโอพร้อมแล้ว ",HAVE_CURRENT_DATA:"มีข้อมูลตำแหน่งการเล่นปัจจุบัน แต่มีข้อมูลไม่พอที่จะเล่นเฟรม/มิลลิวินาทีถัดไป",HAVE_FUTURE_DATA:"มีเฟรมข้อมูลปัจจุบันอย่างน้อยหนึ่งเฟรม",HAVE_ENOUGH_DATA:"ข้อมูลที่มีอยู่เพียงพอที่จะเริ่มเล่น",NETWORK_EMPTY:"ยังไม่ได้เริ่มต้นเสียง/วิดีโอ",NETWORK_IDLE:"เสียง/วิดีโอใช้งานอยู่และเลือกไว้ใช้กับทรัพยากร แต่ไม่มีการใช้เครือข่าย",NETWORK_LOADING:"เบราว์เซอร์กำลังดาวน์โหลดข้อมูล",NETWORK_NO_SOURCE:"ไม่พบแหล่งเสียง/วิดีโอ",MEDIA_ERR_ABORTED:"ผู้ใช้ยกเลิกกระบวนการดึงแล้ว",MEDIA_ERR_NETWORK:"เกิดข้อผิดพลาดขณะดาวน์โหลด",MEDIA_ERR_DECODE:"เกิดข้อผิดพลาดขณะถอดรหัส",MEDIA_ERR_SRC_NOT_SUPPORTED:"ไม่รองรับเสียง/วิดีโอ",REPLAY:"เล่นซ้ำ",ERROR:"เครือข่ายออฟไลน์อยู่",PLAY_TIPS:"เล่น",PAUSE_TIPS:"หยุดชั่วคราว",PLAYNEXT_TIPS:"เล่นรายการถัดไป",DOWNLOAD_TIPS:"ดาวน์โหลด",ROTATE_TIPS:"หมุน",RELOAD_TIPS:"โหลดใหม่",FULLSCREEN_TIPS:"เต็มหน้าจอ",EXITFULLSCREEN_TIPS:"ออกจากโหมดเต็มหน้าจอ",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"ออกจาก cssfullscreen",TEXTTRACK:"คำบรรยาย",PIP:"PIP",SCREENSHOT:"ภาพหน้าจอ",LIVE:"สด",OFF:"ปิด",OPEN:"เปิด",MINI_DRAG:"คลิกค้างไว้เพื่อลาก",MINISCREEN:"จอเล็ก",REFRESH_TIPS:"โปรดลอง",REFRESH:"รีเฟรช",FORWARD:"ส่งต่อ",LIVE_TIP:"สด"}},gi={LANG:"vn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"lỗi tải video về"},mse:{code:2,msg:"lỗi nối luồng"},parse:{code:3,msg:"lỗi phân tích cú pháp"},format:{code:4,msg:"sai định dạng"},decoder:{code:5,msg:"lỗi giải mã"},runtime:{code:6,msg:"lỗi ngữ pháp"},timeout:{code:7,msg:"hết thời gian phát"},other:{code:8,msg:"lỗi khác"}},HAVE_NOTHING:"Không có thông tin về việc âm thanh/video đã sẵn sàng hay chưa",HAVE_METADATA:"Siêu dữ liệu về âm thanh/video đã sẵn sàng ",HAVE_CURRENT_DATA:"Đã có dữ liệu về vị trí phát hiện tại, nhưng không có đủ dữ liệu để phát khung hình/mili giây tiếp theo",HAVE_FUTURE_DATA:"Hiện tại và có ít nhất một khung dữ liệu khả dụng",HAVE_ENOUGH_DATA:"Dữ liệu khả dụng đã đủ để bắt đầu phát",NETWORK_EMPTY:"Chưa khởi tạo âm thanh/video",NETWORK_IDLE:"Âm thanh/video đang hoạt động và đã được chọn làm tài nguyên nhưng không có mạng nào được sử dụng",NETWORK_LOADING:"Trình duyệt đang tải dữ liệu về",NETWORK_NO_SOURCE:"Không tìm thấy nguồn âm thanh/video",MEDIA_ERR_ABORTED:"Người dùng đã hủy bỏ quy trình tìm nạp",MEDIA_ERR_NETWORK:"Đã xảy ra lỗi khi tải về",MEDIA_ERR_DECODE:"Đã xảy ra lỗi khi giải mã",MEDIA_ERR_SRC_NOT_SUPPORTED:"Âm thanh/video không được hỗ trợ",REPLAY:"Phát lại",ERROR:"Mạng đang ngoại tuyến",PLAY_TIPS:"Phát",PAUSE_TIPS:"Tạm dừng",PLAYNEXT_TIPS:"Phát tiếp",DOWNLOAD_TIPS:"Tải về",ROTATE_TIPS:"Xoay",RELOAD_TIPS:"Tải lại",FULLSCREEN_TIPS:"Toàn màn hình",EXITFULLSCREEN_TIPS:"Thoát chế độ toàn màn hình",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Thoát chế độ cssfullscreen",TEXTTRACK:"Chú thích",PIP:"PIP",SCREENSHOT:"Ảnh chụp màn hình",LIVE:"TRỰC TIẾP",OFF:"Tắt",OPEN:"Mở",MINI_DRAG:"Nhấp giữ để kéo",MINISCREEN:"Màn hình nhỏ",REFRESH_TIPS:"Vui lòng thử",REFRESH:"Làm mới",FORWARD:"chuyển tiếp",LIVE_TIP:"Phát trực tiếp"}},vi=i(6704),mi=i.n(vi),yi=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).set={speed:1,area:{},opacity:1,fonSize:"middle"},o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){"mobile"===c.device?this.activeEvent="click":this.activeEvent="mouseenter",this.onStateChange=this.onStateChange.bind(this),this.onToggle=this.onToggle.bind(this),this.bind(this.activeEvent,this.onToggle),this.bind("mouseleave",this.onToggle),this.appendChild(".xgplayer-panel-icon",(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -11 40 40" width="40" height="40">\n <path fill="#f85959" transform="scale(0.8 0.8)" d="M36.5,18.73a1.19,1.19,0,0,0,1-1.14V16.33a1.2,1.2,0,0,0-1-1.13l-.61-.08a1.75,1.75,0,0,1-1.3-.86l-.21-.36-.2-.36A1.72,1.72,0,0,1,34,12l.23-.58a1.18,1.18,0,0,0-.5-1.42l-1.1-.62a1.18,1.18,0,0,0-1.47.3l-.39.51a1.82,1.82,0,0,1-1.41.72c-.44,0-1.88-.27-2.22-.7l-.39-.49a1.18,1.18,0,0,0-1.48-.28l-1.09.64a1.19,1.19,0,0,0-.47,1.43l.25.59a1.87,1.87,0,0,1-.08,1.58c-.26.37-1.17,1.5-1.71,1.58l-.63.09a1.19,1.19,0,0,0-1,1.14l0,1.27a1.17,1.17,0,0,0,1,1.12l.61.08a1.74,1.74,0,0,1,1.3.87l.21.36.2.35A1.69,1.69,0,0,1,24,22.08l-.23.59a1.19,1.19,0,0,0,.5,1.42l1.1.62a1.19,1.19,0,0,0,1.48-.31l.38-.5a1.83,1.83,0,0,1,1.41-.72c.44,0,1.88.25,2.22.69l.39.49a1.18,1.18,0,0,0,1.48.28L33.86,24a1.19,1.19,0,0,0,.47-1.43L34.09,22a1.84,1.84,0,0,1,.07-1.58c.26-.37,1.17-1.5,1.72-1.58ZM31,18.94a2.76,2.76,0,0,1-4.65-1.2A2.71,2.71,0,0,1,27,15.13a2.76,2.76,0,0,1,4.64,1.2A2.7,2.7,0,0,1,31,18.94Z"/>\n <path fill="#f85959" transform="scale(0.8 0.8)" d="M32,0H3.59A3.59,3.59,0,0,0,0,3.59v17A3.59,3.59,0,0,0,3.59,24.2H19.72a12.59,12.59,0,0,1-.81-1.2A11.73,11.73,0,0,1,35.54,7.28V3.59A3.59,3.59,0,0,0,32,0ZM13,14.18H4.29a1.52,1.52,0,0,1,0-3H13a1.52,1.52,0,0,1,0,3ZM16.45,8H4.29a1.51,1.51,0,0,1,0-3H16.45a1.51,1.51,0,1,1,0,3Z"/>\n</svg>\n',"image/svg+xml").firstChild)}},{key:"onStateChange",value:function(e){this.config.onChangeSet&&this.config.onChangeSet(this.set)}},{key:"onToggle",value:function(e){e.preventDefault(),e.stopPropagation(),r.Ay.hasClass(this.root,"slider-show")?r.Ay.removeClass(this.root,"slider-show"):r.Ay.addClass(this.root,"slider-show")}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.onStateChange)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-panel">\n <xg-panel-icon class="xgplayer-panel-icon">\n </xg-panel-icon>\n <xg-panel-slider class="xgplayer-panel-slider">\n <xg-hidemode class="xgplayer-hidemode">\n <p class="xgplayer-hidemode-font">屏蔽类型</p>\n <ul class="xgplayer-hidemode-radio">\n <li class="xgplayer-hidemode-scroll" id="false">滚动</li><li class="xgplayer-hidemode-top" id="false">顶部</li><li class="xgplayer-hidemode-bottom" id="false">底部</li><li class="xgplayer-hidemode-color" id="false">色彩</li>\n </ul>\n </xg-hidemode>\n <xg-transparency class="xgplayer-transparency">\n <span>不透明度</span>\n <input class="xgplayer-transparency-line xgplayer-transparency-color xgplayer-transparency-bar xgplayer-transparency-gradient" type="range" min="0" max="100" step="0.1" value="50"></input>\n </xg-transparency>\n <xg-showarea class="xgplayer-showarea">\n <div class="xgplayer-showarea-name">显示区域</div>\n <div class="xgplayer-showarea-control">\n <div class="xgplayer-showarea-control-up">\n <span class="xgplayer-showarea-control-up-item xgplayer-showarea-onequarters">1/4</span>\n <span class="xgplayer-showarea-control-up-item xgplayer-showarea-twoquarters selected-color">1/2</span>\n <span class="xgplayer-showarea-control-up-item xgplayer-showarea-threequarters">3/4</span>\n <span class="xgplayer-showarea-control-up-item xgplayer-showarea-full">1</span>\n </div>\n <div class="xgplayer-showarea-control-down">\n <div class="xgplayer-showarea-control-down-dots">\n <span class="xgplayer-showarea-onequarters-dot"></span>\n <span class="xgplayer-showarea-twoquarters-dot"></span>\n <span class="xgplayer-showarea-threequarters-dot"></span>\n <span class="xgplayer-showarea-full-dot"></span>\n </div>\n <input class="xgplayer-showarea-line xgplayer-showarea-color xgplayer-showarea-bar xgplayer-gradient" type="range" min="1" max="4" step="1" value="1">\n </div>\n </div>\n </xg-showarea>\n <xg-danmuspeed class="xgplayer-danmuspeed">\n <div class="xgplayer-danmuspeed-name">弹幕速度</div>\n <div class="xgplayer-danmuspeed-control">\n <div class="xgplayer-danmuspeed-control-up">\n <span class="xgplayer-danmuspeed-control-up-item xgplayer-danmuspeed-small">慢</span>\n <span class="xgplayer-danmuspeed-control-up-item xgplayer-danmuspeed-middle selected-color">中</span>\n <span class="xgplayer-danmuspeed-control-up-item xgplayer-danmuspeed-large">快</span>\n </div>\n <div class="xgplayer-danmuspeed-control-down">\n <div class="xgplayer-danmuspeed-control-down-dots">\n <span class="xgplayer-danmuspeed-small-dot"></span>\n <span class="xgplayer-danmuspeed-middle-dot"></span>\n <span class="xgplayer-danmuspeed-large-dot"></span>\n </div>\n <input class="xgplayer-danmuspeed-line xgplayer-danmuspeed-color xgplayer-danmuspeed-bar xgplayer-gradient" type="range" min="50" max="150" step="50" value="100">\n </div>\n </div>\n </xg-danmuspeed>\n <xg-danmufont class="xgplayer-danmufont">\n <div class="xgplayer-danmufont-name">字体大小</div>\n <div class="xgplayer-danmufont-control">\n <div class="xgplayer-danmufont-control-up">\n <span class="xgplayer-danmufont-control-up-item xgplayer-danmufont-small">小</span>\n <span class="xgplayer-danmufont-control-up-item xgplayer-danmufont-middle">中</span>\n <span class="xgplayer-danmufont-control-up-item xgplayer-danmufont-large selected-color">大</span>\n </div>\n <div class="xgplayer-danmufont-control-down">\n <div class="xgplayer-danmufont-control-down-dots">\n <span class="xgplayer-danmufont-small-dot"></span>\n <span class="xgplayer-danmufont-middle-dot"></span>\n <span class="xgplayer-danmufont-large-dot"></span>\n </div>\n <input class="xgplayer-danmufont-line xgplayer-danmufont-color xgplayer-danmufont-bar xgplayer-gradient" type="range" min="20" max="30" step="5" value="25">\n </div>\n </div>\n </xg-danmufont>\n </xg-panel-slider>\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"danmuPanel"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:11,onChangeSet:function(e){console.log("DanmuPanel:".concat(e))},speed:1,area:{},opacity:1,fonSize:"middle"}}}]),i}(I),_i='<dk-switch class="danmu-switch">\n<span class="txt">弹</span>\n</dk-switch>',ki=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){return(0,n.xs)(this,i),t.apply(this,arguments)}return(0,n.j6)(i,[{key:"afterCreate",value:function(){this.initIcons(),this.onStateChange=this.onStateChange.bind(this),this.bind(["click","touchend"],this.onStateChange)}},{key:"registerIcons",value:function(){return{openDanmu:{icon:_i,class:"danmu-switch-open"},closeDanmu:{icon:_i,class:"danmu-switch-closed"}}}},{key:"switchState",value:function(e){e?this.setAttr("data-state","active"):this.setAttr("data-state","normal"),this.switchTips(e)}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.openDanmu),t.appendChild(e.closeDanmu)}},{key:"switchTips",value:function(e){var t=this.find(".xg-tips");t&&this.changeLangTextKey(t,e?"OFF":"OPEN")}},{key:"onStateChange",value:function(e){e.preventDefault(),e.stopPropagation();var t="active"===this.root.getAttribute("data-state");this.switchState(!t),this.config.onSwitch&&this.config.onSwitch(e,!t)}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){return'\n <xg-icon class="danmu-icon">\n <div class="xgplayer-icon">\n </div>\n '.concat(ee(this,"OPEN",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"danmuIcon"}},{key:"defaultConfig",get:function(){return{position:C.CONTROLS_RIGHT,index:11,onSwitch:function(e,t){}}}}]),i}(I),Ti=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).danmujs=null,o.danmuPanel=null,o.isOpen=!1,o.seekCost=0,o.intervalId=0,o.isUseClose=!1,o}return(0,n.j6)(i,[{key:"afterCreate",value:function(){var e=this;this.playerConfig.isLive&&(this.config.isLive=!0),this.initDanmu(),this.registerExtIcons(),this.once(d.TIME_UPDATE,(function(){e.config.defaultOpen&&!e.isUseClose&&e.start()})),this.on(d.PAUSE,(function(){e.isOpen&&e.danmujs&&e.danmujs.pause()})),this.on(d.PLAY,(function(){e.isOpen&&e.danmujs&&e.danmujs.play()})),this.on(d.SEEKING,(function(){e.seekCost=window.performance.now(),!e.config.isLive&&e.danmujs&&e.danmujs.stop()})),this.on(d.VIDEO_RESIZE,(function(){e.resize()})),this.on(d.SEEKED,(function(){if(e.danmujs&&e.isOpen){e.intervalId&&(r.Ay.clearTimeout(e,e.intervalId),e.intervalId=null);var t=window.performance.now()-e.seekCost>300?100:300;e.intervalId=r.Ay.setTimeout(e,(function(){e.danmujs.start(),e.intervalId=null,e.player.paused&&e.danmujs.pause()}),t)}}))}},{key:"onPluginsReady",value:function(){var e=this.player.plugins.pc;e&&(e.onVideoDblClick&&this.bind("dblclick",e.onVideoDblClick),e.onVideoClick&&this.bind("click",e.onVideoClick))}},{key:"initDanmu",value:function(){var e=this.player,t=this.config,i=this.config,n=i.channelSize,o=i.fontSize,s=i.opacity,r=i.mouseControl,a=i.mouseControlPause,l=i.area,u=i.defaultOff,c={container:this.root,player:e.media,comments:this.config.comments,live:t.isLive,defaultOff:u,area:l,mouseControl:r,mouseControlPause:a};t.ext&&Object.keys(t.ext).map((function(e){c[e]=t.ext[e]}));var h=new(mi())(c);this.danmujs=h,e.danmu=h,this.setFontSize(o,n),this.setArea(l),this.resize(),1!==s&&this.setOpacity(s)}},{key:"registerExtIcons",value:function(){var e=this,t=this.player,i=this.config;if(i.panel&&t.controls){var n={config:{onChangeset:function(t){e.changeSet(t)}}};this.danmuPanel=t.controls.registerPlugin(yi,n,yi.pluginName)}var o=i.switchConfig;if(!i.closeDefaultBtn&&t.controls){var s={config:{onSwitch:function(t,i){e.onSwitch(t,i)}}};Object.keys(o).map((function(e){s.config[e]=o[e]})),this.danmuButton=t.controls.registerPlugin(ki,s,ki.pluginName),this.config.defaultOpen&&this.danmuButton.switchState(!0)}}},{key:"changeSet",value:function(e){}},{key:"onSwitch",value:function(e,t){this.emitUserAction(e,"switch_danmu",{prop:"isOpen",from:!t,to:t}),t?this.start():this.stop()}},{key:"start",value:function(){var e=this;!this.isOpen&&this.danmujs&&(this.isUseClose=!1,this.show(),this.resize(),r.Ay.setTimeout(this,(function(){e.danmujs.start(),e.player.paused&&e.danmujs.pause(),e.isOpen=!0}),0))}},{key:"stop",value:function(){this.isUseClose=!0,this.isOpen&&this.danmujs&&(this.danmujs.stop(),this.config.isLive&&this.clear(),this.isOpen=!1,this.hide())}},{key:"clear",value:function(){this.danmujs&&this.danmujs.clear()}},{key:"setCommentLike",value:function(e,t){this.danmujs&&this.danmujs.setCommentLike(e,t)}},{key:"setCommentDuration",value:function(e,t){this.danmujs&&this.danmujs.setCommentDuration(e,t)}},{key:"setAllDuration",value:function(e,t){this.danmujs&&this.danmujs.setAllDuration(e,t)}},{key:"setCommentID",value:function(e,t){this.danmujs&&this.danmujs.setCommentID(e,t)}},{key:"hideMode",value:function(e){this.danmujs&&this.danmujs.hide(e)}},{key:"showMode",value:function(e){this.danmujs&&this.danmujs.show(e)}},{key:"setArea",value:function(e){this.danmujs&&this.danmujs.setArea(e)}},{key:"setOpacity",value:function(e){this.danmujs&&this.danmujs.setOpacity(e)}},{key:"setFontSize",value:function(e,t){this.danmujs&&this.danmujs.setFontSize(e,t)}},{key:"resize",value:function(){this.danmujs&&this.danmujs.resize()}},{key:"sendComment",value:function(e){this.danmujs&&this.danmujs.sendComment(e)}},{key:"updateComments",value:function(e,t){this.danmujs&&this.danmujs.updateComments(e,t)}},{key:"hideIcon",value:function(){this.danmuButton&&this.danmuButton.hide()}},{key:"showIcon",value:function(){this.danmuButton&&this.danmuButton.show()}},{key:"destroy",value:function(){this.danmujs.stop(),this.danmujs.destroy(),this.danmujs=null,this.player.danmu=null;var e=this.danmuButton,t=this.danmuPanel;this.danmuButton&&this.danmuButton.root&&e.__destroy&&e.__destroy(),this.danmuPanel&&this.danmuPanel.root&&t.__destroy&&t.__destroy(),this.danmuButton=null,this.danmuPanel=null}},{key:"render",value:function(){return'<xg-danmu class="xgplayer-danmu">\n </xg-danmu>'}}],[{key:"pluginName",get:function(){return"danmu"}},{key:"defaultConfig",get:function(){return{comments:[],area:{start:0,end:1},closeDefaultBtn:!1,defaultOff:!1,panel:!1,panelConfig:{},switchConfig:{},defaultOpen:!0,isLive:!1,channelSize:24,fontSize:14,opacity:1,mouseControl:!1,mouseControlPause:!1,ext:{},style:{}}}}]),i}(I);function Ei(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function bi(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ei(Object(i),!0).forEach((function(t){wi(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ei(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ai(e){return(Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Si(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Di(n.key),n)}}function xi(e,t,i){return t&&Si(e.prototype,t),i&&Si(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function wi(e,t,i){return(t=Di(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ii(e){return(Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ri(e,t){return(Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oi(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Pi(e)}function Li(){return Li="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ii(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:i):o.value}},Li.apply(this,arguments)}function Di(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var Ni=/^WEBVTT/i,Mi=/^STYLE+$/,Fi=/^\:\:cue/,Hi=/^}+$/,Ui=/^\[Script Info\].*/,ji=[/[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/],Bi=/^Format:\s/,Vi=/^Style:\s/,Wi=/^Dialogue:\s/;function zi(e){var t=e.length;return 3===t?(60*(60*Number(e[0])+Number(e[1]))*1e3+1e3*Number(e[2]))/1e3:2===t?(60*Number(e[0])*1e3+1e3*Number(e[1]))/1e3:Number(e[0])}function Gi(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function Ki(e,t){return e>=0&&e<t.length?t[e]:""}var Yi=function(){function e(){Ci(this,e)}return xi(e,null,[{key:"parseJson",value:function(e){for(var t=[],i=0,n=0;n<e.length;n++){if(i>=50&&(i=0),0===i){var o={start:e[n].start,list:[e[n]],end:e[n].end};t.push(o)}else t[t.length-1].list.push(e[n]),t[t.length-1].end=e[n].end;i++}return t}},{key:"parse",value:function(t,i){var n=e.checkFormat(t);n||i({format:n});try{var o=[];"ass"===n?o=e.parseASS(t):"vtt"===n&&(o=e.parseVTT(t)),i({format:n,list:o.list,styles:o.styles})}catch(e){console.error(e),i({format:n},e)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},n="";try{var o=t.length-e.length;return n=(n=o>0?t.splice(e.length-1,o+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,""),t[e.length-1]=n,e.map((function(e,n){"end"===e||"start"===e?i[e]=zi(t[n].split(":")):"text"===e?i[e]=[t[n]]:"layer"===e?(i[e]=[t[n]],i.textTag=[t[n]]):i[e]="style"===e?[t[n]]:Number(t[n])?Number(t[n]):t[n]})),i}catch(e){return console.error(e),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],o=0,s=0,r=[],a=[],l=null;o<i.length;){if(Bi.test(i[o]))a=(a=i[o].replace(Bi,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(Vi.test(i[o]))r.push(i[o].replace(Vi,"").replace(/\s+/g,""));else if(Wi.test(i[o])){var u=e.parseASSItem(i[o].replace(Wi,""),a);if(l&&u.start===l.start&&u.end===l.end)try{var c=l,h=c.text,d=c.textTag,f=c.style;h.push(u.text[0]),d.push(u.textTag[0]),f.push(u.style[0])}catch(e){console.error(e)}else{l=u;var p=null;s%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),n.push(p)):((p=n[n.length-1]).end=l.end,p.list.push(l)),s++}}o++}return{list:n,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var i=e.split(":");if(i.length>1){var n=i[0].trim().split("-"),o="";n.length>1?n.map((function(e,t){o+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):o=n[0],t[o]=i[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(Ni,"")).split("\n"),i=[],n=0,o=0,s=null,r=!1,a=!1,l=null,u=null,c=[];n<t.length;){var h=Ki(n,t).trim();if(!h||r&&Gi(h))r=!h;else if(Fi.test(h)&&Mi.test(Ki(n-1,t).trim())){a=!0;var d=/\((.+?)\)/g.exec(h);u=d?d[1]:"",l=""}else if(a)Hi.test(h)?(c.push({key:u,style:l}),l=null,u=null,a=!1):l+=h;else if(h){r=!1;var f=this.checkIsTime(t[n]);if(f){var p=this.parseVttTime(f);if(!s||p.start!==s.start||p.end!==s.end){(s=p).text=[],s.textTag=[];var g=null;o%50==0?((g={start:s.start,end:s.end,list:[]}).list.push(s),i.push(g)):((g=i[i.length-1]).end=s.end,g.list.push(s)),o++}}else if(s){var v=s,m=v.text,y=v.textTag,_=this.parseVttText(t[n]);m.push(_.text),y.push(_.tag)}r=!1}n++}return{list:i,styles:c}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<ji.length&&!(i=ji[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){n=t[0].replace(/\<|\>|\&/g,"");var o=RegExp("^<".concat(n,">(([\\s\\S])*?)</").concat(n,">$")).exec(e);o?i=o[1]:(i=e,n="")}else i=e;for(var s=/<(\w+).(\w+)>/g,r=s.exec(i);r&&r.length>2;)i=i.replace(r[0],"<".concat(r[1],' class="').concat(r[2],'">')),r=s.exec(i);return{tag:n,text:i.replace(/\\n+/g,"<br/>")}}},{key:"parseVttTime",value:function(e){var t,i=e.split("--\x3e"),n=0;if(2===i.length){var o=i[0].split(":"),s=i[1].split(":");t=zi(o),n=zi(s)}return{start:t,end:n,time:e}}},{key:"isVTT",value:function(e){return Ni.test(e)}},{key:"isASS",value:function(e){return Ui.test(e)}},{key:"checkFormat",value:function(e){return e?Ni.test(e)?"vtt":Ui.test(e)?"ass":null:null}}]),e}(),Xi=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"},{code:8,msg:"DATA_ERROR:subtitle.url is null"},{code:9,msg:"DATA_ERROR:subtitle.url length is 0"}];function qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={code:Xi[e].code,msg:Xi[e].msg};return Object.keys(t).map((function(e){i[e]=t[e]})),i}var Ji=xi((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.url,n=t.method,o=void 0===n?"GET":n,s=t.type,r=void 0===s?"arraybuffer":s,a=t.timeout,l=void 0===a?1e4:a,u=t.data,c=void 0===u?{}:u,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ci(this,e),new Promise((function(e,t){var n=new window.XMLHttpRequest,s=o.toUpperCase(),a=[];if(r&&(n.responseType=r),l&&(n.timeout=l),Object.keys(c).forEach((function(e){a.push("k=".concat(c[e]))})),n.onload=function(){200===n.status||206===n.status?e({context:h,res:n}):t(new Error({context:h,res:n,type:"error"}))},n.onerror=function(e){t(new Error({context:h,res:n,type:"error"}))},n.ontimeout=function(e){t(new Error({context:h,res:n,type:"error"}))},n.onabort=function(){t(new Error({context:h,res:n,type:"error"}))},"GET"===s)n.open(s,"".concat(i)),n.send();else{if("post"!==s)throw new Error("xhr ".concat(s," is not supported"));n.open(s,i),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(a.join("&"))}}))})),Zi=function(){function e(){var t,i;Ci(this,e);var n=new Promise((function(e,n){t=e,i=n}));return n.resolve=function(e){t(e),n.state="fulfilled"},n.reject=function(e){i(e),n.state="rejected",n.isBreak="DESTROYED"===e},n.state="pending",n}return xi(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function $i(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var i=e.className&&"object"===Ai(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function Qi(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):$i(e,t)||(e.className&&"object"===Ai(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function en(e,t,i){var n=t.length;if(n<1)return-1;if(t[i=i<0?0:i>=n?n-1:i].start<=e&&e<t[i].end)return i;for(var o=t[i].end<=e?i+1:0;o<n;o++){if(t[o].start<=e&&e<t[o].end)return o;if(e>t[o].end&&o+1<n&&e<t[o+1].start)return-1;if(e>t[o].end&&o+1>=n)return-1}return-1}function tn(e,t,i){var n=t.length;if(n<1)return[];var o=[];if((i=i<0?0:i>=n?n-1:i)<n)for(var s=t[i].end<=e?i:0;s<n&&(t[s].start<=e&&e<t[s].end&&o.push(s),!(e<t[s].start));s++);return o}function nn(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function on(){var e=arguments.length>0&&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.length>3&&void 0!==arguments[3]?arguments[3]:"",o=document.createElement(e);return o.className=n,o.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,s=i[t];"video"===e||"audio"===e||"live-video"===e?s&&o.setAttribute(n,s):o.setAttribute(n,s)})),o}function sn(e,t,i){if(i||(i=new Zi),"json"===t){var n=Yi.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&Yi.parse(e,(function(e,t){if(t){var n=qi(2,t);i.reject(n,{format:e.format})}else if(e.format)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var o=qi(3);i.reject(o)}}));return i}function rn(e,t){return t||(t=new Zi),new Ji({url:e.url,type:"text"}).then((function(i){sn(i.res.response,"string").then((function(i){t.resolve(bi(bi({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(i){var n=qi(1,bi({statusText:i.statusText,status:i.status,type:i.type,message:"http load error",url:e.src},e));t.reject(n)})),t}function an(e,t){return!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function ln(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function un(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var cn=function(){function e(){var t=this;Ci(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return xi(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=this.__handlers,n=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(n=o);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var i=this.__handlers,n=0;n<i.length;n++)if(i[n]&&e===i[n].target){i[n].handler&&i[n].handler.forEach((function(i){try{i(e,t)}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),hn=null;function dn(e){var t=[];return e&&"String"===nn(e)?t.push({url:e,index:0,start:-1,end:-1}):"Array"===nn(e)&&e.forEach((function(e,i){t.push({url:e.url||e.src,index:i,start:e.start||-1,end:e.end||-1})})),t}var fn=!1,pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ri(e,t)}(o,e);var t,i,n=(t=o,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=Ii(t);if(i){var o=Ii(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return Oi(this,e)});function o(e){var t,i,s,r,a,l,u;return Ci(this,o),wi(Pi(t=n.call(this)),"_onPause",(function(){t.stopRender()})),wi(Pi(t),"_onPlay",(function(){t._curRenderTask.length>0&&t.startRender(-1)})),wi(Pi(t),"_onTimeupdate",(function(){if(t._isOpen){var e=t.player.video,i=e.videoWidth,n=e.videoHeight;!t._videoMeta.scale&&i&&n&&t._onResize(t.player.root);var o=t._getPlayerCurrentTime();Math.round(Math.abs(1e3*o-t._ctime))<200||(t._ctime=1e3*o,t.currentText&&t.currentText.list&&("live"===t.config.updateMode?t._liveUpdate(o):t._update(o)))}})),wi(Pi(t),"_onResize",(function(e){var i=Pi(t),n=i._videoMeta;if(i.config.domRender){if(e&&e instanceof window.Element||(e=t.player.root),t._iId&&(clearTimeout(t._iId),t._iId=null),!n.scale){if(!t.player.video)return;var o=t.player.video,s=o.videoWidth,r=o.videoHeight;if(!s||!r)return;n.videoWidth=s,n.videoHeight=r,n.scale=parseInt(r/s*100,10)}t.__startResize(e)}})),wi(Pi(t),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":t._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":t._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":t._onCoreSeiintime(e)}}catch(e){console.error(e)}})),wi(Pi(t),"startRender",(function(e){if(e>0&&t._renderIntervalId&&(window.cancelAnimationFrame(t._renderIntervalId),t._renderIntervalId=-1),t.textTrack){var i=Pi(t)._curRenderTask;t._lastTimeStamp=(new Date).getTime();var n=[];i.forEach((function(i,o){var s=i.lastTime,r=i.wordList,a=i.interval,l=i.dom,u=i.ids;if(e<0||t._lastTimeStamp<0||t._lastTimeStamp-s>=a){var c=r.shift();c&&l.appendData(c),i.lastTime=t._lastTimeStamp}r.length<1&&n.push({index:o,ids:u})})),t._log(">>>>_renderByWords emptyArr",n.length,i.length),n.forEach((function(e){i.splice(e.index,1),t._log(">>>_renderByWords remove emptyArr",e.index,i.length)})),i.length>0&&(t._renderIntervalId=window.requestAnimationFrame(t.startRender))}})),wi(Pi(t),"destroy",(function(){t.detachPlayer(),t.removeAllListeners(),t.player=null,t.textTrack=null,t._curRenderTask=[],t.stopRender()})),i=navigator.userAgent,s=/(?:Windows Phone)/.test(i),r=/(?:SymbianOS)/.test(i)||s,a=/(?:Android)/.test(i),l=/(?:Firefox)/.test(i),u=/(?:iPad|PlayBook)/.test(i)||a&&!/(?:Mobile)/.test(i)||l&&/(?:Tablet)/.test(i),fn=/(?:iPhone)/.test(i)&&!u||a||r||u,t.currentText=null,t.currentExtText=null,t.textTrack=[],t._cid=-1,t._gid=-1,t._cids=[],t._iId=null,t._iC=0,t.player=null,t.root=null,t.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff",domRender:!0,updateMode:"vod",renderMode:"",debugger:!1},t._ctime=0,t._loadingTrack={},Object.keys(t.config).map((function(i){void 0!==e[i]&&null!==e[i]&&(t.config[i]=e[i])})),t._isOpen=t.config.defaultOpen||!1,t._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===nn(e.subTitles)?(e.player&&t.attachPlayer(e.player),t.seiTime=0,t.lastSeiTime=0,t._curTexts=[],t._curRenderTask=[],t._renderIntervalId=-1,t._lastTimeStamp=-1,t.setSubTitles(e.subTitles,t.config.defaultOpen),t):Oi(t)}return xi(o,[{key:"version",get:function(){return"3.0.23"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this._isOpen||i;n&&this.innerRoot&&this.switchOff(),this.currentText=null,this.textTrack=[],t.forEach((function(t){var i={};Object.keys(t).map((function(e){i[e]=t[e]})),i.url=dn(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",o),o&&this.switch().catch((function(t){e._log("[switch]",t)})),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})),this.emit("reset",{list:this.textTrack,isOpen:o})}},{key:"updateSubTitle",value:function(e){for(var t=this,i=-1,n=0;n<this.textTrack.length;n++)if(an(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var o=an(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",o,"this.isOpen",this.isOpen,this.currentText),!o)return;var s=dn(e.url);this.isOpen?(s.forEach((function(e){t.textTrack[i].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[i]),this._loadTrackUrls(this.currentText,2)):this.textTrack[i].url=s}}},{key:"addStyles",value:function(e){var t=e.styles,i=e.format;t&&"vtt"===i&&(t.map((function(e){e.key||(e.key="xg-text-track-span")})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="";e.map((function(e){i+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var n=document.createElement("style"),o=document.head||document.getElementsByTagName("head")[0];if(n.type="text/css",n.id="ssss",n.styleSheet){var s=function(){try{n.styleSheet.cssText=i}catch(e){}};n.styleSheet.disabled?setTimeout(s,10):s()}else{var r=document.createTextNode(i);n.appendChild(r)}o.appendChild(n)}(t,"xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e){this.player&&this.detachPlayer();var i,n,o=this.config,s=o.fontColor,r=o.mode,a=o.fitVideo,l=o.domRender;this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&Qi(this.root,"text-track-hide"),!a&&Qi(this.root,"text-track-no-fitvideo"),r&&Qi(this.root,"text-track-".concat(r)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),s&&(this.root.style.color=s),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root.appendChild(this.root),i=e.root,n=this._onResize,hn||(hn=new cn),hn.addObserver(i,n)),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("pause",this._onPause),this.player.on("play",this._onPlay),this.player.on("core_event",this._onCoreEvents),this._isOpen&&this.switch().catch((function(e){t._log("[switch]",e)}))}}},{key:"detachPlayer",value:function(){var e,t,i=this.player,n=this.config;i&&(i.off("destroy",this.destroy),i.off("timeupdate",this._onTimeupdate),i.off("pause",this._onPause),i.off("play",this._onPlay),i.off("core_event",this._onCoreEvents),n.domRender&&(i.root&&(e=i.root,t=this._onResize,hn&&hn.unObserver(e,t),i.root.removeChild(this.root)),this.innerRoot=null,this.root=null),this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._log("switch",t),this._loadingTrack=t,new Promise((function(i,n){if(t.id||t.language)if(e.currentText&&an(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(qi(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var s=0;s<e.textTrack.length;s++)if(an(t,e.textTrack[s])){o=e.textTrack[s];break}if(e._log("nextSubtitle",o),o)e._emitPlayerSwitch(e.currentText,o),o.list?(e._loadingTrack={},e._updateCurrent(o),e.switchOn(),i(qi(0))):(e._log("this._loadTrack",o),e._updateCurrent(o),e._loadTrack(o).then((function(t){if(e.addStyles(t),e._loadingTrack.id===o.id||e._loadingTrack.language===t.language)e._loadingTrack={},e._updateCurrent(t),e.switchOn(),i(qi(0));else{var s=qi(6,{message:"check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(t.id)});n(s)}})).catch((function(e){n(e)})));else{var r=qi(4,new Error("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]")));n(r)}}else{if(e.currentText){e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn();var a=qi(0,{message:"switch default subtitle success"});return void i(a)}var l=qi(5,{message:"no default subtitle"});n(l)}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(i,n){if(t.id||t.language){for(var o=null,s=0;s<e.textTrack.length;s++)if(an(t,e.textTrack[s])){o=e.textTrack[s];break}o&&!an(o,e.currentText)&&e._loadTrack(o).then((function(t){e.currentExtText=t,i(qi(0))}))}else e.currentExtText=null,i(qi(0))}))}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show(),this.emit("change",this.currentText)}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide(),this.emit("off")}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];(e=console).log.apply(e,["[xgSubtitle]"].concat(i))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var i=new Zi,n="",o="";if(e.json?(n="json",o=e.json):e.stringContent&&!e.url&&(n="string",o=e.stringContent),o)return sn(o,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){i.reject(e)})),i;var s=e.url;return 0===s.length?(i.resolve(e),i):(rn(s.splice(0,1)[0]).then((function(n){e.format=n.format,e.styles=n.styles,e.list||(e.list=[]),t._pushList(e.list,n.list),s.length>1&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=bi({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&this.player.emit("switch_subtitle",i)}},{key:"_loadTrackUrls",value:function(e,t,i){var n=this,o=e.url.length,s=o>t?e.url.splice(0,t):e.url.splice(0,o),r=s.length;this._log("_loadTrackUrls",e.language,o,s.length,r),s.forEach((function(t,o){rn(bi(bi({},t),{},{index:o})).then((function(t){e.format=t.format,e.styles=t.format,e.list||(e.list=[]),n._pushList(e.list,t.list),r--})).catch((function(e){r--})).finally((function(t){0===r&&(i&&i.resolve(e),n._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},i=-1;e.url.forEach((function(e,n){e.url===t.url&&(i=n)})),i>-1&&e.url.splice(i,1)}},{key:"_pushList",value:function(e,t){var i=t[0].start,n=t[t.length-1].end;if(0===e.length||i>=e[e.length-1].end)t.forEach((function(t){e.push(t)}));else{for(var o=-1,s=0;s<e.length;s++)if(e[s].start>n){o=s;break}o>-1&&t.forEach((function(t,i){e.splice(o+i,0,t)}))}return e}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,this.config.domRender&&this.root&&(["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.__remove(this._cids)),this._cids=[],this._gid=-1,this._cid=-1,this._curTexts=[];var i=this._getPlayerCurrentTime();i&&("live"===this.config.updateMode?this._liveUpdate(i):this._update(i))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var i=[],n=0;n<e.length;n++)t.includes(e[n])||i.push(e[n]);return i}},{key:"getNewCid",value:function(e,t){for(var i=[],n=0;n<t.length;n++)e.includes(t[n])||i.push(t[n]);return i}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=[],n=en(e,this.currentText.list,this._gid);if(n>-1&&(i=tn(e,this.currentText.list[n].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,n,i,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),i.length>0){var o=function(e,t,i){if(0===e.length||t<0||t>e.length-1)return[];var n=e[t].list;if(0===i.length)return[];var o=n.splice(i[0],i.length);return t>0&&e.splice(0,t),0===n.length&&e.splice(0,1),o}(this.currentText.list,n,i),s=this._curTexts.length,r=s>0?this._curTexts[s-1].index:0;o.forEach((function(e,i){e.index=i+r,t._curTexts.push(e)})),this.__render(o)}this.emit("update",this._curTexts)}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=en(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=tn(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),void(this._cids=[]);if(this._cids!==n||i!==this._gid){this._gid=i,this._cid=n[0];var o=this.getDelCid(this._cids,n),s=this.getNewCid(this._cids,n);this._cids=n,this.config.domRender&&this.__remove(o);var r=[];s.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,r.push(n)})),this.currentExtText&&s.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,r.push(n)})),this._log("update",r,e),this.emit("update",r),this.__render(r,e)}}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return parseInt(1e3*e+1e3*this.seiTime-1e3*this.lastSeiTime,10)/1e3}},{key:"_onSubtitlePlaylist",value:function(e){this._log("_onSubtitlePlaylist",e);var t=e.map((function(e){return{label:e.name,language:e.lang,id:e.id,isDefault:e.default,url:[],mUrl:e.url}}));this.setSubTitles(t)}},{key:"_onSubtitleSegment",value:function(e){if(this._log("_onSubtitleSegment",e.length,e[0].lang,e[0].sn,e[e.length-1].sn,e[0].start,e[e.length-1].end),e&&0!==e.length){var t={language:e[0].lang,url:e.map((function(e){return{id:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end}}))};an(t,this.currentText)&&this.updateSubTitle(t)}}},{key:"_onCoreSeiintime",value:function(e){try{var t=e.time/1e3;this._log("_onCoreSeiintime sei",t,this.seiTime,this.lastSeiTime),this.seiTime=t,this.lastSeiTime=this.player?this.player.currentTime:0}catch(e){}}},{key:"resize",value:function(e,t){var i,n=this,o=this.config,s=o.baseSizeX,r=o.baseSizeY,a=o.minMobileSize,l=o.minSize,u=o.fitVideo,c=o.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=parseInt(h*e,10)/100,i=e):(d=t,i=parseInt(t/h*100,10)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;h>120?(f=r,p=parseInt(f*d/1080,10)):(f=s,p=parseInt(f*i/1920,10));var g=fn?a:l,v={fontSize:p=p<g?g:p>f?f:p},m=parseInt((t-d)/2,10),y=parseInt((e-i)/2,10),_=parseInt(d*c,10)/100;this._videoMeta.vBottom=m,this._videoMeta.vLeft=y,this._videoMeta.marginBottom=_,u&&(v.bottom=m+_,v.left=v.right=y),Object.keys(v).map((function(e){n.root.style[e]="".concat(v[e],"px")})),this.emit("resize",{vLeft:y,vBottom:m,marginBottom:_,vWidth:i,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,i=e.getBoundingClientRect(),n=this._videoMeta,o=i.width,s=i.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),o>0&&s>0&&(o!==n.lwidth||s!==n.lheight))this._iC=0,this.resize(o,s);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__removeByTime",value:function(e,t){for(var i=[],n=0;n<e.length;n++)(!t||e[n].end<t)&&i.push(n);0!==i.length&&(e.splice(i[0],i.length),this.config.domRender&&this.__remove(i))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){this._log(">>>>_renderByWords__remove",e);for(var i=this.innerRoot.children,n=[],o=0;o<i.length;o++){var s=Number(i[o].getAttribute("data-index"));e.includes(s)&&n.push(i[o])}n.map((function(e){t.innerRoot.removeChild(e)}))}}},{key:"__render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._log("__render",t.length,this.config.domRender);var i=this.config,n=i.renderMode,o=i.domRender;t.length>0&&o&&t.forEach((function(t){var i="text-track-".concat(e.config.line);t.text.forEach((function(o,s){s>0&&(i+=" text-track-deputy");var r={"data-start":t.start,"data-end":t.end,"data-index":t.index},a=on("xg-text-track-span","",r,i);if(e.innerRoot.appendChild(a),"step"===n){var l=on("xg-text-track-span","",r,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),l.innerHTML=o,setTimeout((function(){e._renderByWords(a,s,t.start,t.end,o)}),600)}else a.innerHTML=o}))}))}},{key:"_renderByWords",value:function(e,t,i,n,o){var s=document.createTextNode("");e.appendChild(s);var r=function(e){for(var t=e.split(""),i=[],n=!1,o=0;o<t.length;o++){var s=t[o];if(ln(s))if(n){var r=i.length-1;i[r]="".concat(i[r]).concat(s)}else i.push(s),n=!0;else if(s.match(/^[ ]*$/)||un(s)||/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(s)){n=!1;var a=i.length-1;i[a]="".concat(i[a]).concat(s)}else n=!1,i.push(s)}return i}(o),a=this._getPlayerCurrentTime(),l=parseInt(1e3*(n-a),10);if(!(a>=n)){i>=a&&(a=i),l>300&&(l-=50);var u={dom:s,ids:t,wordList:r,interval:l/r.length,start:a,end:n,duration:l,lastTime:0};this._log(">>>>_renderByWords",l,u);for(var c=this._curRenderTask,h=-1,d=0;d<c.length;d++)if(c[d].ids===t){h=d;break}h>-1&&c.slice(h,1),c.push(u),this.startRender(-1)}}},{key:"stopRender",value:function(){this._renderIntervalId&&window.cancelAnimationFrame(this._renderIntervalId)}},{key:"show",value:function(){var e,t;this.config.domRender&&(t="text-track-hide",(e=this.root)&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):$i(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Ai(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(Qi(this.root,"text-track-hide"),this.innerRoot.innerHTML="")}},{key:"emit",value:function(e,t){for(var i,n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];(i=Li(Ii(o.prototype),"emit",this)).call.apply(i,[this,e,t].concat(s))}},{key:"on",value:function(e,t){for(var i,n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];(i=Li(Ii(o.prototype),"on",this)).call.apply(i,[this,e,t].concat(s))}},{key:"once",value:function(e,t){for(var i,n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];(i=Li(Ii(o.prototype),"once",this)).call.apply(i,[this,e,t].concat(s))}},{key:"off",value:function(e,t){for(var i,n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];(i=Li(Ii(o.prototype),"off",this)).call.apply(i,[this,e,t].concat(s))}},{key:"offAll",value:function(){Li(Ii(o.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),o}(s()),gn=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),o=t.call(this),(0,n.n8)((0,n.V5)(o),"_onChange",(function(e){var t=o._media.textTracks;if(t&&0!==t.length){for(var i=[],n=[],s=-1,r=0;r<t.length;r++){var a=t[r];"subtitles"===a.kind&&(i.push({id:a.id||a.language,language:a.language,text:a.label,isDefault:"showing"===a.mode}),-1===s&&"showing"===a.mode&&(s=r),n.push(a.language))}n.join("|")!==o._languages?(o._languages=n.join("|"),o.emit("reset",{list:i,isOpen:s>-1})):-1===s?o.emit("off"):o.curIndex!==s&&o.emit("change",i[s]),o.curIndex=s}})),o._media=e,o._list=[],o._languages="",o.curIndex=-1,o._init(),o}return(0,n.j6)(i,[{key:"_init",value:function(){this._media.textTracks.addEventListener("change",this._onChange)}},{key:"switch",value:function(e){for(var t=this._media.textTracks,i=0;i<t.length;i++){var n=t[i];n.language===e.language?n.mode="showing":"showing"===n.mode&&(n.mode="disabled")}}},{key:"switchOff",value:function(){for(var e=this._media.textTracks,t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}},{key:"destroy",value:function(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}]),i}(s()),vn="text-close";function mn(e){var t=-1;return e.forEach((function(e,i){e.id||e.language||(e.id=i),e.id=String(e.id),!e.url&&(e.url=e.src),!e.text&&(e.text=e.label),!e.language&&(e.language=e.srclang),void 0===e.isDefault&&(e.isDefault=e.default||!1),(e.isDefault||e.default)&&(t<0?t=i:e.isDefault=e.default=!1)})),t}var yn=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(){var e;(0,n.xs)(this,i);for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return e=t.call.apply(t,[this].concat(s)),(0,n.n8)((0,n.V5)(e),"_onOff",(function(){e.switchOffSubtitle()})),(0,n.n8)((0,n.V5)(e),"_onChange",(function(t){var i=e.getSubTitleIndex(e.config.list,t);i<0||e.updateCurItem(i,t)})),(0,n.n8)((0,n.V5)(e),"_onListReset",(function(t){e.updateList(t)})),(0,n.n8)((0,n.V5)(e),"clickSwitch",(function(t,i){var n="close"===i.type||i.type===vn;e.subTitles&&(n?e.subTitles.switchOff():e.switchSubTitle({language:i.language,id:i.id}))})),(0,n.n8)((0,n.V5)(e),"onIconClick",(function(t){e.curItem?e.subTitles.switchOff():e.switchOnSubtitle(t)})),(0,n.n8)((0,n.V5)(e),"onPlayerFocus",(function(t){e.subTitles&&e.config.style.follow&&e.rePosition()})),(0,n.n8)((0,n.V5)(e),"onPlayerBlur",(function(t){e.subTitles&&e.config.style.follow&&!e.playerConfig.marginControls&&e.subTitles.root&&(e.subTitles.root.style.transform="translate(0, 0)")})),e}return(0,n.j6)(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.texttrack||e.player.config.textTrack;"Array"===r.Ay.typeOf(t)&&(e.config.list=t)}},{key:"afterCreate",value:function(){var e=this.config,t=e.list,o=e.mode,s=mn(t);(0,n.Jt)((0,n.U6)(i.prototype),"afterCreate",this).call(this),this.curIndex=-1,this.lastIndex=-1,this.curItem=null,this._nativeTracks=null,this.handlerClickSwitch=this.hook("subtitle_change",this.clickSwitch),"native"===o?this._initNativeSubtitle():this._initExtSubTitle(s)}},{key:"_initNativeSubtitle",value:function(){var e=this.player;e._subTitles||(e._subTitles=new gn(e.media)),this.subTitles=e._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset)}},{key:"_initExtSubTitle",value:function(e){var t=this.config,i=t.list,n=t.style,o=t.isDefaultOpen,s=t.updateMode,a=t.renderMode;o&&e<0&&i.length>0&&(e=0,i[0].isDefault=!0);var l={subTitles:i,defaultOpen:o,updateMode:s,renderMode:a,debugger:this.config.debugger};Object.keys(n).map((function(e){l[e]=n[e]})),!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(d.PLAYER_FOCUS,this.onPlayerFocus),this.on(d.PLAYER_BLUR,this.onPlayerBlur));var u=this.player;u._subTitles?u._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,u._subTitles.currentText)):(u._subTitles=new pn(l),u._subTitles.attachPlayer(this.player)),this.subTitles=u._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),n.follow&&this.subTitles.root&&r.Ay.addClass(this.subTitles.root,"follow-control"),this._renderList(i,o,e)}},{key:"_renderList",value:function(e,t,i){e&&0!==e.length&&(t?(e[i=i<0?0:i].isDefault=!0,this.curIndex=i,this.curItem=e[i],this.switchIconState(!0)):this.switchIconState(!1),this.player.isCanplay&&e.length>0&&(this.renderItemList(e),this.show()))}},{key:"registerIcons",value:function(){return{textTrackOpen:{icon:"",class:"xg-texttrak-open"},textTrackClose:{icon:"",class:"xg-texttrak-close"}}}},{key:"show",value:function(e){!this.config.list||this.config.list.length<1||r.Ay.addClass(this.root,"show")}},{key:"getSubTitleIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"",language:""},i=-1;return t&&(t.id||t.language)?(e.forEach((function(e,n){(function(e,t){var i=r.Ay.isNotNull(e.id)&&r.Ay.isNotNull(t.id)&&e.id===t.id,n=r.Ay.isNotNull(e.language)&&r.Ay.isNotNull(t.language)&&e.language===t.language;return i||n})(e,t)&&(i=n)})),i):i}},{key:"updateSubtitles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this.updateList({list:e}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,this.curIndex>-1,t))}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.list){var t=[];e.list.forEach((function(e){t.push(e)}));var i=mn(t);e.isOpen?(this.curIndex=i,this.curItem=i>-1?t[i]:null):(this.curIndex=-1,this.curItem=null),this.config.list=t,t.length>0?this.show():(this.switchOffSubtitle(),this.hide()),this.renderItemList()}}},{key:"switchSubTitle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};this.switchIconState(!0),this.getSubTitleIndex(this.config.list,e)<0||this.subTitles.switch(e).catch((function(e){}))}},{key:"switchOffSubtitle",value:function(e){this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.lastIndex=this.curIndex,this.curIndex=-1,this.curItem=null,this.switchIconState(!1),this.renderItemList()}},{key:"switchOnSubtitle",value:function(){var e=this.config.list[this.lastIndex>-1?this.lastIndex:0];this.switchIconState(!0),this.switchSubTitle(e)}},{key:"switchIconState",value:function(e){this.setAttr("data-state",e?"open":"close")}},{key:"onItemClick",value:function(e,t){var o=e.delegateTarget,s=o.getAttribute("language"),r=o.getAttribute("data-id"),a=o.getAttribute("data-type");(0,n.Jt)((0,n.U6)(i.prototype),"onItemClick",this).apply(this,arguments),this.handlerClickSwitch(e,{language:s,id:r,type:a})}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config,t=e.list,i=e.closeText,n=this.curIndex;if(n-1<0)this.find(".icon-text").innerHTML=this.getTextByLang(i,"iconText");else if(n-1<t.length){var o=t[n-1];if(!o)return;this.find(".icon-text").innerHTML=this.getTextByLang(o,"iconText")}}}},{key:"updateCurItem",value:function(e,t){this.curIndex=e,this.curItem=this.config.list[e-1],this.renderItemList(),this.emit("subtitle_change",(0,n.T1)({off:!1,isListUpdate:!1,list:[]},t))}},{key:"renderItemList",value:function(){var e=this,t=this.config,o=t.list,s=t.closeText,r=t.needCloseText,a=[],l=this.curIndex,u=this.curIndex;r&&(a.push({showText:this.getTextByLang(s),"data-type":vn,selected:-1===this.curIndex}),l++),o.map((function(t,i){var n={language:t.language||t.srclang||"","data-id":t.id||""};n.selected=e.curIndex===i,n.showText=e.getTextByLang(t),a.push(n)})),(0,n.Jt)((0,n.U6)(i.prototype),"renderItemList",this).call(this,a,l),this.curIndex=u,this.curItem=o[u]}},{key:"rePosition",value:function(){var e=this.config.style.fitVideo,t=0-this.player.controls.root.getBoundingClientRect().height;if(e){var i=this.player,n=i.video,o=i.root.getBoundingClientRect(),s=o.height,r=o.width,a=n.videoHeight,l=n.videoWidth,u=parseInt(a/l*100,10)*r/100;u>s&&(u=s);var c=(s-u)/2-t;c<0&&(this.subTitles.root.style.transform="translate(0, ".concat(c,"px)"))}else this.subTitles.root.style.transform="translate(0, ".concat(t,"px)")}},{key:"destroy",value:function(){this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),(0,n.Jt)((0,n.U6)(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"texttrack"}},{key:"defaultConfig",get:function(){return(0,n.T1)((0,n.T1)({},At.defaultConfig),{},{position:C.CONTROLS_RIGHT,index:6,list:[],isDefaultOpen:!0,style:{follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:2,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"},closeText:{text:"不开启",iconText:"字幕"},needCloseText:!0,className:"xgplayer-texttrack",hidePortrait:!1,isShowIcon:!0,renderMode:"normal",mode:"external",debugger:!1})}}]),i}(At),_n=function(e){(0,n.B)(i,e);var t=(0,n.wf)(i);function i(e){var o;return(0,n.xs)(this,i),(o=t.call(this,e)).canvasHeight=0,o.canvasWidth=0,o.width=0,o.height=0,o.dataFloatLen=2,o.xData=[],o.yData=[],o.yMax=0,o._duration=0,o.curData=[],o}return(0,n.j6)(i,[{key:"afterPlayerInit",value:function(){this.root||(this.createRoot(),this.reset())}},{key:"afterCreate",value:function(){var e=this;this.on(d.VIDEO_RESIZE,(function(){e.resize()})),this.on(d.DURATION_CHANGE,(function(){e._duration=e.player.duration,e.reset()}))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]})),this.reset()}},{key:"reset",value:function(){var e=this.config.data;this.setData(e),this.resize()}},{key:"createRoot",value:function(){if(!this.root){var e=this.config.mode,t=this.player.plugins.progress.root,i="activeShow"===e?"xg-heatmap-active-show":"xg-heatmap-normal",n=r.Ay.createDom("div","",{},"xg-heatmap ".concat(i)),o=t.children.length>0?t.children[0]:null;t.insertBefore(n,o),this.root=n;var s=r.Ay.createDom("canvas","",{},"xg-heatmap-canvas");this.root.appendChild(s),this.root.style.height="".concat(this.config.height,"px"),this.canvas=s}}},{key:"resize",value:function(){var e=this.config.dpi,t=this.root.getBoundingClientRect(),i=t.width,n=t.height;i===this.width&&n*e===this.height||(this.width=i,this.height=n,this.canvas.width=this.canvasWidth=i*e,this.canvas.height=this.canvasHeight=n*e,this.yMax=0,this.curData.length&&(this.setData(),this.drawLinePath()))}},{key:"formatData",value:function(e,t,i){var o=[];if(e.length<1)return o;var s=parseInt(1e3*t,10);if("Object"===r.Ay.typeOf(e[0])&&void 0!==e[0].time){if(!s)return o;var a=1,l=0;e.forEach((function(e){var t=parseInt(1e3*e.time,10);l&&(a<0||e.time-l<a)&&(a=e.time-l),l=e.time,o.push((0,n.T1)((0,n.T1)({},e),{},{percent:t/s}))}));var u=o[0].time;u>0&&(u-a>0?[u-a,0]:[0]).forEach((function(e){var t=parseInt(1e3*e,10);o.unshift({time:e,score:i,percent:t/s})}));var c=o[o.length-1];t-c.time>a&&[c.time+a,t].forEach((function(e){var t=parseInt(1e3*e,10);o.push({time:e,score:i,percent:t/s})}))}else e.forEach((function(e){o.push(e)}));return o}},{key:"_getX",value:function(e,t,i,n){return void 0!==i.percent?this.fixFloat(n*i.percent,this.dataFloatLen):this.fixFloat((e-1)*t,this.dataFloatLen)}},{key:"_getY",value:function(e,t,i){var n=this.config,o=n.maxValue,s=n.minValue,r=s;return r=void 0!==e.score?e.score:e,r=Math.min(r,o),r=Math.max(r,s),r=1-(r/=t),this.fixFloat(r*i,this.dataFloatLen)}},{key:"setData",value:function(e){var t=this.config,i=t.maxValue,n=t.minValue,o=t.maxLength;if(e&&e.length&&(this.curData=this.formatData(e,this._duration,n)),!((e=this.curData).length<1)){this.xData=[],this.yData=[],this.yMax=0;var s=i-n,r=this.canvasHeight,a=e.length,l=a>o?this.fixFloat(a/o,this.dataFloatLen):1;a=parseInt(a/l);var u=this.canvasWidth/(a-1);if(u=this.fixFloat(u,this.dataFloatLen),!Number.isNaN(u))for(var c=parseInt(this.fixFloat(l-1,0)),h=0;h<a;){var d=this._getX(h,u,e[c],this.canvasWidth);this.xData.push(d);var f=this._getY(e[c],s,r);this.yMax=Math.max(this.yMax,r-f),this.yData.push(f),h++,c=parseInt(this.fixFloat(h*l,0))}}}},{key:"_getFillStyle",value:function(e){var t=this.config,i=t.gradient,n=t.gradientColors,o=t.fillStyle;if(i&&4===i.length){var s=e.createLinearGradient(i[0],i[1],i[2],i[3]);n.length<2?console.warn(this.pluginName,"渐变颜色配置gradientColors异常"):(n.forEach((function(e){s.addColorStop(e.start,e.color)})),o=s)}return o}},{key:"drawLinePath",value:function(){this.clearCanvas();var e,t,i=this.canvas.getContext("2d"),n=this.xData,o=this.yData,s=0,r=this.config,a=r.lineWidth,l=r.alpha,u=r.strokeStyle,c=this._getFillStyle(i);for(i.beginPath(),i.lineWidth=a,i.globalAlpha=l,i.strokeStyle=u||c,i.fillStyle=c,i.moveTo(0,this.canvasHeight),e=n[s],t=o[s];void 0!==e&&void 0!==t;)i.lineTo(e,t),e=n[++s],t=o[s];i.lineTo(this.canvasWidth,this.canvasHeight),i.closePath(),i.stroke(),i.fill()}},{key:"clearCanvas",value:function(){this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight}},{key:"fixFloat",value:function(e,t){return"number"==typeof e?parseFloat(e.toFixed(t)):NaN}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"heatmap"}},{key:"defaultConfig",get:function(){return{lineWidth:0,dpi:2,alpha:.7,gradient:[],gradientColors:[],strokeStyle:"",fillColor:"#FA1F41",height:20,data:[],maxValue:100,minValue:0,maxLength:400,mode:"activeShow"}}}]),i}(I)},8140:function(e,t){var i,n;void 0===(n="function"==typeof(i=function(){return function e(t,i,n){var o,s,r=window,a="application/octet-stream",l=n||a,u=t,c=!i&&!n&&u,h=document.createElement("a"),d=function(e){return String(e)},f=r.Blob||r.MozBlob||r.WebKitBlob||d,p=i||"download";if(f=f.call?f.bind(r):Blob,"true"===String(this)&&(l=(u=[u,l])[0],u=u[1]),c&&c.length<2048&&(p=c.split("/").pop().split("?")[0],h.href=c,-1!==h.href.indexOf(c))){var g=new XMLHttpRequest;return g.open("GET",c,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(u),p):k(u);l=(u=_(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var v=0,m=new Uint8Array(u.length),y=m.length;v<y;++v)m[v]=u.charCodeAt(v);u=new f([m],{type:l})}function _(e){for(var t=e.split(/[:;,]/),i=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),o=n.length,s=0,r=new Uint8Array(o);s<o;++s)r[s]=n.charCodeAt(s);return new f([r],{type:i})}function k(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){r.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var i=document.createElement("iframe");document.body.appendChild(i),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),333)}if(o=u instanceof f?u:new f([u],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(o,p);if(r.URL)k(r.URL.createObjectURL(o),!0);else{if("string"==typeof o||o.constructor===d)try{return k("data:"+l+";base64,"+r.btoa(o))}catch(e){return k("data:"+l+","+encodeURIComponent(o))}(s=new FileReader).onload=function(e){k(this.result)},s.readAsDataURL(o)}return!0}})?i.apply(t,[]):i)||(e.exports=n)}}]);
|