nplayer
Version:
powerful danmaku video player
1 lines • 119 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("NPlayer",[],e):"object"==typeof exports?exports.NPlayer=e():t.NPlayer=e()}(this,(function(){return function(){var t={14:function(t,e,n){"use strict";n.r(e);var o=n(81),r=n.n(o),i=n(645),a=n.n(i),c=n(667),l=n.n(c),u=new URL(n(831),n.b),s=a()(r()),f=l()(u);s.push([t.id,'.nplayer{--theme-color:#007aff;--poster-bg-color:transparent;--progress-bg:#007aff;--volume-progress-bg:#007aff;--safe-area-inset-bottom:$control_bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;align-items:center;background:#000;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Microsoft YaHei;height:100%;justify-content:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:auto}@supports(padding-bottom:constant(safe-area-inset-bottom)){.nplayer{--safe-area-inset-bottom:max(8px,constant(safe-area-inset-bottom))}}@supports(padding-bottom:env(safe-area-inset-bottom)){.nplayer{--safe-area-inset-bottom:max(8px,env(safe-area-inset-bottom))}}.nplayer *{box-sizing:content-box}.nplayer_control{z-index:10}.nplayer_control_bg{z-index:9}.nplayer_poster{z-index:20}.nplayer_loading{z-index:30}.nplayer_contextmenu{z-index:40}.nplayer_toast{z-index:50}.nplayer:focus{outline:none}.nplayer_flex{display:flex}.nplayer_align-center{align-items:center}.nplayer-web-full{bottom:0;left:0;position:fixed;right:0;top:0;z-index:99999}.nplayer-web-full .nplayer_control{padding-bottom:var(--safe-area-inset-bottom)}.nplayer-loading .nplayer_loading{display:block}.nplayer_icon{fill:#fff;height:28px;width:28px}.nplayer_video{max-height:100%;outline:none;touch-action:none;width:100%}.nplayer_spacer{flex:1}.nplayer_tooltip{cursor:pointer;padding:3px;position:relative;transition:background .2s ease}@media not all and (hover:none){.nplayer_tooltip:hover{background:var(--theme-color)}.nplayer_tooltip:hover .nplayer_tooltip_content{opacity:1;transform:translate(-50%)}.nplayer_tooltip:hover .nplayer_tooltip-left,.nplayer_tooltip:hover .nplayer_tooltip-right{transform:translate(0)}}.nplayer_tooltip_content{background:rgba(0,0,0,.7);bottom:100%;font-size:12px;left:50%;margin-bottom:10px;opacity:0;padding:5px 10px;pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;white-space:nowrap}.nplayer_tooltip-left{left:0;transform:translateY(10px) scale(.8);transform-origin:0 100%}.nplayer_tooltip-right{left:auto;right:0;transform:translateY(10px) scale(.8);transform-origin:100% 100%}.nplayer_tooltip-bottom{bottom:auto;margin-bottom:0;margin-top:10px;top:100%;transform:translate(-50%,-10px) scale(.8)}.nplayer_tooltip-bottom.nplayer_tooltip-left,.nplayer_tooltip-bottom.nplayer_tooltip-right{transform:translateY(-10px) scale(.8)}.nplayer_popover{pointer-events:none}.nplayer_popover-active{pointer-events:auto}.nplayer_popover-active .nplayer_popover_panel{opacity:1;transform:translateY(0)}.nplayer_popover_panel{background:rgba(0,0,0,.7);bottom:100%;box-shadow:0 1px 20px 1px rgba(0,0,0,.2);font-size:14px;margin-bottom:5px;opacity:0;overflow:hidden;padding:3px 0;position:absolute;right:0;transform:translateY(10px);transition:opacity .2s ease,transform .2s ease,height .2s cubic-bezier(.4,0,.2,1),width .2s cubic-bezier(.4,0,.2,1);white-space:nowrap;z-index:2}.nplayer_popover_panel-bottom{bottom:auto;margin-bottom:0;margin-top:5px;top:100%;transform:translateY(-10px)}.nplayer_popover_panel-left{left:0;right:auto}.nplayer_popover_mask{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1}.nplayer_switch{background:rgba(255,255,255,.3);border-radius:10px;cursor:pointer;display:inline-block;padding:2px;transition:background-color .3s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:30px}.nplayer_switch:after{background:#fff;border-radius:50%;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);content:"";display:block;height:15px;transition:transform .15s cubic-bezier(.4,0,.2,1);width:15px}.nplayer_switch-active{background:var(--theme-color)}.nplayer_switch-active:after{transform:translateX(16px)}.nplayer_loading{display:none;height:70px;left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);width:70px}.nplayer_loading i{-webkit-animation:nplayer-loading 1s linear infinite;animation:nplayer-loading 1s linear infinite;background-color:#fff;border-radius:50%/20%;height:25%;left:44.5%;opacity:.25;position:absolute;top:37%;width:5px}.nplayer_loading i:first-child{-webkit-animation-delay:0s;animation-delay:0s;transform:rotate(-150deg) translateY(-150%)}.nplayer_loading i:nth-child(2){-webkit-animation-delay:.0833s;animation-delay:.0833s;transform:rotate(-120deg) translateY(-150%)}.nplayer_loading i:nth-child(3){-webkit-animation-delay:.1666s;animation-delay:.1666s;transform:rotate(-90deg) translateY(-150%)}.nplayer_loading i:nth-child(4){-webkit-animation-delay:.2499s;animation-delay:.2499s;transform:rotate(-60deg) translateY(-150%)}.nplayer_loading i:nth-child(5){-webkit-animation-delay:.3332s;animation-delay:.3332s;transform:rotate(-30deg) translateY(-150%)}.nplayer_loading i:nth-child(6){-webkit-animation-delay:.4165s;animation-delay:.4165s;transform:rotate(0deg) translateY(-150%)}.nplayer_loading i:nth-child(7){-webkit-animation-delay:.4998s;animation-delay:.4998s;transform:rotate(30deg) translateY(-150%)}.nplayer_loading i:nth-child(8){-webkit-animation-delay:.5831s;animation-delay:.5831s;transform:rotate(60deg) translateY(-150%)}.nplayer_loading i:nth-child(9){-webkit-animation-delay:.6664s;animation-delay:.6664s;transform:rotate(90deg) translateY(-150%)}.nplayer_loading i:nth-child(10){-webkit-animation-delay:.7497s;animation-delay:.7497s;transform:rotate(120deg) translateY(-150%)}.nplayer_loading i:nth-child(11){-webkit-animation-delay:.833s;animation-delay:.833s;transform:rotate(150deg) translateY(-150%)}.nplayer_loading i:nth-child(12){-webkit-animation-delay:.9163s;animation-delay:.9163s;transform:rotate(180deg) translateY(-150%)}.nplayer_toast{background:rgba(0,0,0,.7);font-size:16px;padding:3px 5px;position:absolute;white-space:nowrap}.nplayer_toast-center{left:50%;top:50%;transform:translate(-50%,-50%)}.nplayer_toast-left-top,.nplayer_toast-right-top{top:5px}.nplayer_toast-left-bottom,.nplayer_toast-left-top{left:5px}.nplayer_toast-right-bottom,.nplayer_toast-right-top{right:5px}.nplayer_toast-left-bottom,.nplayer_toast-right-bottom{bottom:60px}.nplayer_slider{cursor:pointer;display:inline-block;flex:1;margin:0 6px;padding:5px 0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.nplayer_slider_track{background:rgba(255,255,255,.3);height:4px;overflow:hidden;width:100%}.nplayer_slider_track_inner{background:var(--theme-color);height:100%;transform-origin:0 0}.nplayer_slider_stop{background:rgba(255,255,255,.7);font-size:12px;height:8px;position:absolute;top:3px;white-space:nowrap;width:3px}.nplayer_slider_stop span{left:2px;position:absolute;top:6px;transform:translateX(-50%)}.nplayer_slider_dot{background:var(--theme-color);border-radius:50%;height:13px;left:-6px;pointer-events:none;position:absolute;top:.5px;width:13px}.nplayer_checkbox{align-items:center;color:#fff;cursor:pointer;display:inline-flex;font-size:12px;position:relative;transition:color .2s ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.nplayer_checkbox:before{border:1px solid;border-radius:2px;content:"";display:block;height:1em;margin-right:5px;transition:background .2s ease;width:1em}.nplayer_checkbox:after{border:1px solid #fff;border-left:0;border-top:0;content:"";height:7px;left:.5em;opacity:0;position:absolute;top:50%;transform:translate(-30%,-70%) rotate(45deg);width:4px}.nplayer_checkbox:hover{color:var(--theme-color)}.nplayer_checkbox-active:before{background:var(--theme-color);border-color:var(--theme-color)}.nplayer_checkbox-active:after{opacity:1}.nplayer_poster{background-color:var(--poster-bg-color);background-position:50% 50%;background-repeat:no-repeat;background-size:cover;bottom:0;left:0;position:absolute;right:0;top:0}.nplayer_poster_play{cursor:pointer;height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50px}.nplayer_control{bottom:0;left:0;padding:0 5px 8px;position:absolute;right:0;transition:opacity .2s ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.nplayer_control-hide{opacity:0;pointer-events:none}.nplayer_control:hover{cursor:default!important;opacity:1!important;pointer-events:auto!important}.nplayer_control:hover~.nplayer_control_bg{opacity:1!important}.nplayer_control_bg{background:url('+f+') repeat-x bottom;bottom:0;height:100px;left:0;pointer-events:none;position:absolute;right:0;transition:opacity .2s ease}.nplayer_control_bg-hide{opacity:0}.nplayer_control_bar{align-items:center;display:flex;font-size:0}.nplayer_control_bar-top{left:0;padding-top:5px;position:absolute;right:0;top:0;transition:opacity .2s ease;z-index:10}.nplayer_control_bar-hide{opacity:0;pointer-events:none}.nplayer_control_bar>div{margin:0 3px}.nplayer_control_time{font-size:13px;white-space:nowrap}.nplayer_control_time-live{align-items:center;display:flex}.nplayer_control_time-live:before{background:var(--theme-color);border-radius:50%;content:"";display:block;height:10px;margin-right:5px;margin-top:2px;width:10px}.nplayer_control_time :first-child:after{content:"/";display:inline-block;font-size:12px;margin:0 5px;transform:translateY(-.5px)}.nplayer_control_volume{position:relative;z-index:1}.nplayer_control_volume-ver .nplayer_control_volume_bars{bottom:100%;left:0;right:0}.nplayer_control_volume-hor .nplayer_control_volume_bars{bottom:0;left:100%;top:0}.nplayer_control_volume_bars{background:rgba(255,255,255,.3);font-size:0;opacity:0;overflow:hidden;pointer-events:none;position:absolute;transition:opacity .2s ease}.nplayer_control_volume:hover .nplayer_control_volume_bars{opacity:1;pointer-events:auto}.nplayer_control_volume_bar{background:var(--volume-progress-bg);height:100%;transform:scaleX(0) scaleY(0);transform-origin:0 100%;width:100%;will-change:transform}.nplayer_control_setting .nplayer_icon{transition:transform .2s ease}.nplayer_control_setting-active{background:var(--theme-color)}.nplayer_control_setting-active .nplayer_icon{transform:rotate(90deg)}.nplayer_control_setting_item,.nplayer_control_setting_option{align-items:center;display:flex;padding:5px 8px}.nplayer_control_setting_item:hover,.nplayer_control_setting_option:hover{background:rgba(255,255,255,.2)}.nplayer_control_setting_item{justify-content:space-between}.nplayer_control_setting_item>:first-child{margin-right:20px}.nplayer_control_setting_item-select:after{border:4px solid transparent;border-left-color:#fff;content:"";display:block;height:0;margin-left:10px;width:0}.nplayer_control_setting_option:before{border-bottom:1px solid #fff;border-right:1px solid #fff;content:"";display:inline-block;height:12px;margin-left:6px;margin-right:17px;opacity:0;transform:rotate(45deg);width:5px}.nplayer_control_setting_option-active:before{opacity:1}.nplayer_control_setting_back{border-bottom:1px solid rgba(255,255,255,.2);justify-content:flex-start;padding-right:20px}.nplayer_control_setting_back:before{border:4px solid transparent;border-right-color:#fff;content:"";display:block;height:0;margin-right:21px;width:0}.nplayer_contextmenu{background:rgba(0,0,0,.7);font-size:14px;left:0;padding:3px 0;position:absolute;top:0}.nplayer_contextmenu_item{align-items:center;cursor:pointer;display:flex;justify-content:space-between;padding:5px 8px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.nplayer_contextmenu_item:hover{background:rgba(255,255,255,.2)}.nplayer_contextmenu_item-disabled{color:rgba(255,255,255,.5)}.nplayer_contextmenu_item-disabled:hover{background:transparent}.nplayer_contextmenu_item-checked:after{border-bottom:1px solid #fff;border-right:1px solid #fff;content:"";display:inline-block;height:12px;margin:0 2px 5px;transform:rotate(45deg);width:5px}.nplayer_progress{cursor:pointer;flex:1;padding:5px 0;position:relative}.nplayer_progress_bars{background:rgba(255,255,255,.3);height:4px;overflow:hidden;position:relative;touch-action:none;transition:height .12s ease}.nplayer_progress_dot{left:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:opacity .2s ease}.nplayer_progress_dot>:first-child{transform:translate(-50%)}.nplayer_progress_dot_inner{background:var(--theme-color);border-radius:50%;height:13px;width:13px}@media not all and (hover:none){.nplayer_progress_dot{opacity:0}.nplayer_progress:hover .nplayer_progress_dot{opacity:1}}.nplayer_progress_buf,.nplayer_progress_played{bottom:0;left:0;position:absolute;right:0;top:0;transform:scaleX(0);transform-origin:0 0}.nplayer_progress_played{background:var(--progress-bg);will-change:transform}.nplayer_progress_buf,.nplayer_progress_hover{background:rgba(255,255,255,.5)}.nplayer_progress_hover{opacity:0}.nplayer_progress:hover .nplayer_thumb{display:block}.nplayer_thumb{bottom:20px;display:none;font-size:12px;left:0;pointer-events:none;position:absolute;text-align:center;text-shadow:0 0 2px rgba(0,0,0,.3)}.nplayer_thumb_img{background-color:rgba(255,255,255,.5);background-repeat:no-repeat;border:1px solid #fff;box-shadow:0 0 10px rgba(0,0,0,.1)}.nplayer_thumb_time{background:rgba(0,0,0,.7);border-radius:3px;display:inline-block;margin-top:5px;padding:2px 5px 3px}@-webkit-keyframes nplayer-loading{0%{opacity:.85}50%{opacity:.25}to{opacity:.25}}@keyframes nplayer-loading{0%{opacity:.85}50%{opacity:.25}to{opacity:.25}}',""]),e.default=s},645:function(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var c=0;c<this.length;c++){var l=this[c][0];null!=l&&(a[l]=!0)}for(var u=0;u<t.length;u++){var s=[].concat(t[u]);o&&a[s[0]]||(void 0!==i&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=i),n&&(s[2]?(s[1]="@media ".concat(s[2]," {").concat(s[1],"}"),s[2]=n):s[2]=n),r&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=r):s[4]="".concat(r)),e.push(s))}},e}},667:function(t){"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},81:function(t){"use strict";t.exports=function(t){return t[1]}},4:function(t,e,n){var o;"undefined"!=typeof window&&window.document&&function(){var t=n(14);t.__esModule&&(t=t.default);var e="string"==typeof t?t:t[0][1],r=!1;o||((o=document.createElement("style")).setAttribute("type","text/css"),r=!0),"textContent"in o?o.textContent=e:o.styleSheet.cssText=e,r&&document.head.appendChild(o)}()},831:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg=="}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,n),i.exports}n.m=t,n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.b=document.baseURI||self.location.href;var o={};return function(){"use strict";n.r(o),n.d(o,{AIRPLAY:function(){return ln},CLASS_PLAYER:function(){return c},CLASS_PREFIX:function(){return a},Checkbox:function(){return br},ContextMenu:function(){return re},Control:function(){return Mt},EVENT:function(){return l},EXIT_FULL_SCREEN:function(){return Ze},FULL_SCREEN:function(){return Xe},Fullscreen:function(){return ge},I18n:function(){return sn},Icon:function(){return pn},LIVE:function(){return un},LOOP:function(){return an},Loading:function(){return qt},MUTE:function(){return tn},NORMAL:function(){return nn},PAUSE:function(){return $e},PIP:function(){return rn},PLAY:function(){return Je},Player:function(){return Xr},Popover:function(){return Le},SETTINGS:function(){return Qe},SPEED:function(){return on},Shortcut:function(){return jn},Slider:function(){return kr},Switch:function(){return Ve},Toast:function(){return de},ToastItem:function(){return ye},Tooltip:function(){return bt},UNMUTE:function(){return en},VOLUME:function(){return cn},WEB_EXIT_FULL_SCREEN:function(){return Ke},WEB_FULL_SCREEN:function(){return qe},WebFullscreen:function(){return Ee},default:function(){return Xr}});var t={};n.r(t),n.d(t,{Checkbox:function(){return br},Popover:function(){return Le},Slider:function(){return kr},Switch:function(){return Ve},Tooltip:function(){return bt}});n(4);function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function r(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){i(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a="nplayer_",c="nplayer",l={ENTER_FULLSCREEN:"EnterFullscreen",EXIT_FULLSCREEN:"ExitFullscreen",WEB_ENTER_FULLSCREEN:"WebEnterFullscreen",WEB_EXIT_FULLSCREEN:"WebExitFullscreen",DURATION_CHANGE:"DurationChange",RATE_CHANGE:"RateChange",AFTER_INIT:"AfterInit",PLAY:"Play",PAUSE:"Pause",ENDED:"Ended",WAITING:"Waiting",STALLED:"Stalled",CANPLAY:"Canplay",LOADED_METADATA:"LoadedMetadata",ERROR:"Error",SEEKED:"Seeked",TIME_UPDATE:"TimeUpdate",VOLUME_CHANGE:"VolumeChange",PROGRESS:"Progress",ENTER_PIP:"EnterPip",EXIT_PIP:"ExitPip",LOADING_SHOW:"LoadingShow",LOADING_HIDE:"LoadingHide",MOUNTED:"Mounted",UPDATE_SIZE:"UpdateSize",BEFORE_DISPOSE:"BeforeDispose",UPDATE_OPTIONS:"UpdateOptions",OPEN_EDGE:"OpenEdge",CONTROL_SHOW:"ControlShow",CONTROL_HIDE:"ControlHide",CONTROL_ITEM_UPDATE:"ControlItemUpdate",BP_CHANGE:"BpChange"},u="undefined"!=typeof window,s=u&&/(iPad|iPhone|iPod)/gi.test(navigator.platform),f=u&&/MSIE|Trident/.test(navigator.userAgent),p=u&&f&&navigator.userAgent.indexOf("Windows NT 10.0")>-1;function h(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var y=/([\w-]+)?(?:#([\w-]+))?((?:\.(?:[\w-]+))*)/;function d(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a,r=[];t&&(r=y.exec(t)||[]);var i=document.createElement(r[1]||"div");return r[2]&&(i.id=r[3]),r[3]&&(i.className=r[3].replace(/\./g," ".concat(o)).trim()),e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(/^on\w+$/.test(t)?i[t]=n:"selected"===t?n&&i.setAttribute(t,"true"):i.setAttribute(t,n))})),n&&(N(n)?i.innerHTML=n:n.forEach((function(t){return i.appendChild(t)}))),i}function b(t){return t?N(t)?document.querySelector(t):t:null}function v(t){t&&(t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t))}function m(t){t.style.display=""}function g(t){t.style.display="none"}function _(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;if(!(e=e.trim()))return t;if(t.classList)e.split(" ").forEach((function(e){return t.classList.add(n+e)}));else{var o=t.className&&t.className.baseVal||"";t.setAttribute("class",(o?"".concat(o," "):"")+e.split(" ").map((function(t){return n+t})).join(" "))}return t}function w(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return t.classList.remove(n+e),t}function E(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;return t.classList.contains(n+e)}function O(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;return e=o+e,n?(t.classList.add(e),!0):!1===n?(t.classList.remove(e),!0):t.classList.toggle(e,n)}var k="http://www.w3.org/2000/svg";function P(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0 0 24 24",o=document.createElementNS(k,"svg");if(o.setAttribute("viewBox",n),t&&_(o,t),e){var r=document.createElementNS(k,"path");r.setAttributeNS(null,"d",e),o.appendChild(r)}return o}function x(t){return t.path||t.composedPath()}var T=!1;if(u)try{var S=Object.defineProperty({},"once",{get:function(){T=!0}});window.addEventListener("test",null,S)}catch(t){}var j=function(){function t(e,n,o,r){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.node=e,this.type=n,this.handler=o,this.options=r,this.options=!0===(i=r)||!1===i||"[object Boolean]"===B.call(i)?r:!!r&&(T&&r),e.addEventListener(n,o,this.options)}var e,n,o;return e=t,(n=[{key:"dispose",value:function(){this.handler&&(this.node.removeEventListener(this.type,this.handler,this.options),this.node=null,this.handler=null,this.options=null)}}])&&h(e.prototype,n),o&&h(e,o),t}();function C(t){var e=t.cloneNode(!0);e.style.position="absolute",e.style.opacity="0",e.removeAttribute("hidden");var n=t.parentNode||document.body;n.appendChild(e);var o=e.getBoundingClientRect();return n.removeChild(e),o}function R(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function L(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var I=function(){function t(e,n,o,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),L(this,"pending",!1),L(this,"downHandler",(function(t){t.preventDefault(),i.el.setPointerCapture(t.pointerId),i.el.addEventListener("pointermove",i.moveHandler,!0),i.start(t)})),L(this,"moveHandler",(function(t){t.preventDefault(),i.lastEv=t,i.pending||(i.pending=!0,requestAnimationFrame(i.handlerMove))})),L(this,"handlerMove",(function(){i.move(i.lastEv),i.pending=!1})),L(this,"upHandler",(function(t){t.preventDefault(),i.el.releasePointerCapture(t.pointerId),i.el.removeEventListener("pointermove",i.moveHandler,!0),i.end&&i.end(t)})),this.el=e,this.start=n,this.move=o,this.end=r,e.addEventListener("pointerdown",this.downHandler,!0),e.addEventListener("pointerup",this.upHandler,!0),e.addEventListener("pointercancel",this.upHandler,!0)}var e,n,o;return e=t,(n=[{key:"dispose",value:function(){this.el&&(this.el.removeEventListener("pointerdown",this.downHandler,!0),this.el.removeEventListener("pointerup",this.upHandler,!0),this.el.removeEventListener("pointercancel",this.upHandler,!0),this.el.removeEventListener("pointermove",this.moveHandler,!0),this.start=null,this.move=null,this.end=null,this.lastEv=null,this.el=null)}}])&&R(e.prototype,n),o&&R(e,o),t}();function A(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var D=function(){function t(e,n){var o,r,i,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i=function(){a.rect=a.el.getBoundingClientRect()},(r="update")in(o=this)?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i,this.el=e,this.player=n,this.rect={},n&&n.on(l.UPDATE_SIZE,this.update)}var e,n,o;return e=t,(n=[{key:"isHeightGtWidth",get:function(){return this.width<this.height}},{key:"width",get:function(){return this.tryUpdate(this.rect.width),this.rect.width}},{key:"height",get:function(){return this.tryUpdate(this.rect.height),this.rect.height}},{key:"x",get:function(){return this.tryUpdate(this.rect.left),this.rect.left}},{key:"y",get:function(){return this.tryUpdate(this.rect.top),this.rect.top}},{key:"changed",get:function(){var t=this.el.getBoundingClientRect(),e=t.top!==this.rect.top||t.left!==this.rect.left||t.width!==this.rect.width||t.height!==this.rect.height;return e&&(this.rect=t),e}},{key:"tryUpdate",value:function(t){t||this.update()}},{key:"dispose",value:function(){this.player&&this.player.off(l.UPDATE_SIZE,this.update),this.el=null,this.rect=null}}])&&A(e.prototype,n),o&&A(e,o),t}(),B=Object.prototype.toString;function N(t){return"string"==typeof t||t instanceof String}function H(t){return"function"==typeof t}function M(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var F=function t(e,n,o){U(this,t),this.fn=e,this.context=n,this.once=o,this.once=o||!1},V=function(){function t(){U(this,t),this._events=Object.create(null),this._eventsCount=0}var e,n,o;return e=t,(n=[{key:"emit",value:function(t,e,n,o,r,i){if(!this._events[t])return!1;var a,c,l=this._events[t],u=arguments.length;if(l.fn){switch(l.once&&this.off(t,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,o),!0;case 5:return l.fn.call(l.context,e,n,o,r),!0;case 6:return l.fn.call(l.context,e,n,o,r,i),!0}for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];l.fn.apply(l.context,a)}else{var s,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.off(t,l[c].fn,void 0,!0),u){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,o);break;default:if(!a)for(s=1,a=new Array(u-1);s<u;s++)a[s-1]=arguments[s];l[c].fn.apply(l[c].context,a)}}return!0}},{key:"on",value:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof e)throw new TypeError("The listener must be a function");var r=new F(e,n||this,o);return this._events[t]?this._events[t].fn?this._events[t]=[this._events[t],r]:this._events[t].push(r):(this._events[t]=r,this._eventsCount++),{dispose:this.off.bind(this,t,e)}}},{key:"once",value:function(t,e,n){return this.on(t,e,n,!0)}},{key:"off",value:function(t,e,n,o){if(!this._events[t])return this;if(!e)return this.clearEvent(t),this;var r=this._events[t],i=[];if(r.fn)r.fn!==e||o&&!r.once||n&&r.context!==n||this.clearEvent(t);else{for(var a=0,c=r.length;a<c;a++)(r[a].fn!==e||o&&!r[a].once||n&&r[a].context!==n)&&i.push(r[a]);i.length?this._events[t]=1===i.length?i[0]:i:this.clearEvent(t)}return this}},{key:"removeAllListeners",value:function(t){return t?this._events[t]&&this.clearEvent(t):(this._events=Object.create(null),this._eventsCount=0),this}},{key:"clearEvent",value:function(t){0==--this._eventsCount?this._events=Object.create(null):delete this._events[t]}}])&&M(e.prototype,n),o&&M(e,o),t}();function z(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Y=function(){function t(e,n,o,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n&&!N(n)?this.el=n:this.el=d(n,o,r,i),e&&e.appendChild(this.el)}var e,n,o;return e=t,(n=[{key:"applyStyle",value:function(t){Object.assign(this.el.style,t)}},{key:"dispose",value:function(){v(this.el),et(this)}}])&&z(e.prototype,n),o&&z(e,o),t}();function W(t,e){return!(!t||!e)&&(t===e||t.id===e.id)}function G(t,e){v(t.el),e&&e(t)}function X(t,e,n,o){e.insertBefore(t.el,(null==n?void 0:n.el)||null),o&&o(t)}function Z(t){for(var e,n=[],o=[t[0]],r=0,i=0,a=0,c=0,l=1,u=t.length;l<u;++l)if(-1!==(e=t[l]))if(e>t[o[c=o.length-1]])n[l]=o[c],o.push(l);else{for(r=0,i=c;r<i;)e>t[o[a=(r+i)/2|0]]?r=a+1:i=a;n[l]=o[r-1],o[r]=l}for(r=o[(c=o.length)-1];c-- >0;)o[c]=r,r=n[r];return o}var q={checked:!0,muted:!0,multiple:!0,selected:!0};function K(t,e,n){q[e]?t[e]=n:null==n?t.removeAttribute(e):t.setAttribute(e,n)}function Q(t,e,n){var o,r;void 0!==n&&(Object.keys(n).forEach((function(i){o=e[i],r=n[i],"style"===i?function(t,e,n){void 0!==n&&(n?(Object.keys(n).forEach((function(e){t.style[e]=n[e]||""})),Object.keys(e).forEach((function(e){e in n||(t.style[e]="")}))):t.removeAttribute("style"))}(t,o,r):o!==r&&K(t,i,r)})),Object.keys(e).forEach((function(e){e in n||K(t,e,void 0)})))}function J(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.max(Math.min(t,n),e)}var $=new Map;function tt(t,e){return $.has(t)||$.set(t,[]),$.get(t).push(e),e}function et(t){$.has(t)&&($.get(t).forEach((function(t){return t.dispose()})),$.delete(t))}function nt(t,e,n,o,r){var i=new j(e,n,o,r);return t&&tt(t,i),i}function ot(t,e){var n=!1,o=!0,r=null;return function(){if(r=arguments,o)return o=!1,t.apply(e,r);n||(n=!0,requestAnimationFrame((function(){t.apply(e,r),n=!1})))}}function rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";if((t=String(t)).length>=2)return t;for(var o=0,r=e-t.length;o<r;o++)t=n+t;return t}function it(t){return isFinite(t)?t<=0?"0:00":(t=Math.round(t))<60?"0:".concat(rt(t)):t<3600?"".concat(Math.floor(t/60),":").concat(rt(t%60)):"".concat(Math.floor(t/3600),":").concat(rt(Math.floor(t%3600/60)),":").concat(rt(t%60)):"-"}var at={$:d,clamp:J,addDisposableListener:nt,addDisposable:tt,createSvg:P,dispose:et,getEventPath:x,removeNode:v,addClass:_};function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function ut(t,e){return(ut=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){var e=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(t){return!1}}();return function(){var n,o=pt(t);if(e){var r=pt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return ft(this,n)}}function ft(t,e){if(e&&("object"===ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pt(t){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ht="tooltip-left",yt="tooltip-right",dt="tooltip-bottom",bt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ut(t,e)}(i,t);var e,n,o,r=st(i);function i(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),n=r.call(this,t,".tooltip_content"),_(t,"tooltip"),e&&(n.html=e),n}return e=i,(n=[{key:"html",get:function(){return this.el.innerHTML},set:function(t){this.el.innerHTML=t}},{key:"resetPos",value:function(){w(this.el,ht),w(this.el,yt),w(this.el,dt)}},{key:"setBottom",value:function(){_(this.el,dt)}},{key:"setLeft",value:function(){_(this.el,ht)}},{key:"setRight",value:function(){_(this.el,yt)}},{key:"hide",value:function(){g(this.el)}},{key:"show",value:function(){m(this.el)}}])&<(e.prototype,n),o&<(e,o),i}(Y),vt=function(){return{id:"spacer",el:d(".spacer")}};function mt(t){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function wt(t,e){return(wt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Et(t){var e=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(t){return!1}}();return function(){var n,o=Pt(t);if(e){var r=Pt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Ot(this,n)}}function Ot(t,e){if(e&&("object"===mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return kt(t)}function kt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pt(t){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Tt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wt(t,e)}(i,t);var e,n,o,r=Et(i);function i(t,e,n){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(gt(this,i),xt(kt(o=r.call(this,t,".control_bar")),"prevItems",[]),xt(kt(o),"spacer",vt()),xt(kt(o),"initControlItem",(function(t){var e;if(t=o.getItem(t))return t.el||(t.el=d()),t.mounted?(t.tooltip&&(t.tooltip.resetPos(),2===o.position&&t.tooltip.setBottom()),void(t.update&&t.update(o.position))):(t.tip&&(e=new bt(t.el,t.tip)),t.init&&(t.init.length>2&&!e&&(e=new bt(t.el)),t.init(o.player,o.position,e)),t.dispose&&tt(kt(o),t),e||(e=t.tooltip),e&&(e.resetPos(),2===o.position&&e.setBottom()),t.mounted=!0,t)})),xt(kt(o),"onHideControlItem",(function(t){t.hide&&t.hide()})),o.player=e,o.position=a,2===a&&_(o.el,"control_bar-top"),n){var c=document.createDocumentFragment();n.forEach((function(t){(t=o.initControlItem(t))&&(c.appendChild(t.el),o.prevItems.push(t))})),o.updateTooltipPos(),o.el.appendChild(c)}return o}return e=i,(n=[{key:"getItem",value:function(t){return"spacer"===t?this.spacer:(N(t)&&(t=this.player.getControlItem(t)),!t||t.isSupport&&!t.isSupport(this.player)?void 0:t)}},{key:"updateTooltipPos",value:function(){var t=this,e=this.prevItems.length-1;this.prevItems.forEach((function(n,o){n.tooltip&&(n.tooltip.resetPos(),2===t.position&&n.tooltip.setBottom(),0===o?n.tooltip.setLeft():o===e&&n.tooltip.setRight())}))}},{key:"getItems",value:function(){return this.prevItems}},{key:"setItems",value:function(t){t&&(this.prevItems=t)}},{key:"update",value:function(t){var e=this;if(t){var n=[];t.forEach((function(t){(t=e.getItem(t))&&n.push(t)})),function(t,e,n){for(var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t.length-1,i=e.length-1,a=0,c=t[a],l=e[a];W(c,l);)c=t[++a],l=e[a];if(a<r&&a<i)for(c=t[r],l=e[i];W(c,l);)c=t[--r],l=e[--i];if(!(a>r&&a>i))if(a>r)for(var u=a;u<=i;u++)X(e[u],n,void 0,o.mount);else if(a>i)for(var s=a;s<=r;s++)G(t[s],o.unmount);else{for(var f=[],p=new Map,h=a;h<=i;h++)f.push(-1),p.set(e[h].id||e[h],h);for(var y=!1,d=0,b=0,v=a;v<=r;v++)c=t[v],null==(b=p.get(c.id||c))?G(c,o.unmount):(f[b-a]=v,d>b?y=!0:d=b);for(var m,g,_=y?Z(f):[],w=_.length-1,E=f.length-1;E>-1;E--)m=f[E],g=e[(b=a+E)+1],-1===m?X(e[b],n,g,o.mount):y&&(E===_[w]?w--:X(e[b],n,g,o.update))}}(this.prevItems,n,this.el,{mount:this.initControlItem,unmount:this.onHideControlItem}),this.prevItems=n,this.updateTooltipPos(),this.player.emit(l.CONTROL_ITEM_UPDATE)}}}])&&_t(e.prototype,n),o&&_t(e,o),i}(Y);function St(t){return(St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Ct(t,e){return(Ct=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Rt(t){var e=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(t){return!1}}();return function(){var n,o=At(t);if(e){var r=At(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Lt(this,n)}}function Lt(t,e){if(e&&("object"===St(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return It(t)}function It(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function At(t){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Dt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bt="control-hide",Nt="control_bg-hide",Ht="control_bar-hide",Mt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ct(t,e)}(i,t);var e,n,o,r=Rt(i);function i(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Dt(It(n=r.call(this,t,".control")),"delayHidTime",3e3),Dt(It(n),"latch",0),Dt(It(n),"controlBars",[]),Dt(It(n),"emitAndUpdateBp",(function(){var t=n.player.rect.width,e=n.controls.find((function(e){return t<=e.bp}));if(n.currentBp!=(null==e?void 0:e.bp)){n.currentBp=null==e?void 0:e.bp;var o=(null==e?void 0:e.controls)||n.player.opts.controls;n.updateItems(o[0],0),n.updateItems(o[1],1),n.updateItems(o[2],2),n.player.emit(l.BP_CHANGE,n.currentBp)}return e})),Dt(It(n),"show",(function(){w(n.el,Bt),w(n.bgElement,Nt),w(n.controlBars[2].el,Ht),n.player.el.style.cursor="",n.player.emit(l.CONTROL_SHOW)})),Dt(It(n),"hide",(function(){_(n.el,Bt),_(n.bgElement,Nt),_(n.controlBars[2].el,Ht),n.player.el.style.cursor="none",n.player.emit(l.CONTROL_HIDE)})),Dt(It(n),"showTransient",(function(){n.show(),clearTimeout(n.showTimer),n.showTimer=setTimeout(n.tryHide,n.delayHidTime)})),Dt(It(n),"tryHide",(function(){!n.player.video.played.length||n.player.paused||n.latch||n.hide()})),n.player=e,n.bgElement=t.appendChild(d(".control_bg")),n.controlBars[1]=tt(It(n),new Tt(n.el,e,e.opts.controls[1],1)),n.controlBars[0]=tt(It(n),new Tt(n.el,e,e.opts.controls[0],0)),n.controlBars[2]=tt(It(n),new Tt(t,e,e.opts.controls[2],2));var o=e.opts.bpControls;return n.controls=Object.keys(o).map((function(t){return{bp:Number(t),controls:o[t]}})).sort((function(t,e){return t.bp-e.bp})),n.controls.length&&(tt(It(n),e.on(l.UPDATE_SIZE,n.emitAndUpdateBp)),tt(It(n),e.on(l.MOUNTED,n.emitAndUpdateBp))),tt(It(n),e.on(l.PAUSE,(function(){e.opts.isTouch||n.show()}))),tt(It(n),e.on(l.PLAY,(function(){e.opts.isTouch||n.showTransient()}))),nt(It(n),e.el,"mousemove",n.showTransient),nt(It(n),e.el,"mouseleave",n.tryHide),n.showTransient(),n}return e=i,(n=[{key:"isActive",get:function(){return!E(this.el,Bt)}},{key:"filterItems",value:function(t,e){if(t.length&&e.length){var n=new Map;return t.forEach((function(t){return n.set(t,!0)})),e.filter((function(t){return!n.get(t)}))}}},{key:"updateItems",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=this.controlBars[n];if(o){o.update(t||[]);var r=o.getItems();this.controlBars.forEach((function(t,o){o!==n&&(t.setItems(e.filterItems(r,t.getItems())),t.updateTooltipPos())}))}}},{key:"require",value:function(){this.latch++}},{key:"release",value:function(){this.latch&&(this.latch--,this.tryHide())}}])&&jt(e.prototype,n),o&&jt(e,o),i}(Y);function Ut(t){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ft(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Vt(t,e){return(Vt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zt(t){var e=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(t){return!1}}();return function(){var n,o=Gt(t);if(e){var r=Gt(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Yt(this,n)}}function Yt(t,e){if(e&&("object"===Ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Wt(t)}function Wt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gt(t){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Zt="-loading",qt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vt(t,e)}(i,t);var e,n,o,r=zt(i);function i(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Xt(Wt(n=r.call(this,t,e.opts.loadingEl||".loading",void 0,e.opts.loadingEl?void 0:function(t,e){for(var n=[],o=0;o<e;++o)n.push(t);return n.join("")}("<i></i>",12))),"startWaitingTime",0),Xt(Wt(n),"_checkCanplay",(function(){n.startWaitingTime!==n.player.currentTime&&(n.hide(),clearTimeout(n.showTimer),n.player.off(l.TIME_UPDATE,n._checkCanplay))})),Xt(Wt(n),"show",(function(){_(n.player.el,Zt,c),n.player.emit(l.LOADING_SHOW)})),Xt(Wt(n),"hide",(function(){w(n.player.el,Zt,c),n.player.emit(l.LOADING_HIDE)})),n.player=e,tt(Wt(n),e.on(l.CANPLAY,n.hide)),tt(Wt(n),e.on(l.WAITING,(function(){n.player.currentTime&&n.tryShow()}))),tt(Wt(n),e.on(l.STALLED,(function(){var t=n.player.currentTime;if(t){var e=!0;n.player.eachBuffer((function(n,o){if(n<=t&&o>t)return e=!1,!0})),e&&n.tryShow()}}))),n}return e=i,(n=[{key:"isActive",get:function(){return E(this.player.el,Zt,c)}},{key:"checkCanplay",value:function(){this.startWaitingTime=this.player.currentTime,this.player.off(l.TIME_UPDATE,this._checkCanplay),this.player.on(l.TIME_UPDATE,this._checkCanplay)}},{key:"tryShow",value:function(){this.checkCanplay(),clearTimeout(this.showTimer),this.showTimer=setTimeout(this.show,100)}}])&&Ft(e.prototype,n),o&&Ft(e,o),i}(Y);function Kt(t){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Jt(t,e){return(Jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $t(t){var e=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(t){return!1}}();return function(){var n,o=ne(t);if(e){var r=ne(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return te(this,n)}}function te(t,e){if(e&&("object"===Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ee(t)}function ee(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ne(t){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jt(t,e)}(i,t);var e,n,o,r=$t(i);function i(t,e,n){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),oe(ee(o=r.call(this,t,".contextmenu")),"showed",!1),oe(ee(o),"hide",(function(){g(o.el)})),o.player=e,o.items=n,g(o.el),o.rect=new D(o.el,e),o.items.forEach((function(t){return t.init&&t.init(e,t)})),nt(ee(o),e.el,"contextmenu",(function(t){if(o.hide(),(!e.opts.contextMenuToggle||!o.showed)&&(t.preventDefault(),t.stopPropagation(),o.renderItems())){m(o.el),o.rect.update(),o.player.rect.update();var n=o.rect,r=n.width,i=n.height,a=o.player.rect,c=a.x,l=a.y,u=window,s=u.innerWidth,f=u.innerHeight,p=t.clientX,h=t.clientY,y=p-c,d=h-l;p+r>s&&(y=s-r),h+i>f&&(d=f-i),o.applyStyle({left:"".concat(y,"px"),top:"".concat(d,"px")})}o.showed=!o.showed})),nt(ee(o),document,"click",(function(){o.showed=!1,o.hide()})),o}return e=i,(n=[{key:"getDomNodes",value:function(){var t=this;return this.items.filter((function(t){return t&&!t.invisible})).map((function(e){var n=d(".contextmenu_item");return e.show&&e.show(t.player,e),e.html&&(n.innerHTML=e.html),e.disabled&&_(n,"contextmenu_item-disabled"),e.checked&&_(n,"contextmenu_item-checked"),e.click&&n.addEventListener("click",(function(){return e.click(t.player,e)}),!1),n}))}},{key:"renderItems",value:function(){var t=this.getDomNodes();if(!t.length)return!1;this.el.textContent="";var e=document.createDocumentFragment();return t.forEach((function(t){return e.appendChild(t)})),this.el.appendChild(e),!0}},{key:"isActive",get:function(){return"none"!==this.el.style.display}}])&&Qt(e.prototype,n),o&&Qt(e,o),i}(Y);function ie(t){return(ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function le(t,e,n){return e&&ce(t.prototype,e),n&&ce(t,n),t}function ue(t,e,n){return(ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var o=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=he(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function se(t,e){return(se=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fe(t){var e=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(t){return!1}}();return function(){var n,o=he(t);if(e){var r=he(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return pe(this,n)}}function pe(t,e){if(e&&("object"===ie(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function he(t){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ye=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super express