var __vite_style__=document.createElement("style");__vite_style__.innerHTML='@charset "UTF-8";.status-bar-tools{position:absolute;margin:10px;padding:10px;background:rgba(49,49,49,.8);border:1px solid rgb(32,32,32);border-radius:4px;z-index:10}.lk-status-bar{position:absolute;bottom:0;width:100%;background-color:#3a3939cc;text-align:right;font-size:.9rem;color:#fff;padding:3px 0}.lk-status-bar .status-all{float:left;padding:0 10px;color:#08df08}.lk-status-bar .status-position{padding:0 5px}.lk-status-bar .status-position span{padding:0 5px}.lk-status-bar .status-scale{display:inline-flex;align-items:flex-end;margin-right:10px}.lk-status-bar .status-scale .scale-border{border:2px solid rgb(243,242,242);border-top:0;height:6px;line-height:1px;padding:0 5px;margin:3px 0;font-size:.5rem}.cesium-viewer-toolbar,.cesium-viewer-animationContainer,.cesium-viewer-timelineContainer,.cesium-viewer-bottom{display:none}.cesium-performanceDisplay-defaultContainer{top:auto;bottom:30px;right:10px}.cesium-performanceDisplay-throttled{display:none}.cesium-viewer-fullscreenContainer{position:absolute;top:-999em}.MultiField-popup{position:absolute;z-index:999}.MultiField-popup .MultiField-popup-header{background:rgb(15,85,195);color:#fff;font-size:15px;padding:10px;text-align:left}.MultiField-popup .MultiField-popup-header .leaflet-popup-close-button{position:absolute;right:10px;cursor:pointer}.MultiField-popup .MultiField-popup-content{padding:5px;background:rgba(5,45,115,.7);color:#a0ffff}.MultiField-popup .MultiField-popup-tip{position:absolute;bottom:-25px;left:50%;margin-left:-15px;width:0;height:0;border-left:15px solid transparent;border-right:15px solid transparent;border-top:25px solid rgba(5,45,115,.7)}.MultiField-popup .MultiField-popup-content .table-popup{border-collapse:collapse;text-align:center}.MultiField-popup .MultiField-popup-content .table-popup tr{border:1px solid #cad9ea;color:#a0ffff;height:30px;padding:5px}.MultiField-popup .MultiField-popup-content .table-popup .title-popup{width:100px;background-color:#052d73b3}.MultiField-popup .MultiField-popup-content .table-popup .value-popup{width:120px}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRADK3CxEAAHic7dFZbsMgAEXRS0ycyZnnOeG7y+qC8pU1dHusIOXxuoxaOlwZYWQB0Aea4quIEN4E9LzKbKjzDeM6H/mua6Lmc/p8yhg0lvdYx15ZG8uOLQOGjMp3EzqmzJizYMmKNRu27Nhz4MiJMxeu3Ljz4Ekqm7T8P52G8PP3lnTOVk++Z6iN6QZzNN1F7ptuN7eGOjDUoaGODHVsuvU8MdTO9Hd5aqgzQ50b6sJQl4a6MtS1oW4MdWuoO0PdG+rBUI+GejLUs6FeDPVqqDdDvRvqw1CfhpqM9At0iFLaAAB4nJ1YDXBTVRZ+5/22TUlJ8we0pHlJm7RJf5O8F2j6EymlSPkpxaL8U2xpa3DKj0CBhc2IW4eWKSokIoLsuMqssM64f+j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/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==) format("woff");font-weight:normal;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{content:"\\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-play-circle:before{content:"\\f102"}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:"\\f103"}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:"\\f104"}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:"\\f105"}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:"\\f106"}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before{content:"\\f107"}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:"\\f108"}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:"\\f109"}.vjs-icon-square{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-square:before{content:"\\f10a"}.vjs-icon-spinner{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-spinner:before{content:"\\f10b"}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:"\\f10c"}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before{content:"\\f10d"}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:"\\f10e"}.vjs-icon-share{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-share:before{content:"\\f10f"}.vjs-icon-cog{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-cog:before{content:"\\f110"}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.video-js .vjs-play-progress{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.video-js .vjs-play-progress:before{content:"\\f111"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-circle-outline:before{content:"\\f112"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\f113"}.vjs-icon-hd{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-hd:before{content:"\\f114"}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:"\\f115"}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:"\\f116"}.vjs-icon-facebook{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-facebook:before{content:"\\f117"}.vjs-icon-gplus{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-gplus:before{content:"\\f118"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-linkedin:before{content:"\\f119"}.vjs-icon-twitter{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-twitter:before{content:"\\f11a"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-tumblr:before{content:"\\f11b"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-pinterest:before{content:"\\f11c"}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:"\\f11d"}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:"\\f11e"}.vjs-icon-next-item{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-next-item:before{content:"\\f11f"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-previous-item:before{content:"\\f120"}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:"\\f121"}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:normal;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:"\\f122"}.video-js{display:block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:normal;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js *:before,.video-js *:after{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-1-1{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs){width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:10px;left:10px;padding:0;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-centered .vjs-big-play-button{top:50%;left:50%;margin-top:-.81666em;margin-left:-1.5em}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:bold;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;visibility:visible;opacity:1;position:relative;transition:none}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{position:absolute;bottom:3em;left:.5em}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{top:-.3em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.vjs-no-flex .vjs-volume-control .vjs-mouse-display{z-index:0}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster{display:block}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;width:auto;text-align:left}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control{display:none}.video-js .vjs-current-time,.vjs-no-flex .vjs-current-time{display:none}.video-js .vjs-duration,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0em}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@-webkit-keyframes vjs-spinner-spin{to{-webkit-transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\f10d";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \\f11d";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.video-js.vjs-layout-x-small.vjs-no-flex .vjs-custom-control-spacer{width:auto}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:5px;padding:3px;border:none}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px}.vjs-text-track-settings .vjs-label{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);display:block;margin:0 0 5px;padding:0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible){outline:none}.popup-video{position:absolute;z-index:999}.popup-video .popup-video-header{background:rgb(15,85,195);color:#fff;font-size:15px;padding:10px;text-align:left}.popup-video .popup-video-header .popup-video-close-button{position:absolute;right:10px;cursor:pointer}.popup-video .popup-video-content{padding:0;width:400px}.popup-video .popup-video-tip{position:absolute;bottom:-25px;left:50%;margin-left:-15px;width:0;height:0;border-left:15px solid transparent;border-right:15px solid transparent;border-top:25px solid rgb(15,85,195)}.popup-video2{position:absolute;z-index:999;background:linear-gradient(180deg,rgba(5,31,72,.8) 0%,rgba(1,12,31,.8) 100%);border:1px solid #2177f5;color:#fff}.popup-video2 .rightLine-1{position:absolute;top:0;background:#2177f5;width:4em;right:-4em;height:.2em}.popup-video2 .rightLine-2{position:absolute;top:2.2em;right:-9em;background:#2177f5;width:6em;height:.2em;transform:rotate(47deg);-ms-transform:rotate(47deg);-moz-transform:rotate(47deg);-webkit-transform:rotate(47deg);-o-transform:rotate(47deg)}.popup-video2 .rightLine-3{position:absolute;top:4em;right:-8.6em;width:1em;height:1em;background:#2177f5;background-size:100% 100%;border:solid 4px rgb(250,172,47);border-radius:100%}.popup-video2 .popup-header{width:100%;height:30px;line-height:30px;text-align:center;background:linear-gradient(180deg,rgba(5,31,72,.8) 0%,rgba(1,12,31,.8) 100%)}.popup-video2 .popup-header .popup-title{float:left;padding-left:10px}.popup-video2 .popup-header .popup-close-button{float:right;padding-right:10px;cursor:pointer}.popup-video2 .popup-content{padding:0;width:400px}.popup1{position:absolute;z-index:999}.popup1 .popup-header{background:rgb(15,85,195);color:#fff;font-size:15px;padding:10px;text-align:left}.popup1 .popup-header .leaflet-popup-close-button{position:absolute;right:10px;cursor:pointer}.popup1 .popup-content{padding:5px;background:rgba(5,45,115,.7);color:#a0ffff;text-align:left}.popup1 .popup-tip{position:absolute;bottom:-25px;left:50%;margin-left:-15px;width:0;height:0;border-left:15px solid transparent;border-right:15px solid transparent;border-top:25px solid rgba(5,45,115,.7)}.popup2{position:absolute;z-index:999;background:linear-gradient(180deg,rgba(5,31,72,.8) 0%,rgba(1,12,31,.8) 100%);border:1px solid #2177f5;color:#fff}.popup2 .rightLine-1{position:absolute;top:0;background:#2177f5;width:4em;right:-4em;height:.2em}.popup2 .rightLine-2{position:absolute;top:2.2em;right:-9em;background:#2177f5;width:6em;height:.2em;transform:rotate(47deg);-ms-transform:rotate(47deg);-moz-transform:rotate(47deg);-webkit-transform:rotate(47deg);-o-transform:rotate(47deg)}.popup2 .rightLine-3{position:absolute;top:4em;right:-8.6em;width:1em;height:1em;background:#2177f5;background-size:100% 100%;border:solid 4px rgb(250,172,47);border-radius:100%}.popup2 .popup-header{width:100%;height:30px;line-height:30px;text-align:center;background:linear-gradient(180deg,rgba(5,31,72,.8) 0%,rgba(1,12,31,.8) 100%)}.popup2 .popup-header .popup-title{float:left;padding-left:10px}.popup2 .popup-header .popup-close-button{float:right;padding-right:10px;cursor:pointer}.popup2 .popup-content{padding:5px;width:360px;height:200px;overflow:auto}.popup3{position:absolute;z-index:999;background:linear-gradient(180deg,rgba(5,31,72,.8) 0%,rgba(1,12,31,.8) 100%);border-bottom:3px solid rgb(250,172,47);color:#fff}.popup3 .leftLine-1{position:absolute;bottom:-2.55em;left:-4.6em;background:rgb(250,172,47);width:6em;height:.2em;transform:rotate(125deg);-ms-transform:rotate(125deg);-moz-transform:rotate(125deg);-webkit-transform:rotate(125deg);-o-transform:rotate(125deg)}.popup3 .leftLine-2{position:absolute;bottom:-5.6em;left:-4em;width:1em;height:1em;background:#fff;background-size:100% 100%;border:4px solid rgb(250,172,47);border-radius:100%}.popup3 .popup-header{width:100%;height:30px;line-height:30px;text-align:center;background:rgba(31,63,142,1)}.popup3 .popup-header .popup-title{float:left;padding-left:10px}.popup3 .popup-header .popup-close-button{float:right;padding-right:10px;cursor:pointer}.popup3 .popup-content{padding:5px;width:360px;height:200px;overflow:auto}\n',document.head.appendChild(__vite_style__),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MyLib={})}(this,(function(e){"use strict";function i(e){return null!=e&&""!==e}function n(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(i){t=i.stack}this.stack=t}i(Object.create)&&(n.prototype=Object.create(Error.prototype),n.prototype.constructor=n),n.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return i(this.stack)&&(e+=`\n${this.stack.toString()}`),e},n.throwInstantiationError=function(){throw new n("This function defines an interface and should not be called directly.")};const r={};function o(e,t,i){return`Expected ${i} to be typeof ${t}, actual typeof was ${e}`}r.typeOf={},r.defined=function(e,t){if(!i(t))throw new n(function(e){return`${e} is required, actual value was undefined`}(e))},r.typeOf.func=function(e,t){if("function"!=typeof t)throw new n(o(typeof t,"function",e))},r.typeOf.string=function(e,t){if("string"!=typeof t)throw new n(o(typeof t,"string",e))},r.typeOf.number=function(e,t){if("number"!=typeof t)throw new n(o(typeof t,"number",e))},r.typeOf.number.lessThan=function(e,t,i){if(r.typeOf.number(e,t),t>=i)throw new n(`Expected ${e} to be less than ${i}, actual value was ${t}`)},r.typeOf.number.lessThanOrEquals=function(e,t,i){if(r.typeOf.number(e,t),t>i)throw new n(`Expected ${e} to be less than or equal to ${i}, actual value was ${t}`)},r.typeOf.number.greaterThan=function(e,t,i){if(r.typeOf.number(e,t),t<=i)throw new n(`Expected ${e} to be greater than ${i}, actual value was ${t}`)},r.typeOf.number.greaterThanOrEquals=function(e,t,i){if(r.typeOf.number(e,t),t0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)}static addClass(e,t){if(void 0!==e.classList){let i=a.splitWords(t);for(let t=0,n=i.length;t状态:正常\n \n 经度:${this._posX}\n 纬度:${this._posY}\n 相机高度:${this._cameraHeight}\n 方向:${this._pitch}\n 俯仰角:${this._heading}\n \n \n 比例尺:\n \n ${this._scale}\n \n `}get show(){return this._show}set show(e){e?this.createStatusBar():this.removeStatusBar(),this._show=e}initListener(){const e=this,t=this._viewer.scene;this._scaleListener=function(){let i=t.canvas.clientWidth,n=t.canvas.clientHeight,r=t.camera.getPickRay(new Cesium.Cartesian2(i/2|0,n-1)),o=t.camera.getPickRay(new Cesium.Cartesian2(1+i/2|0,n-1)),s=t.globe,a=s.pick(r,t),l=s.pick(o,t);if(a&&l){let t=new Cesium.EllipsoidGeodesic,i=s.ellipsoid.cartesianToCartographic(a),n=s.ellipsoid.cartesianToCartographic(l);t.setEndPoints(i,n);let r=t.surfaceDistance,o=e.closest(r/10);e._scale=o<1?1e3*o+"m":o+"km"}}}createStatusBar(){const e=this._viewer;this.initHandler(e),this.initScale(e,!0),this._domContainer=l.create("div","lk-status-bar",document.getElementById(this._viewer._container.id))}removeStatusBar(){this.initScale(this._viewer,!1),this._handler&&this._handler.destroy(),this._domContainer&&l.remove(this._domContainer)}initHandler(e){const t=this;this._handler=new Cesium.ScreenSpaceEventHandler(e.scene.canvas);this._handler.setInputAction((function(i){let n=i.endPosition;const r=e.scene.camera.pickEllipsoid(n,e.scene.globe.ellipsoid);if(r){let i=Cesium.Cartographic.fromCartesian(r);t._posX=Cesium.Math.toDegrees(i.longitude).toFixed(5),t._posY=Cesium.Math.toDegrees(i.latitude).toFixed(5);const n=e.camera.positionCartographic.height;t._cameraHeight=n<1e3?n.toFixed(2)+"m":(n/1e3).toFixed(2)+"km",t._pitch=Number(e.scene.camera.pitch).toFixed(2),t._heading=Number(e.scene.camera.heading).toFixed(2),t._domContainer.innerHTML=t.statusDom}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}initScale(e,t){const i=e.scene;t?i.postRender.addEventListener(this._scaleListener):i.postRender.removeEventListener(this._scaleListener)}closest(e){const t=[.001,.002,.003,.005,.01,.015,.02,.025,.03,.035,.04,.045,.05,.06,.07,.08,.09,.1,.12,.15,.2,.25,.3,.5,1,2,3,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100,120,150,200,250,300,500,1e3,2e3,5e3,1e4,1e5,5e5,1e6];let i=t[0],n=Math.abs(i-e);for(let r=1;r{let n=this;this._entities.removeById("fullMapRectangle"),e.isRemove=Cesium.defaultValue(e.isRemove,!0),e.duration=Cesium.defaultValue(e.duration,3),e.heading=Cesium.defaultValue(e.heading,0),e.pitch=Cesium.defaultValue(e.pitch,-90),e.range=Cesium.defaultValue(e.range,0);var r=Cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north),o=this._entities.add({id:"fullMapRectangle",name:"fullMapRectangle",rectangle:{coordinates:r,material:Cesium.Color.GREEN.withAlpha(0),height:10,outline:!1}});this._viewer.flyTo(o,{duration:e.duration,offset:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),range:e.range}}).then((function(i){i&&(e.isRemove&&o&&(n._entities.remove(o),o=null),t(!0))})).catch((function(e){console.log(e)}))}))}});const h=52.35987755982988,d=3.141592653589793,p=6378245,f=.006693421622965943;class m{static BD09ToGCJ02(e,t){let i=+e-.0065,n=+t-.006,r=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*h),o=Math.atan2(n,i)-3e-6*Math.cos(i*h);return[r*Math.cos(o),r*Math.sin(o)]}static GCJ02ToBD09(e,t){t=+t,e=+e;let i=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*h),n=Math.atan2(t,e)+3e-6*Math.cos(e*h);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}static WGS84ToGCJ02(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let i=this.delta(e,t);return[e+i[0],t+i[1]]}}static GCJ02ToWGS84(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];{let i=this.delta(e,t);return[2*e-(e+i[0]),2*t-(t+i[1])]}}static delta(e,t){let i=this.transformLng(e-105,t-35),n=this.transformLat(e-105,t-35);const r=t/180*d;let o=Math.sin(r);o=1-f*o*o;const s=Math.sqrt(o);return i=180*i/(p/s*Math.cos(r)*d),n=180*n/(p*(1-f)/(o*s)*d),[i,n]}static transformLng(e,t){let i=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*d)+20*Math.sin(2*e*d))/3,i+=2*(20*Math.sin(e*d)+40*Math.sin(e/3*d))/3,i+=2*(150*Math.sin(e/12*d)+300*Math.sin(e/30*d))/3,i}static transformLat(e,t){let i=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return i+=2*(20*Math.sin(6*e*d)+20*Math.sin(2*e*d))/3,i+=2*(20*Math.sin(t*d)+40*Math.sin(t/3*d))/3,i+=2*(160*Math.sin(t/12*d)+320*Math.sin(t*d/30))/3,i}static out_of_china(e,t){return t=+t,!((e=+e)>73.66&&e<135.05&&t>3.86&&t<53.55)}static getCatesian3FromPX(e,t){let i=e.scene.drillPick(t),n=null,r=!1,o=!1;for(let a in i){let o=i[a];if((o&&o.primitive instanceof Cesium.Cesium3DTileFeature||o&&o.primitive instanceof Cesium.Cesium3DTileset||o&&o.primitive instanceof Cesium.Model)&&(r=!0),r&&(e.scene.pick(t),n=e.scene.pickPosition(t),n)){let e=Cesium.Cartographic.fromCartesian(n);e.height<0&&(e.height=0);let t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude),r=e.height;n=this.transformWGS84ToCartesian({lng:t,lat:i,alt:r})}}let s=e.terrainProvider instanceof Cesium.EllipsoidTerrainProvider;if(!r&&!s){let i=e.scene.camera.getPickRay(t);if(!i)return null;n=e.scene.globe.pick(i,e.scene),o=!0}if(r||o||!s||(n=e.scene.camera.pickEllipsoid(t,e.scene.globe.ellipsoid)),n){let e=this.transformCartesianToWGS84(n);return e.alt<0&&(n=this.transformWGS84ToCartesian(e,.1)),n}return!1}static transformWGS84ToCartesian(e,t){return e?Cesium.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=t||e.alt,Cesium.Ellipsoid.WGS84):Cesium.Cartesian3.ZERO}static transformCartesianToWGS84(e){let t=Cesium.Ellipsoid.WGS84.cartesianToCartographic(e);return{lng:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),alt:t.height}}static Cartesian3ListToWGS84(e){let t=Cesium.Ellipsoid.WGS84,i=[];for(let n=0;n{this._transformProjection(r)}));let o=this._addImageryProvider(e.id,r);t&&t(o)},addTileMapServiceImagery:function(e,t){if(!i(e)||!i(e.url))throw new n("options.url is required.");e.id=e.id||this._guid();var r=new Cesium.TileMapServiceImageryProvider({url:e.url,fileExtension:"png",minimumLevel:Cesium.defaultValue(e.minimumLevel,0),maximumLevel:e.maximumLevel});let o=this._addImageryProvider(e.id,r);t&&t(o)},addWebMapTileService:function(e,t){if(!i(e)||!i(e.url))throw new n("options.url is required.");e.id=e.id||this._guid();let r=new Cesium.WebMapTileServiceImageryProvider({url:e.url,layer:e.layers,style:e.layerstyle,tileMatrixSetID:e.tileMatrixSetID,tileMatrixLabels:e.tileMatrixLabels,format:Cesium.defaultValue(e.format,"image/png"),minimumLevel:Cesium.defaultValue(e.minimumLevel,0),maximumLevel:e.maximumLevel}),o=this._addImageryProvider(e.id,r);t&&t(o)},addWebMapService:function(e,t){if(!i(e)||!i(e.url))throw new n("options.url is required.");if(!i(e.layers))throw new n("options.layers is required.");e.id=e.id||this._guid();let r=new Cesium.WebMapServiceImageryProvider({url:e.url,layers:e.layers,parameters:{transparent:!0,request:"GetMap",format:"image/png"},minimumLevel:Cesium.defaultValue(e.minimumLevel,0),maximumLevel:e.maximumLevel}),o=this._addImageryProvider(e.id,r);t&&t(o)},addArcGisMapServer:function(e,t){if(!i(e)||!i(e.url))throw new n("options.url is required.");e.id=e.id||this._guid();let r=new Cesium.ArcGisMapServerImageryProvider({url:e.url,layers:e.layers}),o=this._addImageryProvider(e.id,r);t&&t(o)},addCesium3DTileset:function(e,t){if(!i(e)||!i(e.url))throw new n("options.url is required.");e.id=e.id||this._guid();let r=new Cesium.Cesium3DTileset({url:e.url,skipLevelOfDetail:!0,maximumScreenSpaceError:Cesium.defaultValue(e.maximumScreenSpaceError,16)}),o=this._addScenePrimitives(e.id,r);t&&t(o)},addCesium3DTilesetBm:function(e,t){if(!i(e)||!i(e.url))throw new n("options.url is required.");e.id=e.id||this._guid();let r=new Cesium.Cesium3DTileset({url:e.url,skipLevelOfDetail:!0,maximumScreenSpaceError:Cesium.defaultValue(e.maximumScreenSpaceError,16)}),o=this._addScenePrimitives(e.id,r);t&&t(o)}}),Object.assign(g.prototype,{set3DTilesetStyle:function(e){if(!i(e)||!i(e.serviceId))throw new n("options.serviceId is required.");e.color=e.color?"vec4("+e.color[0]+"/255, "+e.color[1]+"/255, "+e.color[2]+"/255, "+e.color[3]+")":"vec4(0.0, 0.58, 0.86, 1.0)",window[e.serviceId].readyPromise.then((t=>{t.boundingSphere.radius,t.boundingSphere.radius>1e4&&t.boundingSphere.radius,t.style=new Cesium.Cesium3DTileStyle({color:e.color}),t.tileVisible.addEventListener((e=>{let t=e.content,i=t.featuresLength;for(let n=0;n{const n=i._sourcePrograms[t],r=i._rendererResources.sourceShaders[n.fragmentShader];let o="";-1!==r.indexOf(" v_positionEC;")?o="v_positionEC":-1!==r.indexOf(" v_pos;")&&(o="v_pos");const s=`vec4(${e.color.toString()})`;i._rendererResources.sourceShaders[n.fragmentShader]=`\n\t\t\t\t\t\t\t\t\t\t\t\t varying vec3 ${o};\n\t\t\t\t\t\t\t\t\t\t\t\t void main(void){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvec4 v_helsing_position = czm_inverseModelView * vec4(${o},1); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat _baseHeight = -30.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat vtxf_height = v_helsing_position.z - _baseHeight;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat stc_pl = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat stc_sd = vtxf_height / 30.0 + sin(stc_pl) * 0.1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = ${s};\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor *= vec4(stc_sd, stc_sd, stc_sd, 1.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* 扫描线 */\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat glowRange = 80.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat stc_a13 = fract(czm_frameNumber / 460.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat stc_h = clamp(v_helsing_position.z / glowRange, 0.0, 1.0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tstc_a13 = abs(stc_a13 - 0.5) * 1.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat stc_diff = step(0.003, abs(stc_h - stc_a13));\n\t\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor.rgb += gl_FragColor.rgb * (1.0 - stc_diff);\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t`})),i._shouldRegenerateShaders=!0)}}))})),this._viewer.scene.requestRender()},set3DTilePosition:function(e){if(!i(e)||!i(e.serviceId))throw new n("options.serviceId is required.");window[e.serviceId].readyPromise.then((function(){let t=window[e.serviceId].boundingSphere,i=Cesium.Cartographic.fromCartesian(t.center),n=Cesium.Cartesian3.fromRadians(i.longitude,i.latitude,e.height),r=Cesium.Cartesian3.fromRadians(i.longitude,i.latitude,0),o=Cesium.Cartesian3.subtract(n,r,new Cesium.Cartesian3);window[e.serviceId].modelMatrix=Cesium.Matrix4.fromTranslation(o)})),this._viewer.scene.requestRender()},setLayersStyle(e){if(!i(e)||!i(e.serviceId))throw new n("options.serviceId is required.");let t=window[e.serviceId];i(e.alpha)&&r.typeOf.number("alpha",e.alpha),e.alpha=Cesium.defaultValue(e.alpha,1),t.alpha=e.alpha,i(e.brightness)&&r.typeOf.number("brightness",e.brightness),e.brightness=Cesium.defaultValue(e.brightness,1),t.brightness=e.brightness,i(e.contrast)&&r.typeOf.number("contrast",e.contrast),e.contrast=Cesium.defaultValue(e.contrast,1),t.contrast=e.contrast,i(e.gamma)&&r.typeOf.number("gamma",e.gamma),e.gamma=Cesium.defaultValue(e.gamma,1),t.gamma=e.gamma,i(e.hue)&&r.typeOf.number("hue",e.hue),e.hue=Cesium.defaultValue(e.hue,0),t.hue=e.hue,i(e.saturation)&&r.typeOf.number("saturation",e.saturation),e.saturation=Cesium.defaultValue(e.saturation,1),t.saturation=e.saturation},set3DTileStyle(e){if(!i(e)||!i(e.serviceId))throw new n("options.serviceId is required.");i(e.alpha)&&r.typeOf.number("alpha",e.alpha),e.alpha=Cesium.defaultValue(e.alpha,1),window[e.serviceId].style=new Cesium.Cesium3DTileStyle({color:"color('rgba(255,255,255,"+e.alpha+")')"})},removeImageryProvider(e){return new Promise(((t,r)=>{if(!i(e)||!i(e.serviceId))throw new n("options.serviceId is required.");this._removeImageryProvider(e.serviceId),t(!0)}))},removeTerrain(){return new Promise(((e,t)=>{this._setEllipsoidTerrain(),e(!0)}))},removeScenePrimitives(e){return new Promise(((t,r)=>{if(!i(e)||!i(e.serviceId))throw new n("options.serviceId is required.");this._removeScenePrimitives(e.serviceId),t(!0)}))}}),Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var i in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e};class v{constructor({viewer:e,url:t,opacity:i=.75,show:n=!0}={}){this._viewer=e,this._url=t,this._opacity=i,this._renderName=this._guid();let r=new Cesium.CustomDataSource(this._renderName);this._viewer.dataSources.add(r),this._entities=r.entities,this._renderEntities=new Map,this._isUpdateTile=n,this._isDebug=!1,this._init()}_init(){let e=this;this._provider=new Cesium.ArcGisMapServerImageryProvider({url:e._url}),this._provider.readyPromise.then((function(t){e._rectangle=e._provider.rectangle,e._isDebug&&e._printDebug(),e._viewer.scene.postRender.addEventListener((()=>{e._isUpdateTile&&(e._isUpdateTile=!1,e._renderTiles())}))}))}_guid(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}_printDebug(){this._provider.tilingScheme;let e=new Cesium.GeographicTilingScheme;this._drawDebugRectangle(this._rectangle,Cesium.Color.GREEN),e.tileXYToRectangle(1696,312,10)}_drawDebugRectangle(e,t){let i=this._calculateRectangleOutlineCoordinates(e),n=new Cesium.Entity({name:this._renderName,polyline:{positions:i,material:t,width:10,clampToGround:!0}});this._entities.add(n)}_console(...e){this._isDebug&&console.log("==="+(new Date).Format("yyyy-MM-dd HH:mm:ss")+">>>",e)}_renderTiles(){let e=this,t=this._viewer.scene.globe._surface._tilesToRender;void 0!==t&&0!==t.length?new Promise(((e,i)=>{t.sort((function(e,t){return parseInt(e.level)-parseInt(t.level)})),e(t)})).then((t=>{e._asyncProjectionTiles(t)})):this._isUpdateTile=!0}_createKey(e,t,i){return`${this._renderName}_${e}_${t}_${i}`}_asyncProjectionTiles(e){let t=[];for(let r of e){let e=this._projectionTile(r);for(let i of e){let e=this._createKey(i.x,i.y,i.level);if(void 0===t.find((e=>e.x===i.x&&e.y===i.y))){let n=!1;for(let r of t)if(Cesium.Rectangle.intersection(r.rectangle,i.rectangle)){r.childTiles.push(e),n=!0;break}n||t.push({key:e,x:i.x,y:i.y,level:i.level,rectangle:i.rectangle,childTiles:[]})}}}let i=t.length,n=[];for(;i--;){let e=t[i];if(e.childTiles.length>=1){let r=this._createFourTiles(e);for(let e of r)n.push(e);t.splice(i,1)}}for(let r of n)t.push(r);t.sort((function(e,t){return parseInt(e.level)-parseInt(t.level)})),this._renderTilesToViewer(t)}_createTileByRectangleAndLevel(e,t){let i=Cesium.Rectangle.center(e),n=parseInt(t)+1,r=this._provider.tilingScheme.positionToTileXY(i,n);if(void 0!==r)return{key:this._createKey(r.x,r.y,n),x:r.x,y:r.y,level:n,rectangle:e,childTiles:[]}}_createFourTiles(e){let t=[],i=[],n=e.rectangle;t.push(Cesium.Rectangle.subsection(n,0,0,.5,.5)),t.push(Cesium.Rectangle.subsection(n,.5,0,1,.5)),t.push(Cesium.Rectangle.subsection(n,0,.5,.5,1)),t.push(Cesium.Rectangle.subsection(n,.5,.5,1,1));for(let r of t)if(Cesium.Rectangle.intersection(r,this._rectangle)){let t=this._createTileByRectangleAndLevel(r,e.level);void 0!==t&&i.push(t)}return i}_renderTilesToViewer(e){let t=this,i=[];for(let[n,r]of this._renderEntities){void 0===e.find((e=>e.key===n))&&i.push(n)}for(let n of i)this._renderEntities.delete(n),this._entities.removeById(n);for(let n of e)if(!this._renderEntities.has(n.key)){let e=this._renderSimpleTileToViewer(n);this._renderEntities.set(n.key,e);let i=new Blob([`(${y.toString()})()`]),r=new Worker(URL.createObjectURL(i));r.postMessage({key:n.key,url:this._url,x:n.x,y:n.y,level:n.level}),r.onmessage=function(e){t._console(`render x:${e.data.x} y:${e.data.y} level:${e.data.level}`);let i=t._entities.getById(e.data.key);if(void 0!==i){e.data.key;const n=t._createCanvas(e.data,e.data.image,t._isDebug);i.rectangle.material=n}r.terminate()}}this._isUpdateTile=!0}_renderSimpleTileToViewer(e){const t=this._createCanvas(e,void 0,this._isDebug);let i=this._calculateRectangleOutlineCoordinates(e.rectangle),n=new Cesium.Entity({name:this._renderName,id:e.key,rectangle:{coordinates:e.rectangle,material:t},polyline:{positions:i,material:Cesium.Color.YELLOW.withAlpha(this._isDebug?1:0),width:1,clampToGround:!0}});return this._entities.add(n)}_createCanvas(e,t,i){let n=this._provider;const r=document.createElement("canvas");r.width=n.tileWidth,r.height=n.tileHeight;const o=r.getContext("2d");return void 0!==t&&(o.globalAlpha=this._opacity,o.drawImage(event.data.image,0,0,r.width,r.height)),void 0!==i&&!0===i&&(o.globalAlpha=1,o.font="20px Arial",o.textAlign="center",o.fillStyle="rgba(255,255,0)",o.strokeStyle="rgba(255,255,255,1)",o.lineWidth=2,o.strokeText(`L: ${e.level}`,126,86),o.fillText(`L: ${e.level}`,126,86),o.strokeText(`X: ${e.x}`,126,136),o.fillText(`X: ${e.x}`,126,136),o.strokeText(`Y: ${e.y}`,126,186),o.fillText(`Y: ${e.y}`,126,186)),r}_projectionTile(e){let t=e._rectangle,i=parseInt(e.level),n=this._provider.tilingScheme,r=[];if(void 0===Cesium.Rectangle.intersection(t,this._rectangle))return r;let o=n.positionToTileXY(Cesium.Rectangle.northwest(t),i),s=n.positionToTileXY(Cesium.Rectangle.southeast(t),i);if(void 0!==o&&void 0!==s)for(let a=o.x;a<=s.x;a++)for(let e=o.y;e<=s.y;e++){let t=n.tileXYToRectangle(a,e,i);Cesium.Rectangle.intersection(t,this._rectangle)&&r.push({x:a,y:e,level:i,rectangle:t})}else if(void 0!==o){let e=n.tileXYToRectangle(o.x,o.y,i);Cesium.Rectangle.intersection(e,this._rectangle)&&r.push({x:o.x,y:o.y,level:i,rectangle:e})}else if(void 0!==s){let e=n.tileXYToRectangle(s.x,s.y,i);Cesium.Rectangle.intersection(e,this._rectangle)&&r.push({x:s.x,y:s.y,level:i,rectangle:e})}return r}_calculateRectangleOutlineCoordinates(e){let t=Cesium.Rectangle.southeast(e),i=Cesium.Cartographic.toCartesian(t),n=Cesium.Rectangle.southwest(e),r=Cesium.Cartographic.toCartesian(n),o=Cesium.Rectangle.northeast(e),s=Cesium.Cartographic.toCartesian(o),a=Cesium.Rectangle.northwest(e);return[r,i,s,Cesium.Cartographic.toCartesian(a),r]}_removeEntityByName(e){var t=this._entities;if(t&&t.values){for(var i=[],n=0;n>>",i+" Not found")},n.send()}}Object.assign(v.prototype,{hide:function(){this._console("隐藏"),this._isUpdateTile=!1,this._removeEntityByName(this._renderName),this._renderEntities.clear()},show:function(){this._console("显示"),this._isUpdateTile=!0},setOpacity:function(e){void 0!==e&&"number"==typeof e&&(e>=1&&(this._opacity=1),e<=0&&(this._opacity=0),this._opacity=parseFloat(e))}});class _{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._locationEntity=null}}Object.assign(_.prototype,{flyToPoint:function(e){return new Promise(((t,r)=>{if(!i(e)||!i(e.longitude)||!i(e.latitude))throw new n("options.longitude and options.latitude are required.");e.height=Cesium.defaultValue(e.height,0),e.heading=Cesium.defaultValue(e.heading,0),e.pitch=Cesium.defaultValue(e.pitch,-90),e.range=Cesium.defaultValue(e.range,0),e.duration=Cesium.defaultValue(e.duration,3);var o=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height),0);this._viewer.camera.flyToBoundingSphere(o,{duration:e.duration,complete:function(){t(!0)},offset:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),range:e.range}})}))},flyToEntityByPoints:function(e,t,i){return new Promise(((n,r)=>{let o=this;if(i=i||{},void 0===e||void 0===e.length)return void r("输入的坐标集合异常!");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));switch(o._locationEntity&&o._viewer.entities.remove(o._locationEntity),t){case"point":o._locationEntity=o._viewer.entities.add({position:s[0],point:{pixelSize:1}});break;case"polyline":s.length<2?r("线对象定位,点数至少2个"):o._locationEntity=o._viewer.entities.add({polyline:{positions:s,clampToGround:!0,material:new Cesium.Color(255,0,0,.5),width:1}});break;case"polygon":s.length<3?r("面对象定位,点数至少3个"):o._locationEntity=o._viewer.entities.add({polygon:{hierarchy:{positions:s},material:new Cesium.Color(255,0,0,.5),outline:!0}});break;default:r("坐标异常!")}i.duration=Cesium.defaultValue(i.duration,3),i.heading=Cesium.defaultValue(i.heading,0),i.pitch=Cesium.defaultValue(i.pitch,-90),i.range=Cesium.defaultValue(i.range,0),o._viewer.flyTo(o._locationEntity,{duration:i.duration,offset:{heading:Cesium.Math.toRadians(i.heading),pitch:Cesium.Math.toRadians(i.pitch),range:i.range}}).then((function(){n(!0)}))}))},flyToEntity:function(e,t){return new Promise(((i,n)=>{let r=this;t=t||{},r._locationEntity&&r._viewer.entities.remove(r._locationEntity),r._locationEntity=e,t.duration=Cesium.defaultValue(t.duration,3),t.heading=Cesium.defaultValue(t.heading,0),t.pitch=Cesium.defaultValue(t.pitch,-90),t.range=Cesium.defaultValue(t.range,0),r._viewer.flyTo(r._locationEntity,{duration:t.duration,offset:{heading:Cesium.Math.toRadians(t.heading),pitch:Cesium.Math.toRadians(t.pitch),range:t.range}}).then((function(){i(r._locationEntity)}))}))}});const b=function(e,t,i){let n,r,o,s,a=document.getElementById("toolTip");if(e&&"object"==typeof e&&(n=e),n&&n.origin?("center"===n.origin&&(r=15,o=-12),"top"===n.origin&&(r=15,o=-44),"bottom"===n.origin&&(r=15,o=20)):(r=15,o=20),n&&n.color?("white"===n.color&&(s="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===n.color&&(s="background: rgba(0, 0, 0, 0.5);color: white;"),"yellow"===n.color&&(s="color: black;background-color: #ffcc33;border: 1px solid white;")):s="background: rgba(0, 0, 0, 0.5);color: white;",!a){const e=document.getElementsByClassName("cesium-viewer")[0];let t=document.createElement("div");e.append(t);let i='';e.insertAdjacentHTML("beforeend",i),a=document.getElementById("toolTip")}return i?(a.innerHTML=e,a.style.left=t.x+r+"px",a.style.top=t.y+o+"px",a.style.display="block"):a.style.display="none",{tooltip:a,style:n,showAt:function(e,t){this.tooltip.innerHTML=t,this.style&&this.style.origin?("center"===this.style.origin&&(r=15,o=-this.tooltip.offsetHeight/2),"top"===this.style.origin&&(r=15,o=-this.tooltip.offsetHeight-20),"bottom"===this.style.origin&&(r=15,o=20)):(r=15,o=-this.tooltip.offsetHeight/2),this.tooltip.style.left=e.x+r+"px",this.tooltip.style.top=e.y+o+"px",this.tooltip.style.display="block"},show:function(e){this.tooltip.style.display=e?"block":"none"}}};class C{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]}}_distance(e,t){let i=Cesium.Cartographic.fromCartesian(e),n=Cesium.Cartographic.fromCartesian(t),r=new Cesium.EllipsoidGeodesic;r.setEndPoints(i,n);let o=r.surfaceDistance;return o=Math.sqrt(Math.pow(o,2)+Math.pow(n.height-i.height,2)),o}} /*! * author: [object Object] * @sakitam-gis/kriging v0.1.0 * build-time: 2019-7-6 20:41 * LICENSE: MIT * (c) 2019-2019 https://github.com/sakitam-gis/kriging.js */ function T(e){return Math.max.apply(null,e)}function w(e){return Math.min.apply(null,e)}function E(e,t){for(var i=[],n=0;ni!=e[r][1]>i&&t<(e[r][0]-e[n][0])*(i-e[n][1])/(e[r][1]-e[n][1])+e[n][0]&&(o=!o);return o}function k(e,t){for(var i=0,n=E(0,t*t);i=a&&(a=Math.abs(e[n*t+r]),v=n,g=r);if(++m[g],v!==g){for(o=0;o=0;o--)if(f[o]!==p[o])for(r=0;ri?t+(n-t)/i:t+(n-t)/i*(e/i*1.5-.5*Math.pow(e/i,3))}function R(e,t,i){var n,r=Array(i.n);for(n=0;n{let n=m.getCatesian3FromPX(e._viewer,i.position);if(t="左键创建视角终点,右键结束通视分析",n)if(e._resultObject.viewPoint){e._resultObject.targetPoint=n;let t=e._viewer.entities.add({position:n,point:{color:Cesium.Color.YELLOW,pixelSize:5},label:{text:"目标位置",font:"12px sans-serif",fillColor:new Cesium.Color(255,255,255,1),outlineColor:new Cesium.Color(0,154,94,1),style:Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-28),showBackground:!0,backgroundColor:new Cesium.Color(0,0,0,.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});e._resultObject.objectExclude.push(t),e._resultObject.entities.push(t);let i=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e._resultObject.targetPoint,e._resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),r=new Cesium.Ray(e._resultObject.viewPoint,i),o=e._viewer.scene.pickFromRay(r,e._resultObject.objectExclude);if(o){let t=e._distance(e._resultObject.viewPoint,e._resultObject.targetPoint),i=e._distance(e._resultObject.viewPoint,o.position),r=e._distance(o.position,e._resultObject.targetPoint);if(console.log(t,i,r),t>i){let s=e._viewer.entities.add({polyline:{positions:[e._resultObject.viewPoint,o.position],material:Cesium.Color.GREEN,width:3}});e._resultObject.entities.push(s);let a=e._viewer.entities.add({polyline:{positions:[o.position,e._resultObject.targetPoint],material:Cesium.Color.RED,width:3}});e._resultObject.entities.push(a),e._resultObject.targetPoints.push({targetPoint:n,visual:!1,distance:[t,i,r]})}else{let o=e._viewer.entities.add({polyline:{positions:[e._resultObject.viewPoint,e._resultObject.targetPoint],material:Cesium.Color.GREEN,width:3}});e._resultObject.entities.push(o),e._resultObject.targetPoints.push({targetPoint:n,visual:!0,distance:[t,i,r]})}}}else{e._resultObject.viewPoint=n;let t=e._viewer.entities.add({position:n,point:{color:Cesium.Color.YELLOW,pixelSize:5},label:{text:"观察位置",font:"12px sans-serif",fillColor:new Cesium.Color(255,255,255,1),outlineColor:new Cesium.Color(0,154,94,1),style:Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-28),showBackground:!0,backgroundColor:new Cesium.Color(0,0,0,.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});e._resultObject.objectExclude.push(t),e._resultObject.entities.push(t)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK),i.setInputAction((function(e){b(t,e.endPosition,!0)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),i.setInputAction((e=>{b(t,e.endPosition,!1),i.destroy()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)},clearAll(){this._resultObject.entities.forEach((e=>{this._viewer.entities.remove(e)})),this._resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]}}});var N={train:function(e,t,i,n,r,o){var s,a,l,u,c={t:e,x:t,y:i,nugget:0,range:0,sill:0,A:1/3,n:0,model:O,K:[],M:[]};switch(n){case"gaussian":c.model=D;break;case"exponential":c.model=O;break;case"spherical":c.model=j;break;default:c.model=O}var h=e.length,d=Array((h*h-h)/2);for(s=0,l=0;s30?30:(h*h-h)/2,f=c.range/p,m=E(0,p),g=E(0,p);if(p<30)for(u=0;u=(h*h-h)/2)););l>0&&(m[u]/=l,g[u]/=l,u++)}if(u<2)return c}h=u,c.range=m[h-1]-m[0];var v=E(1,2*h),y=Array(h),_=c.A;for(s=0;su[1]&&(u[1]=e[n][r][0]),e[n][r][1]c[1]&&(c[1]=e[n][r][1]);var h=Array(2),d=Array(2),p=Array(2),f=Array(2),m=Math.ceil((u[1]-u[0])/i),g=Math.ceil((c[1]-c[0])/i),v=Array(m+1);for(n=0;n<=m;n++)v[n]=Array(g+1);for(n=0;np[1]&&(p[1]=e[n][r][0]),e[n][r][1]f[1]&&(f[1]=e[n][r][1]);for(h[0]=Math.floor((p[0]-(p[0]-u[0])%i-u[0])/i),h[1]=Math.ceil((p[1]-(p[1]-u[1])%i-u[0])/i),d[0]=Math.floor((f[0]-(f[0]-c[0])%i-c[0])/i),d[1]=Math.ceil((f[1]-(f[1]-c[1])%i-c[0])/i),r=h[0];r<=h[1];r++)for(o=d[0];o<=d[1];o++)a=u[0]+r*i,l=c[0]+o*i,S(e[n],a,l)&&(v[r][o]=R(a,l,t))}return{xlim:u,ylim:c,width:i,data:v,zlim:[w(t.t),T(t.t)]}}},plot:function(e,t,i,n,r){var o=e.getContext("2d"),s=t.data,a=t.zlim,l=t.width;if(o){o.clearRect(0,0,e.width,e.height);var u=[i[1]-i[0],n[1]-n[0],a[1]-a[0]],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=s.length,g=s[0].length,v=Math.ceil(l*e.width/(i[1]-i[0])),y=Math.ceil(l*e.height/(n[1]-n[0]));for(c=0;c1&&(f=1),o.fillStyle=r[Math.floor((r.length-1)*f)],o.fillRect(Math.round(d-v/2),Math.round(p-y/2),v,y))}},max:T,min:w,pip:S,rep:E,matrixDiag:k,matrixTranspose:P,matrixAdd:A,matrixMultiply:x,matrixChol:I,matrixChol2inv:M,matrixSolve:L,variogramGaussian:D,variogramExponential:O,variogramSpherical:j},U=6371008.8,B={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*U,kilometers:6371.0088,kilometres:6371.0088,meters:U,metres:U,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:U/1852,radians:1,yards:6967335.223679999};function F(e,t,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=t||{},n.geometry=e,n}function W(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!q(e[0])||!q(e[1]))throw new Error("coordinates must contain numbers");return F({type:"Point",coordinates:e},t,i)}function H(e,t,i){void 0===i&&(i={});for(var n=0,r=e;ne[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function $(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function ee(e){return"Feature"===e.type?e.geometry:e}K.default=K;var te="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ne(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})})),t}var re={exports:{}};function oe(e,t,i,n,r){se(e,t,i||0,n||e.length-1,r||le)}function se(e,t,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=t-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);se(e,t,Math.max(i,Math.floor(t-s*l/o+u)),Math.min(n,Math.floor(t+(o-s)*l/o+u)),r)}var c=e[t],h=i,d=n;for(ae(e,i,t),r(e[n],c)>0&&ae(e,i,n);h0;)d--}0===r(e[i],c)?ae(e,i,d):ae(e,++d,n),d<=t&&(i=d+1),t<=d&&(n=d-1)}}function ae(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function le(e,t){return et?1:0}function ue(e,t,i){if(!i)return t.indexOf(e);for(let n=0;n=e.minX&&t.maxY>=e.minY}function be(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ce(e,t,i,n,r){const o=[t,i];for(;o.length;){if((i=o.pop())-(t=o.pop())<=n)continue;const s=t+Math.ceil((i-t)/n/2)*n;oe(e,s,t,i,r),o.push(t,s,s,i)}}var Te=ne(Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!_e(e,t))return i;const n=this.toBBox,r=[];for(;t;){for(let o=0;o=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(n,r,t)}_split(e,t){const i=e[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=be(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,ce(i,this.toBBox),ce(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(i,s)}_splitRoot(e,t){this.data=be([e,t]),this.data.height=e.height+1,this.data.leaf=!1,ce(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let n,r=1/0,o=1/0;for(let s=t;s<=i-t;s++){const t=he(e,0,s,this.toBBox),a=he(e,s,i,this.toBBox),l=ve(t,a),u=me(t)+me(a);l=t;l--){const t=e.children[l];de(s,e.leaf?r(t):t),a+=ge(s)}return a}_adjustParentBBoxes(e,t,i){for(let n=i;n>=0;n--)de(t[n],e)}_condense(e){for(let t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children,t.splice(t.indexOf(e[i]),1)):this.clear():ce(e[i],this.toBBox)}}}));function we(e,t){return et?1:0}var Ee=ne(Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:class{constructor(e=[],t=we){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,n=t[e];for(;e>0;){const r=e-1>>1,o=t[r];if(i(n,o)>=0)break;t[e]=o,e=r}t[e]=n}_down(e){const{data:t,compare:i}=this,n=this.length>>1,r=t[e];for(;e=0)break;t[e]=o,e=n}t[e]=r}}})),Se={exports:{}},ke=function(e,t,i,n){var r=e[0],o=e[1],s=!1;void 0===i&&(i=0),void 0===n&&(n=t.length);for(var a=(n-i)/2,l=0,u=a-1;lo!=p>o&&r<(d-c)*(o-h)/(p-h)+c&&(s=!s)}return s},Pe=function(e,t,i,n){var r=e[0],o=e[1],s=!1;void 0===i&&(i=0),void 0===n&&(n=t.length);for(var a=n-i,l=0,u=a-1;lo!=p>o&&r<(d-c)*(o-h)/(p-h)+c&&(s=!s)}return s};Se.exports=function(e,t,i,n){return t.length>0&&Array.isArray(t[0])?Pe(e,t,i,n):ke(e,t,i,n)},Se.exports.nested=Pe,Se.exports.flat=ke;var Ae={exports:{}};(function(e){const t=134217729,i=33306690738754706e-32;function n(e,t,i,n,r){let o,s,a,l,u=t[0],c=n[0],h=0,d=0;c>u==c>-u?(o=u,u=t[++h]):(o=c,c=n[++d]);let p=0;if(hu==c>-u?(a=o-((s=u+o)-u),u=t[++h]):(a=o-((s=c+o)-c),c=n[++d]),o=s,0!==a&&(r[p++]=a);hu==c>-u?(a=o-((s=o+u)-(l=s-o))+(u-l),u=t[++h]):(a=o-((s=o+c)-(l=s-o))+(c-l),c=n[++d]),o=s,0!==a&&(r[p++]=a);for(;h0!=y>0)return _;const b=Math.abs(v+y);return Math.abs(_)>=o*b?_:-function(e,r,o,p,f,m,g){let v,y,_,b,C,T,w,E,S,k,P,A,x,I,M,L,D,O;const j=e-f,R=o-f,N=r-m,U=p-m;C=(M=(E=j-(w=(T=t*j)-(T-j)))*(k=U-(S=(T=t*U)-(T-U)))-((I=j*U)-w*S-E*S-w*k))-(P=M-(D=(E=N-(w=(T=t*N)-(T-N)))*(k=R-(S=(T=t*R)-(T-R)))-((L=N*R)-w*S-E*S-w*k))),l[0]=M-(P+C)+(C-D),C=(x=I-((A=I+P)-(C=A-I))+(P-C))-(P=x-L),l[1]=x-(P+C)+(C-L),C=(O=A+P)-A,l[2]=A-(O-C)+(P-C),l[3]=O;let B=function(e,t){let i=t[0];for(let n=1;n=F||-B>=F)return B;if(v=e-(j+(C=e-j))+(C-f),_=o-(R+(C=o-R))+(C-f),y=r-(N+(C=r-N))+(C-m),b=p-(U+(C=p-U))+(C-m),0===v&&0===y&&0===_&&0===b)return B;if(F=a*g+i*Math.abs(B),(B+=j*b+U*v-(N*_+R*y))>=F||-B>=F)return B;C=(M=(E=v-(w=(T=t*v)-(T-v)))*(k=U-(S=(T=t*U)-(T-U)))-((I=v*U)-w*S-E*S-w*k))-(P=M-(D=(E=y-(w=(T=t*y)-(T-y)))*(k=R-(S=(T=t*R)-(T-R)))-((L=y*R)-w*S-E*S-w*k))),d[0]=M-(P+C)+(C-D),C=(x=I-((A=I+P)-(C=A-I))+(P-C))-(P=x-L),d[1]=x-(P+C)+(C-L),C=(O=A+P)-A,d[2]=A-(O-C)+(P-C),d[3]=O;const W=n(4,l,4,d,u);C=(M=(E=j-(w=(T=t*j)-(T-j)))*(k=b-(S=(T=t*b)-(T-b)))-((I=j*b)-w*S-E*S-w*k))-(P=M-(D=(E=N-(w=(T=t*N)-(T-N)))*(k=_-(S=(T=t*_)-(T-_)))-((L=N*_)-w*S-E*S-w*k))),d[0]=M-(P+C)+(C-D),C=(x=I-((A=I+P)-(C=A-I))+(P-C))-(P=x-L),d[1]=x-(P+C)+(C-L),C=(O=A+P)-A,d[2]=A-(O-C)+(P-C),d[3]=O;const H=n(W,u,4,d,c);C=(M=(E=v-(w=(T=t*v)-(T-v)))*(k=b-(S=(T=t*b)-(T-b)))-((I=v*b)-w*S-E*S-w*k))-(P=M-(D=(E=y-(w=(T=t*y)-(T-y)))*(k=_-(S=(T=t*_)-(T-_)))-((L=y*_)-w*S-E*S-w*k))),d[0]=M-(P+C)+(C-D),C=(x=I-((A=I+P)-(C=A-I))+(P-C))-(P=x-L),d[1]=x-(P+C)+(C-L),C=(O=A+P)-A,d[2]=A-(O-C)+(P-C),d[3]=O;const V=n(H,c,4,d,h);return h[V-1]}(e,r,p,f,m,g,b)},e.orient2dfast=function(e,t,i,n,r,o){return(t-o)*(i-r)-(e-r)*(n-o)},Object.defineProperty(e,"__esModule",{value:!0})})(Ae.exports);var xe=Te,Ie=Ee,Me=Se.exports,Le=Ae.exports.orient2d;function De(e,t,i){t=Math.max(0,void 0===t?2:t),i=i||0;var n=function(e){for(var t=e[0],i=e[0],n=e[0],r=e[0],o=0;on[0]&&(n=s),s[1]r[1]&&(r=s)}var a=[t,i,n,r],l=a.slice();for(o=0;o=2&&Be(t[t.length-2],t[t.length-1],e[i])<=0;)t.pop();t.push(e[i])}for(var n=[],r=e.length-1;r>=0;r--){for(;n.length>=2&&Be(n[n.length-2],n[n.length-1],e[r])<=0;)n.pop();n.push(e[r])}return n.pop(),t.pop(),t.concat(n)}(l)}(e),r=new xe(16);r.toBBox=function(e){return{minX:e[0],minY:e[1],maxX:e[0],maxY:e[1]}},r.compareMinX=function(e,t){return e[0]-t[0]},r.compareMinY=function(e,t){return e[1]-t[1]},r.load(e);for(var o,s=[],a=0;ao||a.push({node:c,dist:h})}for(;a.length&&!a.peek().node.children;){var d=a.pop(),p=d.node,f=Ve(p,t,i),m=Ve(p,n,r);if(d.dist=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function Ue(e,t,i){for(var n,r,o,s,a=Math.min(e[0],t[0]),l=Math.min(e[1],t[1]),u=Math.max(e[0],t[0]),c=Math.max(e[1],t[1]),h=i.search({minX:a,minY:l,maxX:u,maxY:c}),d=0;d0!=Be(n,r,s)>0&&Be(o,s,n)>0!=Be(o,s,r)>0)return!1;return!0}function Be(e,t,i){return Le(e[0],e[1],t[0],t[1],i[0],i[1])}function Fe(e){var t=e.p,i=e.next.p;return e.minX=Math.min(t[0],i[0]),e.minY=Math.min(t[1],i[1]),e.maxX=Math.max(t[0],i[0]),e.maxY=Math.max(t[1],i[1]),e}function We(e,t){var i={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function He(e,t){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function Ve(e,t,i){var n=t[0],r=t[1],o=i[0]-n,s=i[1]-r;if(0!==o||0!==s){var a=((e[0]-n)*o+(e[1]-r)*s)/(o*o+s*s);a>1?(n=i[0],r=i[1]):a>0&&(n+=o*a,r+=s*a)}return(o=e[0]-n)*o+(s=e[1]-r)*s}function Ge(e,t,i,n,r,o,s,a){var l,u,c,h,d=i-e,p=n-t,f=s-r,m=a-o,g=e-r,v=t-o,y=d*d+p*p,_=d*f+p*m,b=f*f+m*m,C=d*g+p*v,T=f*g+m*v,w=y*b-_*_,E=w,S=w;0===w?(u=0,E=1,h=T,S=b):(h=y*T-_*C,(u=_*T-b*C)<0?(u=0,h=T,S=b):u>E&&(u=E,h=T+_,S=b)),h<0?(h=0,-C<0?u=0:-C>y?u=E:(u=-C,E=y)):h>S&&(h=S,-C+_<0?u=0:-C+_>y?u=E:(u=-C+_,E=y));var k=(1-(c=0===h?0:h/S))*r+c*s-((1-(l=0===u?0:u/E))*e+l*i),P=(1-c)*o+c*a-((1-l)*t+l*n);return k*k+P*P}function ze(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}Ie.default&&(Ie=Ie.default),re.exports=De,re.exports.default=De;var Ye=re.exports;function qe(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=J(e),r=ee(t),o=r.type,s=t.bbox,a=r.coordinates;if(s&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(n,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;ue[1]!=u>e[1]&&e[0]<(l-s)*(e[1]-a)/(u-a)+s&&(n=!n)}return n}function Ze(e,t,i){void 0===i&&(i={});var n=J(e),r=J(t),o=Y(r[1]-n[1]),s=Y(r[0]-n[0]),a=Y(n[1]),l=Y(r[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return function(e,t){void 0===t&&(t="kilometers");var i=B[t];if(!i)throw new Error(t+" units is invalid");return e*i}(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),i.units)}function Qe(e,t,i,n){void 0===n&&(n={});var r=J(e),o=Y(r[0]),s=Y(r[1]),a=Y(i),l=function(e,t){void 0===t&&(t="kilometers");var i=B[t];if(!i)throw new Error(t+" units is invalid");return e/i}(t,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return W([z(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),z(u)],n.properties)}function Ke(e,t,i){if(void 0===i&&(i={}),!0===i.final)return function(e,t){var i=Ke(t,e);return i=(i+180)%360}(e,t);var n=J(e),r=J(t),o=Y(n[0]),s=Y(r[0]),a=Y(n[1]),l=Y(r[1]),u=Math.sin(s-o)*Math.cos(l),c=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return z(Math.atan2(u,c))}function Je(e,t){return Qe(e,Ze(e,t)/2,Ke(e,t))}function $e(e,t){void 0===t&&(t={});var i=0,n=0,r=0;return X(e,(function(e){i+=e[0],n+=e[1],r++}),!0),W([i/r,n/r],t.properties)}function et(e,t){switch(void 0===t&&(t={}),function(e,t){return"FeatureCollection"===e.type?"FeatureCollection":"GeometryCollection"===e.type?"GeometryCollection":"Feature"===e.type&&null!==e.geometry?e.geometry.type:e.type}(e)){case"Point":return W(J(e),t.properties);case"Polygon":var i=[];X(e,(function(e){i.push(e)}));var n,r,o,s,a,l,u,c,h=$e(e,{properties:t.properties}),d=h.geometry.coordinates,p=0,f=0,m=0,g=i.map((function(e){return[e[0]-d[0],e[1]-d[1]]}));for(n=0;n3?H([n]):null}(e);return y?et(y,{properties:t.properties}):$e(e,{properties:t.properties})}}function tt(e){if(!e)throw new Error("geojson is required");var t=[];return Q(e,(function(e){!function(e,t){var i=[],n=e.geometry;if(null!==n){switch(n.type){case"Polygon":i=$(n);break;case"LineString":i=[$(n)]}i.forEach((function(i){(function(e,t){var i=[];return e.reduce((function(e,n){var r,o,s,a,l,u,c=V([e,n],t);return c.bbox=(o=n,s=(r=e)[0],a=r[1],l=o[0],u=o[1],[sl?s:l,a>u?a:u]),i.push(c),n})),i})(i,e.properties).forEach((function(e){e.id=t.length,t.push(e)}))}))}}(e,t)})),G(t)}var it={exports:{}};function nt(e,t,i,n,r){rt(e,t,i||0,n||e.length-1,r||st)}function rt(e,t,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=t-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);rt(e,t,Math.max(i,Math.floor(t-s*l/o+u)),Math.min(n,Math.floor(t+(o-s)*l/o+u)),r)}var c=e[t],h=i,d=n;for(ot(e,i,t),r(e[n],c)>0&&ot(e,i,n);h0;)d--}0===r(e[i],c)?ot(e,i,d):ot(e,++d,n),d<=t&&(i=d+1),t<=d&&(n=d-1)}}function ot(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function st(e,t){return et?1:0}function at(e,t,i){if(!i)return t.indexOf(e);for(let n=0;n=e.minX&&t.maxY>=e.minY}function yt(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _t(e,t,i,n,r){const o=[t,i];for(;o.length;){if((i=o.pop())-(t=o.pop())<=n)continue;const s=t+Math.ceil((i-t)/n/2)*n;nt(e,s,t,i,r),o.push(t,s,s,i)}}var bt=ne(Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!vt(e,t))return i;const n=this.toBBox,r=[];for(;t;){for(let o=0;o=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(n,r,t)}_split(e,t){const i=e[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=yt(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,lt(i,this.toBBox),lt(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(i,s)}_splitRoot(e,t){this.data=yt([e,t]),this.data.height=e.height+1,this.data.leaf=!1,lt(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let n,r=1/0,o=1/0;for(let s=t;s<=i-t;s++){const t=ut(e,0,s,this.toBBox),a=ut(e,s,i,this.toBBox),l=mt(t,a),u=pt(t)+pt(a);l=t;l--){const t=e.children[l];ct(s,e.leaf?r(t):t),a+=ft(s)}return a}_adjustParentBBoxes(e,t,i){for(let n=i;n>=0;n--)ct(t[n],e)}_condense(e){for(let t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children,t.splice(t.indexOf(e[i]),1)):this.clear():lt(e[i],this.toBBox)}}})),Ct={};!function(e){function t(e,t,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=t||{},n.geometry=e,n}function i(e,i,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(e[0])||!d(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},i,n)}function n(e,i,n){void 0===n&&(n={});for(var r=0,o=e;r=0))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(e*i)/i},e.radiansToLength=u,e.lengthToRadians=c,e.lengthToDegrees=function(e,t){return h(c(e,t))},e.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},e.radiansToDegrees=h,e.degreesToRadians=function(e){return e%360*Math.PI/180},e.convertLength=function(e,t,i){if(void 0===t&&(t="kilometers"),void 0===i&&(i="kilometers"),!(e>=0))throw new Error("length must be a positive number");return u(c(e,t),i)},e.convertArea=function(t,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=e.areaFactors[i];if(!r)throw new Error("invalid original units");var o=e.areaFactors[n];if(!o)throw new Error("invalid final units");return t/r*o},e.isNumber=d,e.isObject=function(e){return!!e&&e.constructor===Object},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!d(e))throw new Error("bbox must only contain numbers")}))},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}(Ct);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});var wt=Ct;function Et(e,t,i){if(null!==e)for(var n,r,o,s,a,l,u,c,h=0,d=0,p=e.type,f="FeatureCollection"===p,m="Feature"===p,g=f?e.features.length:1,v=0;va||d>l||p>u)return s=o,a=i,l=d,u=p,void(r=0);var f=wt.lineString([s,o],e.properties);if(!1===t(f,i,n,p,r))return!1;r++,s=o}))&&void 0}}}))}function It(e,t){if(!e)throw new Error("geojson is required");At(e,(function(e,i,n){if(null!==e.geometry){var r=e.geometry.type,o=e.geometry.coordinates;switch(r){case"LineString":if(!1===t(e,i,n,0,0))return!1;break;case"Polygon":for(var s=0;se[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2] line1 must only contain 2 coordinates");if(2!==n.length)throw new Error(" line2 must only contain 2 coordinates");var r=i[0][0],o=i[0][1],s=i[1][0],a=i[1][1],l=n[0][0],u=n[0][1],c=n[1][0],h=n[1][1],d=(h-u)*(s-r)-(c-l)*(a-o),p=(c-l)*(o-u)-(h-u)*(r-l),f=(s-r)*(o-u)-(a-o)*(r-l);if(0===d)return null;var m=p/d,g=f/d;return m>=0&&m<=1&&g>=0&&g<=1?W([r+m*(s-r),o+m*(a-o)]):null}function Gt(e,t,i){void 0===i&&(i={});for(var n=J(e),r=$(t),o=0;or)return!1}else if(0!==p)return!1;return n?"start"===n?Math.abs(h)>=Math.abs(d)?h>0?a0?l=Math.abs(d)?h>0?a<=o&&o0?l<=s&&s=Math.abs(d)?h>0?a0?l=Math.abs(d)?h>0?a<=o&&o<=u:u<=o&&o<=a:d>0?l<=s&&s<=c:c<=s&&s<=l}function Yt(e,t){var i=ee(e),n=ee(t),r=i.type,o=n.type;switch(r){case"Point":switch(o){case"MultiPoint":return function(e,t){var i,n=!1;for(i=0;it[0])&&(!(e[2]t[1])&&!(e[3]1?function(e,t,i){return void 0===i&&(i={}),F({type:"MultiLineString",coordinates:e},t,i)}(e,t):V(e[0],t)}function Jt(e,t){var i=!0;return Q(e,(function(e){Q(t,(function(t){if(!1===i)return!1;i=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return i=e.coordinates,n=t.coordinates,!(i[0]===n[0]&&i[1]===n[1]);case"LineString":return!$t(t,e);case"Polygon":return!qe(e,t)}break;case"LineString":switch(t.type){case"Point":return!$t(e,t);case"LineString":return!function(e,t){if(Ht(e,t).features.length>0)return!0;return!1}(e,t);case"Polygon":return!ei(t,e)}break;case"Polygon":switch(t.type){case"Point":return!qe(t,e);case"LineString":return!ei(e,t);case"Polygon":return!function(e,t){for(var i=0,n=e.coordinates[0];i0)return!0;return!1}(t,e)}}var i,n;return!1}(e.geometry,t.geometry)}))})),i}function $t(e,t){for(var i=0;i0}function ti(e,t,i){var n=i[0]-e[0],r=i[1]-e[1],o=t[0]-e[0],s=t[1]-e[1];return 0==n*s-r*o&&(Math.abs(o)>=Math.abs(s)?o>0?e[0]<=i[0]&&i[0]<=t[0]:t[0]<=i[0]&&i[0]<=e[0]:s>0?e[1]<=i[1]&&i[1]<=t[1]:t[1]<=i[1]&&i[1]<=e[1])}function ii(e,t){var i=!1;return Q(e,(function(e){Q(t,(function(t){if(!0===i)return!0;i=!Jt(e.geometry,t.geometry)}))})),i}function ni(e,t,i){return void 0===i&&(i={}),function(e,t,i,n){void 0===n&&(n={});for(var r=[],o=e[0],s=e[1],a=e[2],l=e[3],u=t/Ze([o,s],[a,s],n)*(a-o),c=i/Ze([o,s],[o,l],n)*(l-s),h=a-o,d=l-s,p=Math.floor(h/u),f=Math.floor(d/c),m=(d-f*c)/2,g=o+(h-p*u)/2,v=0;v=e?n=t?2*Math.PI-r:Math.PI+r,r=180*r/Math.PI,r}getPitch(e,t){let i=Cesium.Transforms.eastNorthUpToFixedFrame(e);const n=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3);let r=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,i),n,n);return Cesium.Cartesian3.normalize(r,r),Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(r.z)}updateViewShed(){this.clear(),this.setLightCamera(),this.addVisualPyramid(),this.createFrustum()}clear(){this.pyramid&&(this.viewer.entities.removeById(this.pyramid.id),this.pyramid=void 0),this.frustumPrimitive&&(this.viewer.scene.primitives.remove(this.frustumPrimitive),this.frustumPrimitive=void 0),this.debugModelMatrixPrimitive&&(this.viewer.scene.primitives.remove(this.debugModelMatrixPrimitive),this.debugModelMatrixPrimitive=void 0)}addVisualPyramid(){let e=this.ViewShedOptions,t=e.viewPosition,i=Number(e.visualRange),n=Cesium.Transforms.eastNorthUpToFixedFrame(t);this.debugModelMatrixPrimitive=this.viewer.scene.primitives.add(new Cesium.DebugModelMatrixPrimitive({modelMatrix:n,length:5}));const r=e.horizontalViewAngle/2,o=e.verticalViewAngle/2,s=Cesium.Math.toDegrees(e.pitch),a=new Cesium.EllipsoidGraphics({radii:new Cesium.Cartesian3(i,i,i),minimumClock:Cesium.Math.toRadians(90-e.direction-r),maximumClock:Cesium.Math.toRadians(90-e.direction+r),minimumCone:Cesium.Math.toRadians(90-s-o),maximumCone:Cesium.Math.toRadians(90-s+o),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:Cesium.Color.YELLOWGREEN.withAlpha(.5)}),l=new Cesium.Entity({position:t,ellipsoid:a});this.pyramid=this.viewer.entities.add(l)}setLightCamera(){this.lightCamera||(this.lightCamera=new Cesium.Camera(this.viewer.scene));let e=this.ViewShedOptions,t=Number(e.visualRange);this.lightCamera.position=e.viewPosition,this.lightCamera.frustum.near=.1,this.lightCamera.frustum.far=t;const i=Cesium.Math.toRadians(e.horizontalViewAngle),n=Cesium.Math.toRadians(e.verticalViewAngle);this.lightCamera.frustum.aspectRatio=t*Math.tan(i/2)*2/(t*Math.tan(n/2)*2),this.lightCamera.frustum.fov=i>n?i:n,this.lightCamera.setView({destination:e.viewPosition,orientation:{heading:Cesium.Math.toRadians(e.direction||0),pitch:e.pitch||0,roll:0}})}createFrustum(){const e=new Cesium.Cartesian3,t=new Cesium.Matrix3,i=new Cesium.Quaternion,n=this.lightCamera.directionWC,r=this.lightCamera.upWC;let o=this.lightCamera.rightWC;o=Cesium.Cartesian3.negate(o,e);let s=t;Cesium.Matrix3.setColumn(s,0,o,s),Cesium.Matrix3.setColumn(s,1,r,s),Cesium.Matrix3.setColumn(s,2,n,s);let a=Cesium.Quaternion.fromRotationMatrix(s,i),l=new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:this.ViewShedOptions.viewPosition,orientation:a}),id:"视椎体轮廓线"+Math.random().toString(36).substr(2),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(0,1,0,1)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.frustumPrimitive=this.viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:l,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1,closed:!0})}))}addViewershedPolygon(e){let t=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e)),height:0,extrudedHeight:0,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,granularity:Cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC}),i=new Cesium.GeometryInstance({geometry:t,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.viewershedPolygon=this.viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!0,material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:this.returnImgae()}}})})}))}drawViewershed(e){const t=this.cartesian3ToDegree(this.ViewShedOptions.viewPosition),i=this.ViewShedOptions.visualRange,n=this.ViewShedOptions.direction;let r=this.computeBoundaryOptions(t,i,n);const o=r.bbox;let s=H([r.boundaryPoints]);const a=this.ViewShedOptions.visualRange/(1e3*e);let l=function(e,t,i){void 0===i&&(i={}),i.mask&&!i.units&&(i.units="kilometers");for(var n=[],r=e[0],o=e[1],s=e[2],a=e[3],l=t/Ze([r,o],[s,o],i)*(s-r),u=t/Ze([r,o],[r,a],i)*(a-o),c=s-r,h=a-o,d=Math.floor(c/l),p=(h-Math.floor(h/u)*u)/2,f=r+(c-d*l)/2;f<=s;){for(var m=o+p;m<=a;){var g=W([f,m],i.properties);i.mask?Yt(g,i.mask)&&n.push(g):n.push(g),m+=u}f+=l}return G(n)}(o,a,{mask:s});console.log(this.ViewShedOptions.visualRange,e,a);let u=this.createTargetPoints(l,a,t),c=N.train(u.values,u.lngs,u.lats,"exponential",0,100),h=N.grid([r.boundaryPoints],c,a/1e3);this.canvasEle.width=3840,this.canvasEle.height=2160,N.plot(this.canvasEle,h,[o[0],o[2]],[o[1],o[3]],["#ff000080","#ff000080","#ff000080","#ff000080","#ff000080","#ff000080","#00ff0080","#00ff0080","#00ff0080","#00ff0080","#00ff0080","#00ff0080"]),this.addViewershedPolygon(r.positionArr)}computeBoundaryOptions(e,t,i){let n=6356725;const r=e[0],o=e[1],s=[r,o,r,o];let a=[],l=[];a.push(r,o),l.push([r,o]);let u=i+45>360?i-45-360:i-45,c=u+90;for(let h=u;h<=c;h++){let e=t*Math.sin(h*Math.PI/180),i=t*Math.cos(h*Math.PI/180),u=n+21412*(90-o)/90,c=r+e/(u*Math.cos(o*Math.PI/180))*180/Math.PI,d=o+i/u*180/Math.PI;a.push(c,d),l.push([c,d]),this.refreshBBox(s,c,d)}return l.push([r,o]),{positionArr:a,boundaryPoints:l,bbox:s}}refreshBBox(e,t,i){e[0]=te[2]?t:e[2],e[3]=i>e[3]?i:e[3]}createTargetPoints(e,t,i){let n=[this.frustumPrimitive,this.pyramid,this.debugModelMatrixPrimitive],r=[],o=[],s=[],a=this.getHeight(i[0],i[1],n);[].push({x:i[0],y:i[1],z:a});let l=this.ViewShedOptions.viewPosition;for(let u=0;ut?r.push(0):r.push(1),o.push(a),s.push(c)}}return{values:r,lngs:o,lats:s}}returnImgae(){return this.canvasEle.toDataURL("image/png")}}Object.assign(ri.prototype,{createViewshed:function(e){let t=this,i=t.viewer.scene;t.initHandler(),t.clearAll();let n=0,r="左键点击创建起点";t.handler=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas),t.handler.setInputAction((o=>{if(n++,1===n){r="左键点击创建终点";let e=i.pickPosition(o.position),n=t.cartesian3ToDegree(e);t.handler.setInputAction((function(o){b(r,o.endPosition,!0);let s=i.pickPosition(o.endPosition);if(Cesium.defined(s)){let i=t.cartesian3ToDegree(s),r=Cesium.Cartesian3.distance(s,e),o=t.getAngle(n[0],n[1],i[0],i[1]),a=t.getPitch(e,s);t.ViewShedOptions={viewPosition:e,endPosition:s,direction:o,pitch:a,horizontalViewAngle:90,verticalViewAngle:60,visibleAreaColor:Cesium.Color.GREEN,invisibleAreaColor:Cesium.Color.RED,visualRange:r},t.updateViewShed()}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}2===n&&(t.initHandler(),t.drawViewershed(e),b(r,o.endPosition,!1))}),Cesium.ScreenSpaceEventType.LEFT_CLICK),t.handler.setInputAction((function(e){b(r,e.endPosition,!0)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},clearAll:function(){this.clear(),this.viewershedPolygon&&(this.viewer.scene.primitives.remove(this.viewershedPolygon),this.viewershedPolygon=void 0)}});class oi{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._stopTime=null}}Object.assign(oi.prototype,{startSunShine(e){i((e=e||{}).startTime)||(e.startTime=(new Date).getTime()),i(e.stopTime)||(e.stopTime=(new Date).getTime()+1e3),i(e.speed)||(e.speed=1600),this._stopTime?(this._viewer.clock.shouldAnimate=!0,this._viewer.clock.currentTime=this._stopTime):(this._viewer.scene.globe.enableLighting=!0,this._viewer.shadows=!0,this._viewer.clock.startTime=Cesium.JulianDate.fromDate(new Date(e.startTime)),this._viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(e.startTime)),this._viewer.clock.stopTime=Cesium.JulianDate.fromDate(new Date(e.stopTime)),console.log(this._viewer.clock.currentTime),this._viewer.clock.clockRange=Cesium.ClockRange.LOOP_STOP,this._viewer.clock.clockStep=Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER,this._viewer.clock.multiplier=e.speed,this._viewer.clock.canAnimate=!0,this._viewer.clock.shouldAnimate=!0)},stopSunShine(){this._stopTime=this._viewer.clock.currentTime,console.log(this._viewer.clock.currentTime),this._viewer.clock.shouldAnimate=!1},removeSunShine(){this._stopTime&&(this._viewer.clock.shouldAnimate=!0,this._viewer.clock.currentTime=this._stopTime,console.log(this._viewer.clock.currentTime)),this._viewer.scene.globe.enableLighting=!1,this._viewer.shadows=!1,this._stopTime=null}}),Object.assign(oi.prototype,{start(e){document.getElementsByClassName("cesium-viewer-animationContainer").length>0&&(document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display="block"),document.getElementsByClassName("cesium-viewer-timelineContainer").length>0&&(document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display="block"),this._viewer.shadows=!0,i((e=e||{}).startTime)||(e.startTime=new Date((new Date).toLocaleDateString()).getTime(),console.log("当天凌晨0点",new Date((new Date).toLocaleDateString()))),i(e.stopTime)||(e.stopTime=new Date((new Date).toLocaleDateString()).getTime()+864e5-1,console.log("当天23点59分59秒",new Date(new Date((new Date).toLocaleDateString()).getTime()+144e5))),i(e.speed)||(e.speed=1600);let t=Cesium.JulianDate.fromDate(new Date(e.startTime)),n=Cesium.JulianDate.fromDate(new Date(e.stopTime));viewer.timeline.zoomTo(t,n);let r=viewer.clock;r.shouldAnimate=!1,r.startTime=t,r.stopTime=n,r.currentTime=t,r.clockRange=Cesium.ClockRange.UNBOUNDED,r.multiplier=e.speed},remove(){document.getElementsByClassName("cesium-viewer-animationContainer").length>0&&(document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display="none"),document.getElementsByClassName("cesium-viewer-timelineContainer").length>0&&(document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display="none"),this._viewer.shadows=!1,this._viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date((new Date).getTime())),this._viewer.clock.shouldAnimate=!1}});class si{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._profileEntities=[]}_interPoints(e,t){let i=[],n=[];for(let s=0;sr&&(r=i);let o=parseInt(r/2);o>1e3&&(o=1e3),o<2&&(o=2);for(let s=0;s{let r=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));this.removeProfileAnalysis(),t.clampToGround=!0,console.log(r);let o=this._interPoints(r,[t]);console.log(o),i(o)}))},removeProfileAnalysis(){let e=this;e._profileEntities&&e._profileEntities.length>0&&e._profileEntities.forEach((t=>{e._viewer.entities.remove(t)})),e._profileEntities=[]}});class ai{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this.delEntitys=[],this.maxHeigh=-1e6}_VolumeAnalysis(e){let t=this,i=0,n=0,r=0,o=0;const s=e.geom.indices,a=e.geom.attributes.position.values;for(let u=0;uthis.maxHeigh&&(this.maxHeigh=r),{heightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,r),noHeightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,0),height:r}}}Object.assign(ai.prototype,{createPolygonGeo(e,t){return new Promise(((i,n)=>{let r=this;(t=t||{}).precision=Cesium.defaultValue(t.precision,256),t.height=Cesium.defaultValue(t.height,10),r.remove();let o=[];for(let t=0;t{let i=e[2]||0;t=i,iCesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0))),n=this;n.data=i,n.baseHeight=t.baseHeight,n.targetY=t.baseHeight;let r=new Cesium.GeometryInstance({geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n.data),height:n.baseHeight,extrudedHeight:n.baseHeight+1e3}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(t.color).withAlpha(t.alpha)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});n.limitHeightPrimitive=n._viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:r,releaseGeometryInstances:!1,classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})),n._setPolygon(t)},removePrimitive(){this.HiePolygon&&this._viewer.entities.remove(this.HiePolygon),this.limitHeightPrimitive&&this._viewer.scene.primitives.remove(this.limitHeightPrimitive)},changeHeight(e){if(!this.limitHeightPrimitive)return;this.targetY=this.baseHeight+e;let t=Cesium.Cartographic.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center),i=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,this.baseHeight),n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,this.baseHeight+e),r=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3);this.limitHeightPrimitive._primitive.modelMatrix=Cesium.Matrix4.fromTranslation(r)}});class ui{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._camera=this._viewer.camera,this._scene=this._viewer.scene,this.targetY=0,this._mouseHandler()}_mouseHandler(){let e,t=this,i=t._viewer,n=t._scene;new Cesium.ScreenSpaceEventHandler(i.scene.canvas).setInputAction((function(t){let i=n.pick(t.position);Cesium.defined(i)&&Cesium.defined(i.id)&&Cesium.defined(i.id.plane)&&(e=i.id.plane,e.material=Cesium.Color.RED.withAlpha(.05),e.outlineColor=Cesium.Color.RED,n.screenSpaceCameraController.enableInputs=!1)}),Cesium.ScreenSpaceEventType.LEFT_DOWN),new Cesium.ScreenSpaceEventHandler(i.scene.canvas).setInputAction((function(){Cesium.defined(e)&&(e.material=Cesium.Color.RED.withAlpha(.1),e.outlineColor=Cesium.Color.RED,e=void 0),n.screenSpaceCameraController.enableInputs=!0}),Cesium.ScreenSpaceEventType.LEFT_UP),new Cesium.ScreenSpaceEventHandler(i.scene.canvas).setInputAction((function(i){if(Cesium.defined(e)){let e=i.startPosition.y-i.endPosition.y;t.targetY+=e}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}_createPlaneUpdateFunction(e){let t=this;return function(){return e.distance=t.targetY,e}}_createPlane(e,t,i){let n=this._getOriginCoordinateSystemPoint(e,i),r=this._getOriginCoordinateSystemPoint(t,i),o=new Cesium.Cartesian3(0,0,10),s=Cesium.Cartesian3.subtract(r,n,new Cesium.Cartesian3),a=Cesium.Cartesian3.cross(s,o,new Cesium.Cartesian3);a=Cesium.Cartesian3.normalize(a,a);let l=Cesium.Plane.fromPointNormal(n,a);return Cesium.ClippingPlane.fromPlane(l)}_getOriginCoordinateSystemPoint(e,t){let i=Cesium.Cartesian3.fromDegrees(e[0],e[1]);return Cesium.Matrix4.multiplyByPoint(t,i,new Cesium.Cartesian3(0,0,0))}_getInverseTransform(e){let t;const i=e.root.transform;return t=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center):Cesium.Matrix4.fromArray(e.root.transform),Cesium.Matrix4.inverseTransformation(t,new Cesium.Matrix4)}_isDirRes(e,t){var i=[];e.forEach((e=>{i.push([e.lng,e.lat])}));let n=function(e){for(var t,i,n=$(e),r=0,o=1;o0}(V(i));var r=[];if(t)if(n)for(var o=0,s=e.length-1;s>=0;s--)r[o]=e[s],o++;else r=e;else if(n)r=e;else for(o=0,s=e.length-1;s>=0;s--)r[o]=e[s],o++;return r}}Object.assign(ui.prototype,{activate(e){let t=this,i=t._viewer,n=t._getInverseTransform(e);[].push(t._createPlane([121.55814450142213,37.39658788787028],[121.65814450142213,37.49658788787028],n));let r=new Cesium.ClippingPlaneCollection({planes:[new Cesium.ClippingPlane(new Cesium.Cartesian3(0,1,0),-10)],edgeWidth:1});return t.tileset=e,e.clippingPlanes=r,e.debugShowBoundingVolume=!1,e.readyPromise.then((function(){let n=e.boundingSphere,o=n.radius;if(i.zoomTo(e,new Cesium.HeadingPitchRange(.5,-.2,o/5)),!Cesium.Matrix4.equals(e.root.transform,Cesium.Matrix4.IDENTITY)){const t=Cesium.Matrix4.getTranslation(e.root.transform,new Cesium.Cartesian3),i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Cartographic.fromCartesian(e.boundingSphere.center).height-i.height;r.modelMatrix=Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,n))}for(let e=0;eCesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));let i=this.viewer;this.clear();let n=[],r=Cesium.Cartesian3.subtract(e[0],e[1],new Cesium.Cartesian3).x>0;this.excavateMinHeight=999999999;for(let o=0;o{let t=e||32,i="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",n=i.length,r="";for(let o=0;o{new Cesium.sampleTerrainMostDetailed(o,r).then((function(t){e(t)}))}))}var gi=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",setSessionid:pi,guid:()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},getGuid:fi,getHeigthByLngLat:function(e,t){if(!e)throw new n("no viewer object!");if(!i(t.longitude)&&!i(t.latitude))throw new n("longitude and latitude are required.");t.level=Cesium.defaultValue(t.level,11);let r=Cesium.Cartographic.fromDegrees(t.longitude,t.latitude),o=e.terrainProvider;return new Promise(((e,i)=>{new Cesium.sampleTerrain(o,t.level,[r]).then((function(t){t&&e(t[0].height)}))}))},getHeigthByPoints:function(e,t){if(!e)throw new n("no viewer object!");if(!i(t))throw new n("options is required.");t.level=Cesium.defaultValue(t.level,11);let r=[],o=t.points;for(let i=0;i{new Cesium.sampleTerrain(s,t.level,r).then((function(t){t&&e(t)}))}))},getHeigthByPointsMostDetailed:mi});class vi{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this.result=[],this.handler=void 0,this.toolTip=""}_openTip(){let e=this;this.handler=new Cesium.ScreenSpaceEventHandler(e._viewer.canvas),this.handler.setInputAction((function(t){let i=t.endPosition;var n=e._viewer.scene.pick(i);n&&n.id&&"SlopeAspect"===n.id.type?(e.toolTip=n.id.value.toFixed(2),b(e.toolTip,i,!0)):(e.toolTip="",b(e.toolTip,i,!1))}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}_CreatePolygonOnGround(e,t,i){let n,r=this,o="左键点击开始绘制",s=[],a=!0,l=new Cesium.ScreenSpaceEventHandler(r._viewer.canvas);l.setInputAction((function(e){let i=e.position,a=m.getCatesian3FromPX(r._viewer,i);if(0==s.length){o="左键添加第二个点",s.push(a);let e=new Cesium.CallbackProperty((function(){return s.concat([s[0]])}),!1),i=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s)}),!1);n=r._viewer.entities.add({name:"Polygon",id:t.id,polyline:{positions:e,width:t.outlineWidth,material:t.outlineColor,clampToGround:!0},polygon:{heightReference:Cesium.HeightReference.None,hierarchy:i,material:t.color}}),n.GeoType="Polygon"}else o="左键添加点,Ctrl+Z回退,右键完成绘制";s.push(a)}),Cesium.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction((function(e){let t=e.endPosition;if(b(o,t,!0),Cesium.defined(n)){s.pop();let e=m.getCatesian3FromPX(r._viewer,t);s.push(e)}3===s.length&&(n.polygon.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),l.setInputAction((function(t){s.pop(),n.pottingPoint=s,e.push(n),l.destroy(),b(o,t.position,!1),a=!1,"function"==typeof i&&i(n)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),document.onkeydown=function(e){if(e.ctrlKey&&90==window.event.keyCode){if(!a)return!1;s.pop(),2==s.length&&(o="左键添加第二个点")}}}_createEllipse(e){let t=this,i=[];for(let n=0;n{let i=[],n=e.reduce((function(e,t,n,r){var o=10*n,s=o+10,a=r.slice(o,s);return 0!=a.length&&(i[n]=a),i}),[]);t._calculateSlope(n),t._openTip()}))}_createPolygonInsrance(e,t){let i=[];for(let r=1;r0?[Cesium.Cartographic.toCartesian(o),Cesium.Cartographic.toCartesian(s)]:[Cesium.Cartographic.toCartesian(s),Cesium.Cartographic.toCartesian(o)];return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:r},geometry:new Cesium.GroundPolylineGeometry({positions:a,width:this.arrowWidth}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}_calculateSlope(e){let t=this,i=[],n=[];for(let s=0;sa&&(a=t,l=e)}let u=new Cesium.Cartographic(o.longitude,o.latitude,0),c=new Cesium.Cartographic(r[l].longitude,r[l].latitude,0),h=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(u),Cesium.Cartographic.toCartesian(c)),d=Math.abs(a/h),p=t._calculateSlopeColor(d,.4);const f=t._createPolygonInsrance(r,p);n.push(f);let m=l>4?r[l-4]:r[l+4],g=r[l];const v=t._createArrowInstance(g,o,m,a,d);i.push(v)}const r=t._viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})})),o=t._viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineArrow",uniforms:{color:new Cesium.Color(1,1,0,.8)}}})})}));t.result.push(o,r)}_calculateSlopeColor(e,t){return e<.00872686779075879?"rgba(85,182,43,"+t+")":e<.03492076949174773?"rgba(135,211,43,"+t+")":e<.08748866352592401?"rgba(204,244,44,"+t+")":e<.2679491924311227?"rgba(245,233,44,"+t+")":e<.7002075382097097?"rgba(255,138,43,"+t+")":e<1.4281480067421144?"rgba(255,84,43,"+t+")":"rgba(255,32,43,"+t+")"}}Object.assign(vi.prototype,{createNew4Distance(e,t,i){(i=i||{}).distance=i.distance||.1;let n=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));this.clearAll();let r=m.Cartesian3ListToWGS84(n),o=[],s=1e4,a=1e4,l=-1e4,u=-1e3;for(let d=0;dl?t:l,u=i>u?i:u}o.push(o[0]);let c=[s,a,l,u];H([o]);let h=ni(c,i.distance,{});this._createEllipse(h)},createNew4Num(e,t){let i=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0))),n=this;n.clearAll();let r=m.Cartesian3ListToWGS84(i),o=[],s=1e4,a=1e4,l=-1e4,u=-1e3;for(let m=0;ml?t:l,u=i>u?i:u}o.push(o[0]);let c=[s,a,l,u],h=l-s,d=u-a;d=d>h?d:h;const p=d/options.num;let f=2e3*p>35?35:2e3*p;n.arrowWidth=f<15?15:f,H([o]);let g=ni(c,p,{units:"degrees"});n._createEllipse(g)},clearAll(){this.result.forEach((e=>{this._viewer.scene.primitives.remove(e)})),this.result=[],this.handler&&(this.handler.destroy(),this.handler=void 0)}});let yi={TerrainExcavation:di,SlopeAspect:vi};class _i{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e}_initRain(){this.rainStage=new Cesium.PostProcessStage({name:"jt_rain",fragmentShader:this._rain(),uniforms:{tiltAngle:()=>this.tiltAngle,rainSize:()=>this.rainSize,rainSpeed:()=>this.rainSpeed}}),this._viewer.scene.postProcessStages.add(this.rainStage)}_initSnow(){this.snowStage=new Cesium.PostProcessStage({name:"jt_snow",fragmentShader:this._snow(),uniforms:{snowSize:()=>this.snowSize,snowSpeed:()=>this.snowSpeed}}),this._viewer.scene.postProcessStages.add(this.snowStage)}_initFog(){this.fogStage=new Cesium.PostProcessStage({name:"jt_fog",fragmentShader:this._fog(),uniforms:{visibility:()=>this.visibility,fogColor:()=>this.color}}),this._viewer.scene.postProcessStages.add(this.fogStage)}_rain(){return"uniform sampler2D colorTexture;\n\t varying vec2 v_textureCoordinates;\n\t uniform float tiltAngle;\n\t uniform float rainSize;\n\t uniform float rainSpeed;\n\t float hash(float x) {\n\t return fract(sin(x * 133.3) * 13.13);\n\t }\n\t void main(void) {\n\t float time = czm_frameNumber / rainSpeed;\n\t vec2 resolution = czm_viewport.zw;\n\t vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n\t vec3 c = vec3(.6, .7, .8);\n\t float a = tiltAngle;\n\t float si = sin(a), co = cos(a);\n\t uv *= mat2(co, -si, si, co);\n\t uv *= length(uv + vec2(0, 4.9)) * rainSize + 1.;\n\t float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);\n\t float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;\n\t c *= v * b;\n\t gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c, 1), .5);\n\t }\n\t "}_snow(){return"uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSpeed;\n uniform float snowSize;\n float snow(vec2 uv,float scale)\n {\n float time=czm_frameNumber/snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution=czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c=0.;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor=mix(texture2D(colorTexture,v_textureCoordinates),vec4(finalColor,1),.5);\n }\n "}_fog(){return"uniform sampler2D colorTexture;\n\t uniform sampler2D depthTexture;\n\t uniform float visibility;\n\t uniform vec4 fogColor;\n\t varying vec2 v_textureCoordinates; \n\t void main(void) \n\t { \n\t vec4 origcolor = texture2D(colorTexture, v_textureCoordinates); \n\t float depth = czm_readDepth(depthTexture, v_textureCoordinates); \n\t vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates); \n\t float f = visibility * (depthcolor.r - 0.3) / 0.2; \n\t if (f < 0.0) f = 0.0; \n\t else if (f > 1.0) f = 1.0; \n\t gl_FragColor = mix(origcolor, fogColor, f); \n\t }\n"}_removeSnow(){this._viewer&&this.snowStage&&(this._viewer.scene.postProcessStages.remove(this.snowStage),delete this.snowSize,delete this.snowSpeed)}_removeRain(){this._viewer&&this.rainStage&&(this._viewer.scene.postProcessStages.remove(this.rainStage),delete this.tiltAngle,delete this.rainSize,delete this.rainSpeed)}_removeFog(){this._viewer&&this.fogStage&&(this._viewer.scene.postProcessStages.remove(this.fogStage),delete this.visibility,delete this.color)}}Object.assign(_i.prototype,{addRainEffect(e){e=e||{},this.tiltAngle=Cesium.defaultValue(e.tiltAngle,-.6),this.rainSize=Cesium.defaultValue(e.rainSize,.3),this.rainSpeed=Cesium.defaultValue(e.rainSpeed,60),this._initRain()},addSnowEffect(e){e=e||{},this.snowSize=Cesium.defaultValue(e.snowSize,.02),this.snowSpeed=Cesium.defaultValue(e.snowSpeed,60),this._initSnow()},addFogEffect(e){e=e||{},this.visibility=Cesium.defaultValue(e.visibility,.1),this.color=Cesium.defaultValue(e.color,new Cesium.Color(.8,.8,.8,.5)),this._show=Cesium.defaultValue(e.show,!0),this._initFog()},removeEffect(){this.snowStage&&this._removeSnow(),this.rainStage&&this._removeRain(),this.fogStage&&this._removeFog()}});const bi=Cesium.BoxGeometry,Ci=Cesium.Cartesian3,Ti=Cesium.defaultValue,wi=Cesium.defined,Ei=Cesium.destroyObject,Si=Cesium.DeveloperError,ki=Cesium.GeometryPipeline,Pi=Cesium.Matrix3,Ai=Cesium.Matrix4,xi=Cesium.Transforms,Ii=Cesium.VertexFormat,Mi=Cesium.BufferUsage,Li=Cesium.CubeMap,Di=Cesium.DrawCommand,Oi=Cesium.loadCubeMap,ji=Cesium.RenderState,Ri=Cesium.VertexArray,Ni=Cesium.BlendingState,Ui=Cesium.SceneMode,Bi=Cesium.ShaderProgram,Fi=Cesium.ShaderSource;Cesium.defined(Cesium.Matrix4.getRotation)||(Cesium.Matrix4.getRotation=Cesium.Matrix4.getMatrix3);class Wi{constructor(e){this.sources=e.sources,this._sources=void 0,this.show=Ti(e.show,!0),this._command=new Di({modelMatrix:Ai.clone(Ai.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}}const Hi=new Pi;Wi.prototype.update=function(e,t){const i=this;if(!this.show)return;if(e.mode!==Ui.SCENE3D&&e.mode!==Ui.MORPHING)return;if(!e.passes.render)return;const n=e.context;if(this._sources!==this.sources){this._sources=this.sources;const e=this.sources;if(!(wi(e.positiveX)&&wi(e.negativeX)&&wi(e.positiveY)&&wi(e.negativeY)&&wi(e.positiveZ)&&wi(e.negativeZ)))throw new Si("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof e.positiveX!=typeof e.negativeX||typeof e.positiveX!=typeof e.positiveY||typeof e.positiveX!=typeof e.negativeY||typeof e.positiveX!=typeof e.positiveZ||typeof e.positiveX!=typeof e.negativeZ)throw new Si("this.sources properties must all be the same type.");"string"==typeof e.positiveX?Oi(n,this._sources).then((function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e})):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Li({context:n,source:e}))}const r=this._command;if(r.modelMatrix=xi.eastNorthUpToFixedFrame(e.camera._positionWC),!wi(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return Ai.getRotation(r.modelMatrix,Hi)}};const e=bi.createGeometry(bi.fromDimensions({dimensions:new Ci(2,2,2),vertexFormat:Ii.POSITION_ONLY})),t=this._attributeLocations=ki.createAttributeLocations(e);r.vertexArray=Ri.fromGeometry({context:n,geometry:e,attributeLocations:t,bufferUsage:Mi._DRAW}),r.renderState=ji.fromCache({blending:Ni.ALPHA_BLEND})}if(!wi(r.shaderProgram)||this._useHdr!==t){const e=new Fi({defines:[t?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]});r.shaderProgram=Bi.fromCache({context:n,vertexShaderSource:"attribute vec3 position;\n varying vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:e,attributeLocations:this._attributeLocations}),this._useHdr=t}return wi(this._cubeMap)?r:void 0},Wi.prototype.isDestroyed=function(){return!1},Wi.prototype.destroy=function(){const e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),Ei(this)};class Vi{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._farSkyBox=e.scene.skyBox}}Object.assign(Vi.prototype,{setGroundSkyBox(e){if((e=e||{}).height=e.height||2e5,e.type=e.type||"蓝天",e.sources){if(!(i(e.sources.positiveX)&&i(e.sources.negativeX)&&i(e.sources.positiveY)&&i(e.sources.negativeY)&&i(e.sources.positiveZ)&&i(e.sources.negativeZ)))throw new n("options.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.")}else switch(e.type){case"晚霞":e.sources={positiveX:"/jt3dSDK/imgs/skybox/01/px.png",negativeX:"/jt3dSDK/imgs/skybox/01/nx.png",positiveY:"/jt3dSDK/imgs/skybox/01/py.png",negativeY:"/jt3dSDK/imgs/skybox/01/ny.png",positiveZ:"/jt3dSDK/imgs/skybox/01/pz.png",negativeZ:"/jt3dSDK/imgs/skybox/01/nz.png"};break;case"阴天":e.sources={positiveX:"/jt3dSDK/imgs/skybox/02/px.jpg",negativeX:"/jt3dSDK/imgs/skybox/02/nx.jpg",positiveY:"/jt3dSDK/imgs/skybox/02/py.jpg",negativeY:"/jt3dSDK/imgs/skybox/02/ny.jpg",positiveZ:"/jt3dSDK/imgs/skybox/02/pz.jpg",negativeZ:"/jt3dSDK/imgs/skybox/02/nz.jpg"};break;case"蓝天":e.sources={positiveX:"/jt3dSDK/imgs/skybox/03/px.jpg",negativeX:"/jt3dSDK/imgs/skybox/03/nx.jpg",positiveY:"/jt3dSDK/imgs/skybox/03/py.jpg",negativeY:"/jt3dSDK/imgs/skybox/03/ny.jpg",positiveZ:"/jt3dSDK/imgs/skybox/03/pz.jpg",negativeZ:"/jt3dSDK/imgs/skybox/03/nz.jpg"};break;case"紫色星空":e.sources={positiveX:"/jt3dSDK/imgs/skybox/04/px.jpg",negativeX:"/jt3dSDK/imgs/skybox/04/nx.jpg",positiveY:"/jt3dSDK/imgs/skybox/04/py.jpg",negativeY:"/jt3dSDK/imgs/skybox/04/ny.jpg",positiveZ:"/jt3dSDK/imgs/skybox/04/pz.jpg",negativeZ:"/jt3dSDK/imgs/skybox/04/nz.jpg"};break;case"蓝色星空":e.sources={positiveX:"/jt3dSDK/imgs/skybox/05/px.jpg",negativeX:"/jt3dSDK/imgs/skybox/05/nx.jpg",positiveY:"/jt3dSDK/imgs/skybox/05/py.jpg",negativeY:"/jt3dSDK/imgs/skybox/05/ny.jpg",positiveZ:"/jt3dSDK/imgs/skybox/05/pz.jpg",negativeZ:"/jt3dSDK/imgs/skybox/05/nz.jpg"}}let t=this,r=new Wi({sources:e.sources,show:!0});t._viewer.scene.postRender.addEventListener((()=>{var i=t._viewer.camera.position;Cesium.Cartographic.fromCartesian(i).height0){var o=new Cesium.Cartesian3(e._property._values[3*t-3],e._property._values[3*t-2],e._property._values[3*t-1]);if(t<976)r=Cesium.Cartesian3.fromDegrees(n[t].x,n[t].y,n[t].z);else if(t>975&&t<986)r=Cesium.Cartesian3.fromDegrees(n[t].x,n[t].y,n[t].z);else if(t>985)r=Cesium.Cartesian3.fromDegrees(n[t].x,n[t].y,n[t].z);var s=[Cesium.Ellipsoid.WGS84.cartesianToCartographic(o),Cesium.Ellipsoid.WGS84.cartesianToCartographic(r)],a=new Cesium.EllipsoidGeodesic(s[0],s[1]).surfaceDistance/50;i=Cesium.JulianDate.addSeconds(e._property._times[t-1],a,new Cesium.JulianDate);e.addSample(i,r)}}return e};var i=e.geometry.coordinates,n=[];if(!(i.length>0))return;for(var r=0;r0&&(e.multiplier=-t),e.shouldAnimate=!0},outFly(){var e=Cesium.JulianDate.fromDate(new Date);this._viewer.clock.startTime=e.clone();var t=Cesium.JulianDate.addSeconds(e,3e8,new Cesium.JulianDate);this._viewer.clock.stopTime=t.clone(),this.clearFlyPaths()},drawFlyPaths(e,t){return new Promise(((t,i)=>{let n=this;n.clearFlyPaths();let r=n._viewer.camera.position;var o={orientation:{heading:n._viewer.camera.heading,pitch:n._viewer.camera.pitch,roll:n._viewer.camera.roll},position:r,geometry:{type:"LineString",coordinates:e}};n._draw3DObj=o,t(!0)}))},clearFlyPaths(){this._draw3DObj=null,this._viewer.trackedEntity=void 0,this._viewer.entities.remove(this.entityFly)}});class Zi{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._iconBlue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgI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h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC"}}Object.assign(Zi.prototype,{generatePoint(e,t){return new Promise(((r,o)=>{let s=this;if(!i(e))throw new n("points is required.");let a=(t=t||{}).style||{};a.pixelSize=Cesium.defaultValue(a.pixelSize,10),a.color?a.color=new Cesium.Color(a.color[0]/255,a.color[1]/255,a.color[2]/255,a.color[3]):a.color=new Cesium.Color.fromCssColorString("#ff0000").withAlpha(1),a.outlineColor?a.outlineColor=new Cesium.Color(a.outlineColor[0]/255,a.outlineColor[1]/255,a.outlineColor[2]/255,a.outlineColor[3]):a.outlineColor=new Cesium.Color.fromCssColorString("#ffff00").withAlpha(1),a.outlineWidth=Cesium.defaultValue(a.outlineWidth,1),mi(s._viewer,[e]).then((function(i){let n=Cesium.Cartesian3.fromDegrees(e[0],e[1],i[0].height),o=new Cesium.Entity({position:n,point:{pixelSize:a.pixelSize,color:a.color,outlineColor:a.outlineColor,outlineWidth:a.outlineWidth,heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:i[0].height}});if(t.label){let e=t.label||{};e.text=Cesium.defaultValue(e.text,""),e.font=Cesium.defaultValue(e.font,"24px Helvetica"),e.fillColor?e.fillColor=new Cesium.Color(e.fillColor[0]/255,e.fillColor[1]/255,e.fillColor[2]/255,e.fillColor[3]):e.fillColor=new Cesium.Color.fromCssColorString("#fff").withAlpha(1),e.outlineColor?e.outlineColor=new Cesium.Color(e.outlineColor[0]/255,e.outlineColor[1]/255,e.outlineColor[2]/255,e.outlineColor[3]):e.outlineColor=new Cesium.Color(0,.6,.3,0),e.outlineWidth=Cesium.defaultValue(e.outlineWidth,1),e.showBackground=Cesium.defaultValue(e.showBackground,!0),e.backgroundColor?e.backgroundColor=new Cesium.Color(e.backgroundColor[0]/255,e.backgroundColor[1]/255,e.backgroundColor[2]/255,e.backgroundColor[3]):e.backgroundColor=new Cesium.Color(0,0,0,.6),e.pixelOffset=Cesium.defaultValue(e.pixelOffset,0),e.scale=Cesium.defaultValue(e.scale,1),e.near=Cesium.defaultValue(e.near,150),e.nearValue=Cesium.defaultValue(e.nearValue,1),e.far=Cesium.defaultValue(e.far,2400),e.farValue=Cesium.defaultValue(e.farValue,0),o.label={text:e.text,font:e.font,fillColor:e.fillColor,outlineColor:e.outlineColor,outlineWidth:e.outlineWidth,style:Cesium.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:e.showBackground,backgroundColor:e.backgroundColor,backgroundPadding:new Cesium.Cartesian2(6,6),disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(0,t.pixelOffset),scale:e.scale}}s._viewer.entities.add(o),r(o)}))}))},addBillboard(e,t){return new Promise(((i,n)=>{let r=(t=t||{}).billboard||{};r.scale=Cesium.defaultValue(r.scale,1),r.near=Cesium.defaultValue(r.near,150),r.nearValue=Cesium.defaultValue(r.nearValue,1),r.far=Cesium.defaultValue(r.far,2400),r.farValue=Cesium.defaultValue(r.farValue,0),r.imgUrl=r.imgUrl||this._iconBlue;let o=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0),s=new Cesium.Entity({name:"add billboard",position:o,billboard:{image:r.imgUrl,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,scale:r.scale,pixelOffset:new Cesium.Cartesian2(0,-11),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(t.label){let e=t.label||{};e.text=Cesium.defaultValue(e.text,""),e.font=Cesium.defaultValue(e.font,"24px Helvetica"),e.fillColor=Cesium.defaultValue(e.fillColor,"#FF0000"),e.outlineColor=Cesium.defaultValue(e.outlineColor,"#FFFF00"),e.outlineWidth=Cesium.defaultValue(e.outlineWidth,1),e.pixelOffset=Cesium.defaultValue(e.pixelOffset,0),e.scale=Cesium.defaultValue(e.scale,1),e.near=Cesium.defaultValue(e.near,150),e.nearValue=Cesium.defaultValue(e.nearValue,1),e.far=Cesium.defaultValue(e.far,2400),e.farValue=Cesium.defaultValue(e.farValue,0),s.label={text:e.text,font:e.font,fillColor:new Cesium.Color.fromCssColorString(e.fillColor),outlineColor:new Cesium.Color.fromCssColorString(e.outlineColor),outlineWidth:e.outlineWidth,style:Cesium.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,backgroundColor:new Cesium.Color.fromCssColorString(e.fillColor),backgroundPadding:new Cesium.Cartesian2(6,6),disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(0,t.pixelOffset),scale:e.scale,scaleByDistance:new Cesium.NearFarScalar(e.near,e.nearValue,e.far,e.farValue)}}this._viewer.entities.add(s),i(s)}))}});class Qi{constructor(e){this.defaultColor=new Cesium.Color(255,0,0,0),e=e||{},this._definitionChanged=new Cesium.Event,this._color=void 0,this.color=e.color?Cesium.Color.fromCssColorString(e.color):this.defaultColor,this._duration=e.duration||1e3,this._image=e.imgUrl,this._count=e.count||1,this._direction=e.direction||"horizontal",this._order=e.order||"-",this._time=performance.now(),this._isImageAlpha=e.isImageAlpha||!1,this.addMaterial()}addMaterial(){Cesium.Material.PolylineTrailType="PolylineTrail",Cesium.Material.Polylineimage="images/colors.png","vertical"===this._direction?this._isImageAlpha?Cesium.Material.PolylineTrailSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n\t\t\t\t\t {\n\t\t\t\t\t czm_material material = czm_getDefaultMaterial(materialInput);\n\t\t\t\t\t vec2 st = repeat * materialInput.st;\n\t\t\t\t\t\t\t\t vec4 colorImage = texture2D(image, vec2(fract(st.t "+this._order+" time), st.s));\n\t\t\t\t\t\t\t\t material.alpha = colorImage.a;\n\t\t\t\t\t\t\t\t material.diffuse = colorImage.rgb* 1.5 ;\n\t\t\t\t\t return material;\n\t\t\t\t\t }":Cesium.Material.PolylineTrailSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n\t\t\t\t\t {\n\t\t\t\t\t czm_material material = czm_getDefaultMaterial(materialInput);\n\t\t\t\t\t vec2 st = repeat * materialInput.st;\n\t\t\t\t\t\t\t\t vec4 colorImage = texture2D(image, vec2(fract(st.t "+this._order+" time), st.s));\n\t\t\t\t\t\t\t\t material.alpha = colorImage.a * color.a;\n\t\t\t\t\t\t\t\t material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n\t\t\t\t\t return material;\n\t\t\t\t\t }":"horizontal"===this._direction&&(this._isImageAlpha?Cesium.Material.PolylineTrailSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n\t\t\t\t {\n\t\t\t\t czm_material material = czm_getDefaultMaterial(materialInput);\n\t\t\t\t vec2 st = repeat * materialInput.st;\n\t\t\t\t\t\t\t vec4 colorImage = texture2D(image, vec2(fract(st.s "+this._order+" time), st.t));\n\t\t\t\t\t\t\t material.alpha = colorImage.a;\n\t\t\t\t\t\t\t material.diffuse = colorImage.rgb * 1.5 ;\n\t\t\t\t return material;\n\t\t\t\t }":Cesium.Material.PolylineTrailSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n\t\t\t\t {\n\t\t\t\t czm_material material = czm_getDefaultMaterial(materialInput);\n\t\t\t\t vec2 st = repeat * materialInput.st;\n\t\t\t\t\t\t\t vec4 colorImage = texture2D(image, vec2(fract(st.s "+this._order+" time), st.t));\n\t\t\t\t\t\t\t material.alpha = colorImage.a * color.a;\n\t\t\t\t\t\t\t material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n\t\t\t\t return material;\n\t\t\t\t }"),Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailType,{fabric:{type:Cesium.Material.PolylineTrailType,uniforms:{color:new Cesium.Color(1,0,0,.5),image:Cesium.Material.Polylineimage,time:0,repeat:new Cesium.Cartesian2(5,1),order:"-"},source:Cesium.Material.PolylineTrailSource},translucent:function(e){return!0}})}}Qi.prototype.getType=function(e){return"PolylineTrail"},Qi.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,this.defaultColor,t.color),t.image=this._image,t.time=(performance.now()-this._time)%this._duration/this._duration,t.repeat=new Cesium.Cartesian2(this._count,1),t.order=this._order,t},Qi.prototype.equals=function(e){return this===e||e instanceof Qi&&Cesium.Property.equals(this._color,e._color)},Object.defineProperties(Qi.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")});class Ki{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e}}Object.assign(Ki.prototype,{regionRangeByGeoJson(e){return new Promise(((t,r)=>{let o=this;if(!i(e))throw new n("geoJsonUrl is required.");let s={width:5,minHeigh:0,maxHeigh:2e8,duration:3e3,isImageAlpha:!0,imgUrl:"/jt3dSDK/imgs/polylinematerial/spriteline1.png"};new Cesium.GeoJsonDataSource.load(e).then((e=>{o._viewer.dataSources.add(e);let i=e.entities.values;for(var n=0;n{let s=this;if(!i(e))throw new n("geoJsonUrl is required.");(t=t||{}).color=Cesium.defaultValue(t.color,"#FF0000"),t.width=Cesium.defaultValue(t.width,3),t.minHeigh=Cesium.defaultValue(t.minHeigh,0),t.maxHeigh=Cesium.defaultValue(t.maxHeigh,2e8),new Cesium.GeoJsonDataSource.load(e).then((e=>{s._viewer.dataSources.add(e);let i=e.entities.values;for(var n=0;n{if(!i(e))throw new n("points is required.");e.length<2&&o("线对象,点数至少2个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.width=t.width||5,r(this._viewer.entities.add({id:t.id,name:"Pulse line",polyline:{positions:s,width:t.width,material:new Qi(t),clampToGround:!0}}))}))},PolylineArrowMaterialProperty:function(e,t){return new Promise(((r,o)=>{if(!i(e))throw new n("points is required.");e.length<2&&o("线对象,点数至少2个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.width=t.width||5,r(this._viewer.entities.add({id:t.id,name:"Pulse line",polyline:{positions:s,width:t.width,material:new Qi(t),clampToGround:!0}}))}))},drawGlowingLine(e,t){return new Promise(((r,o)=>{if(!i(e))throw new n("points is required.");e.length<2&&o("线对象,点数至少2个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.color?t.color=new Cesium.Color(t.color[0]/255,t.color[1]/255,t.color[2]/255,t.color[3]):t.color=Cesium.Color.RED,t.width=t.width||5,t.glowPower=t.glowPower||.25,t.taperPower=t.taperPower||1,r(this._viewer.entities.add({id:t.id,name:"Glowing blue line on the surface",polyline:{clampToGround:!0,positions:s,width:t.width,followSurface:!0,material:new Cesium.PolylineGlowMaterialProperty({color:t.color,glowPower:t.glowPower,taperPower:t.taperPower})}}))}))},drawSpecifyColorLine(e,t){return new Promise(((n,r)=>{i(e)||r("points is required."),e.length<2&&r("线对象,点数至少2个");let o=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.color?t.color=new Cesium.Color(t.color[0]/255,t.color[1]/255,t.color[2]/255,t.color[3]):t.color=new Cesium.Color.fromCssColorString("#ff0000").withAlpha(1),t.width=t.width||5,n(this._viewer.entities.add({id:t.id,name:"Red line on the surface",polyline:{clampToGround:!0,positions:o,width:t.width,material:t.color}}))}))},drawSpecifyColorAndOutlineColorLine(e,t){return new Promise(((r,o)=>{if(!i(e))throw new n("points is required.");e.length<2&&o("线对象,点数至少2个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.color?t.color=new Cesium.Color(t.color[0]/255,t.color[1]/255,t.color[2]/255,t.color[3]):t.color=new Cesium.Color.fromCssColorString("#ff0000").withAlpha(1),t.width=t.width||5,t.outlineColor?t.outlineColor=new Cesium.Color(t.outlineColor[0]/255,t.outlineColor[1]/255,t.outlineColor[2]/255,t.outlineColor[3]):t.outlineColor=new Cesium.Color.fromCssColorString("#ffff00").withAlpha(1),t.outlineWidth=Cesium.defaultValue(t.outlineWidth,1),r(this._viewer.entities.add({id:t.id,name:"Orange line with black outline at height and following the surface",polyline:{clampToGround:!0,positions:s,width:t.width,material:new Cesium.PolylineOutlineMaterialProperty({color:t.color,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor})}}))}))},drawSpecifyColorArrowStaticStateLine(e,t){return new Promise(((r,o)=>{if(!i(e))throw new n("points is required.");e.length<2&&o("线对象,点数至少2个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.color?t.color=new Cesium.Color(t.color[0]/255,t.color[1]/255,t.color[2]/255,t.color[3]):t.color=new Cesium.Color.fromCssColorString("#ff0000").withAlpha(1),t.width=t.width||5,r(this._viewer.entities.add({id:t.id,name:"Purple straight arrow at height",polyline:{clampToGround:!0,positions:s,width:t.width,followSurface:!1,material:new Cesium.PolylineArrowMaterialProperty(t.color)}}))}))},drawDashedLine(e,t){return new Promise(((r,o)=>{if(!i(e))throw new n("points is required.");e.length<2&&o("线对象,点数至少2个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.color?t.color=new Cesium.Color(t.color[0]/255,t.color[1]/255,t.color[2]/255,t.color[3]):t.color=new Cesium.Color.fromCssColorString("#ff0000").withAlpha(1),t.width=t.width||5,t.gapColor?t.gapColor=new Cesium.Color(t.gapColor[0]/255,t.gapColor[1]/255,t.gapColor[2]/255,t.gapColor[3]):t.gapColor=Cesium.Color.TRANSPARENT,t.dashLength=t.dashLength||16,t.dashPattern=t.dashPattern||255,r(this._viewer.entities.add({id:t.id,name:"CYAN dashed line",polyline:{clampToGround:!0,positions:s,width:t.width,material:new Cesium.PolylineDashMaterialProperty({color:t.color,gapColor:t.gapColor,dashLength:t.dashLength,dashPattern:t.dashPattern})}}))}))}});class Ji{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e,this._drawEntities=[],this._polygonEntity=null}}Object.assign(Ji.prototype,{drawPolygonByGeoJson(e,t){return new Promise(((r,o)=>{let s=this;if(!i(e))throw new n("geoJsonUrl is required.");(t=t||{}).color=Cesium.defaultValue(t.color,"#FF0000"),t.outlineColor=Cesium.defaultValue(t.outlineColor,"#FFFF00"),t.outlineWidth=Cesium.defaultValue(t.outlineWidth,1),t.extrudedHeight=Cesium.defaultValue(t.extrudedHeight,0),Cesium.GeoJsonDataSource.load(e,{stroke:Cesium.Color.WHITE,strokeWidth:3,fill:Cesium.Color.RED.withAlpha(.5)}).then((e=>{s._viewer.dataSources.add(e);let i=e.entities.values;for(let n=0;n{if(!i(e))throw new n("points is required.");e.length<3&&o("面对象,点数至少3个");let s=e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0)));(t=t||{}).id=t.id||pi(),t.fill=t.fill||!0,t.color?t.color=new Cesium.Color(t.color[0]/255,t.color[1]/255,t.color[2]/255,t.color[3]):t.color=new Cesium.Color.fromCssColorString("#ff0000").withAlpha(1),t.outline=t.outline||!1,t.outlineColor?t.outlineColor=new Cesium.Color(t.outlineColor[0]/255,t.outlineColor[1]/255,t.outlineColor[2]/255,t.outlineColor[3]):t.outlineColor=new Cesium.Color.fromCssColorString("#000").withAlpha(1),t.outlineWidth=Cesium.defaultValue(t.outlineWidth,1);let a=new Cesium.Entity({id:t.id,name:"Generate surfaces based on coordinate points",polygon:{hierarchy:s,material:t.color,fill:t.fill,outline:t.outline,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor}});t.outline&&(a.polyline={positions:a.polygon.hierarchy._value.positions,width:t.outlineWidth,material:t.outlineColor,clampToGround:!0}),this._viewer.entities.add(a),r(a)}))}}),Cesium.Primitive.prototype.setUseGeometry=function(e){this._useGeometry=e},Cesium.Primitive.prototype.getUseGeometry=function(){return this._useGeometry};class $i{constructor(e,t){this._viewer=e,this._init(t)}_init(e){if(this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._entities=this._viewer.entities,this._pointEntitys=[],this._sketchPointImage=void 0,this._iconNormal="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO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fkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC",this._sketchEntityName="sketchEntity",this._sketchTempPoints=[],this._sketchPoints=[],this._sketchOutputPoints=[],this._sketchTempPolyline=void 0,this._sketchPolyline=void 0,this._sketchTempPolygon=void 0,this._sketchPolygon=void 0,this._sketchTempAltituePolyline=void 0,this._sketchAltitudePolyline=void 0,this._sketchAltitudeInitHeight=0,this._sketchTempSpatialPolyline=void 0,this._sketchSpatialPolyline=void 0,this._sketchTempCircle=void 0,this._sketchCircle=void 0,this._sketchTempRectangle=void 0,this._sketchRectangle=void 0,this._sketchTempTriangleAltitudePolyline=void 0,this._sketchTriangleAltituePolyline=void 0,this._sketchTempSpatialTriangle=void 0,this._sketchSpatialTriangle=void 0,this._lineLabel=void 0,this._polygonLabel=void 0,e&&e.isDrawPoint?this._isDrawPoint=e.isDrawPoint:this._isDrawPoint=!1,e&&e.isRetainDrawPoint?this._isRetainDrawPoint=e.isRetainDrawPoint:this._isRetainDrawPoint=!1,this._param={moveLineWidth:2,lineWidth:2,moveAltitudeLineWidth:2,altitudeLineWidth:2,spatialLineWidth:2,moveEllipseColor:[0,255,0,.5],moveEllipseOutline:!0,moveEllipseOutlineColor:[255,0,0,.5],moveEllipseOutlineWidth:1,spatialLineWidth:2,ellipseColor:[0,0,255,.5],ellipseOutline:!0,ellipseOutlineColor:[255,0,0,.5],ellipseOutlineWidth:1},this._setMoveLineStyle(void 0),this._setLineStyle(void 0),this._setMovePolygonStyle(void 0),this._setPolygonStyle(void 0),this._setMoveAltitudeLineStyle(void 0),this._setAltitudeLineStyle(void 0),this._setMoveEllipseStyle(void 0),this._setEllipseStyle(void 0),this._setSpatialLineStyle(void 0),e&&e.iconType)switch(e.iconType){case $i.SketchIconType.Normal:this._sketchPointImage=this._iconNormal;break;case $i.SketchIconType.Blue:this._sketchPointImage=this._iconBlue;break;case $i.SketchIconType.Green:this._sketchPointImage=this._iconGreen;break;case $i.SketchIconType.Violet:this._sketchPointImage=this._iconViolet;break;default:this._sketchPointImage=this._iconNormal}else this._sketchPointImage=this._iconNormal}_arcToDegree(e){return e/Math.PI*180}_toColor(e,t,i,n){let r=new Cesium.Color(0,0,0,1);return"number"!=typeof e||"number"!=typeof t||"number"!=typeof i||"number"!=typeof n||e<0||e>255||t<0||t>255||i<0||i>255||n<0||n>1?r:new Cesium.Color(e/255,t/255,i/255,n)}_toColorFromArray(e){if(!e||void 0===e.length||0===e.length)return new Cesium.Color(1,1,1,1);let t=255,i=255,n=255,r=1;return 1===e.length?t=parseInt(e[0]):2===e.length?(t=parseInt(e[0]),i=parseInt(e[1])):3===e.length?(t=parseInt(e[0]),i=parseInt(e[1]),n=parseInt(e[2])):e.length>=4&&(t=parseInt(e[0]),i=parseInt(e[1]),n=parseInt(e[2]),r=parseFloat(e[3])),new Cesium.Color(t/255,i/255,n/255,r)}_updateScene(){this._viewer.scene.requestRender()}_getScreenClickPosition(e){let t,i=this._viewer.scene.camera.getPickRay(e),n=this._viewer.scene.globe.pick(i,this._viewer.scene);return Cesium.Ellipsoid.WGS84.cartesianToCartographic(n),Cesium.defined(n)&&(t={x:n.x,y:n.y,z:n.z}),t}_getScreenClickPositionAndHeight(e){var t=void 0,i=void 0,n=void 0,r=this._viewer.scene.camera.getPickRay(e),o=this._viewer.scene.globe.pick(r,this._viewer.scene),s=Cesium.Ellipsoid.WGS84.cartesianToCartographic(o);if(null==this._viewer.scene.pick(e))t=this._arcToDegree(s.longitude),i=this._arcToDegree(s.latitude),n=s.height;else{var a=this._viewer.scene.pickPosition(e);if(Cesium.defined(a)){s=Cesium.Cartographic.fromCartesian(a);t=this._arcToDegree(s.longitude),i=this._arcToDegree(s.latitude),n=s.height}}return{lng:t,lat:i,height:n}}_transfromFromScreenPoint(e){let t=this._getScreenClickPositionAndHeight(e);return{gLocation:t,sLocation:Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.height)}}_removeEntityByName(e){var t=this._entities;if(t&&t.values){for(var i=[],n=0;n0&&(i._sketchPoints.pop(),i._sketchOutputPoints.pop(),t.onUndo&&t.onUndo())})),this._registerLeftDoubleClickEvent(e,(function(e){i._clearEvent(),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints)}))},_sketchDrawPolyline(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createTempPolyline(),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&Cesium.defined(i._sketchTempPolyline)&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerRightClickEvent(e,(function(e){if(i._sketchTempPoints.length>2){if(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),i._isDrawPoint){let e=i._pointEntitys[i._pointEntitys.length-1];i._entities.remove(e),i._pointEntitys.pop()}t.onUndo&&t.onUndo()}})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<2?t.onError&&t.onError("点数少于两个,禁止结束绘制!"):(i._removeEntityByObject(i._sketchTempPolyline),i._createPolyline(),i._isRetainDrawPoint||i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))}))},_sketchDrawSpatialPolyline(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createTempSpatialPolyline(),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&Cesium.defined(i._sketchTempSpatialPolyline)&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<2?t.onError&&t.onError("绘制点少于2个,禁止结束绘制!"):(i._removeEntityByObject(i._sketchTempSpatialPolyline),i._createSpatialPolyline(),i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))})),this._registerRightClickEvent(e,(function(e){i._sketchTempPoints.length>2&&(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),t.onUndo&&t.onUndo())}))},_sketchDrawPolygon(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createTempPolygon(),i._createTempPolyline(),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&Cesium.defined(i._sketchTempPolygon)&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerRightClickEvent(e,(function(e){if(i._sketchTempPoints.length>2){if(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),i._isDrawPoint){let e=i._pointEntitys[i._pointEntitys.length-1];i._entities.remove(e),i._pointEntitys.pop()}t.onUndo&&t.onUndo()}})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<3?t.onError&&t.onError("点数少于3个,禁止结束绘制!"):(i._removeEntityByObject(i._sketchTempPolygon),i._removeEntityByObject(i._sketchTempPolyline),i._createPolygon(),i._isRetainDrawPoint||i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))}))},_sketchDrawCircle:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){if(0===i._sketchTempPoints.length){let e=i._transfromFromScreenPoint(n.position);if(!Cesium.defined(e.sLocation))return;i._isDrawPoint&&i._createPoint(e.sLocation,"起点"),i._sketchTempPoints.push(e.sLocation.clone()),i._sketchTempPoints.push(e.sLocation),i._sketchPoints.push(e.sLocation.clone()),i._sketchOutputPoints.push(e.gLocation),i._createTempCircle(e.sLocation),t.onAdded&&t.onAdded(e.sLocation)}else i._removePointEntitys(),i._removeEntityByObject(i._sketchTempCircle),i._createCircle(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchOutputPoints[0],i._sketchEllipseRadius)})),this._registerMouseMoveEvent(e,(function(e){if(Cesium.defined(i._sketchTempCircle)){var t=i._viewer.scene.pickPosition(e.endPosition);null!=t&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(t))}}))},_sketchDrawHeightPolyline:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){if(0===i._sketchTempPoints.length){let e=i._transfromFromScreenPoint(n.position);if(!Cesium.defined(e.sLocation))return;i._isDrawPoint&&i._createPoint(e.sLocation,"起点"),i._sketchAltitudeInitHeight=e.gLocation.height,i._sketchTempPoints.push(e.sLocation.clone()),i._sketchTempPoints.push(e.sLocation),i._sketchPoints.push(e.sLocation.clone()),t.onAdded&&t.onAdded(e.sLocation)}else i._removePointEntitys(),i._removeEntityByObject(i._sketchTempAltituePolyline),i._createAltitudePolyline(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchAltitudePolylinePostions,i._sketchEllipseCenterPosition)})),this._registerMouseMoveEvent(e,(function(e){if(null!=i._sketchTempPoints&&0!=i._sketchTempPoints.length){var n=i._viewer.scene.pickPosition(e.endPosition);null!=n&&i._sketchTempPoints.length>=2&&(Cesium.defined(i._sketchTempAltituePolyline)?(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n)):i._createTempAltitudePolyline(),t.onMoving&&t.onMoving(i._sketchAltitudePolylinePostions,i._sketchEllipseCenterPosition))}}))},_sketchDrawRectangle:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){if(0===i._sketchTempPoints.length){let e=i._transfromFromScreenPoint(n.position);if(!Cesium.defined(e.sLocation))return;i._isDrawPoint&&i._createPoint(e.sLocation,"起点"),i._sketchTempPoints.push(e.gLocation),i._sketchTempPoints.push(e.gLocation),i._sketchPoints.push(e.gLocation),i._createTempRectangle(),t.onAdded&&t.onAdded(e.sLocation)}else i._removePointEntitys(),i._removeEntityByObject(i._sketchTempRectangle),i._createRectangle(),e.destroy(),e=null,t.onComplete&&t.onComplete(i._sketchOutputPoints)})),this._registerMouseMoveEvent(e,(function(e){if(!Cesium.defined(i._sketchTempRectangle))return;let t=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(t.sLocation)&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(t.gLocation))}))},_sketchDrawTriangle:function(e,t){let i=this;e.setInputAction((function(e){if(Cesium.defined(i._sketchTempAltituePolyline))return;let t=i._transfromFromScreenPoint(e.position);Cesium.defined(t.sLocation)&&(0==i._sketchPoints.length?(i._createPoint(t.sLocation,"起点"),i._sketchTempPoints.push(t.sLocation.clone()),i._sketchTempPoints.push(t.sLocation),i._sketchPoints.push(t.sLocation),i._createTempPolyline()):1===i._sketchPoints.length&&(i._createPoint(t.sLocation,"高度起点"),i._entities.remove(i._sketchTempPolyline),i._sketchPoints.push(t.sLocation),i._createPolyline(),i._sketchTempPoints.push(t.sLocation.clone()),i._sketchPoints.push(t.sLocation),i._sketchAltitudeInitHeight=t.gLocation.height,i._createTempTriangleAltitudePolylineAndSpatialPolyline()))}),Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction((function(e){if(void 0!==i._sketchPoints&&0!==i._sketchPoints.length){var t=i._viewer.scene.pickPosition(e.endPosition);null!=t&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(t))}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction((function(n){i._sketchPoints.length<2?t.onError&&t.onError("绘制图形不完整,禁止结束绘制!"):(i._removePointEntitys(),i._removeEntityByObject(i._sketchTempTriangleAltitudePolyline),i._removeEntityByObject(i._sketchTempSpatialPolyline),i._createAltitudePolyline(),i._createTriangleSpatialPolyline(),e.destroy(),e=null,t.onComplete(i._sketchPoints,i._sketchTriangleSpatialPolylinePositions,i._sketchAltitudePolylinePostions,i._sketchEllipseCenterPosition))}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)},_sketchDrawPolygonBody(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createTempPolygon(),i._createTempPolyline(),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&Cesium.defined(i._sketchTempPolygon)&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerRightClickEvent(e,(function(e){i._sketchTempPoints.length>2&&(i._sketchPoints.pop(),i._sketchOutputPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),t.onUndo&&t.onUndo(i._sketchPoints))})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<3?t.onError&&t.onError("点数少于3个,禁止结束绘制!"):(i._removeEntityByObject(i._sketchTempPolygon),i._removeEntityByObject(i._sketchTempPolyline),i._createPolygonBody({height:30,color:[255,255,0,.9]}),i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))}))},_sketchDrawTriangleA:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){if(Cesium.defined(i._sketchTempAltituePolyline))return;let r=i._transfromFromScreenPoint(n.position);Cesium.defined(r.sLocation)&&(0==i._sketchPoints.length?(i._sketchTempPoints.push(r.sLocation.clone()),i._sketchTempPoints.push(r.sLocation),i._sketchPoints.push(r.sLocation),i._createTempSpatialTriangle()):i._sketchPoints.length>0&&(i._removePointEntitys(),i._removeEntityByObject(i._sketchTempSpatialTriangle),i._createSpatialTriangle(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchSpatialTrianglePositions)))})),this._registerMouseMoveEvent(e,(function(e){if(void 0!==i._sketchPoints&&0!==i._sketchPoints.length){var n=i._viewer.scene.pickPosition(e.endPosition);null!=n&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n),t.onMoving&&t.onMoving(n))}}))},sketchTools:function(e,t){let i=this;switch(this._clear(),i._sketchEventHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),e){case $i.SketchType.Point:i._sketchDrawPoint(i._sketchEventHandler,t);break;case $i.SketchType.Line:i._sketchDrawPolyline(i._sketchEventHandler,t);break;case $i.SketchType.Polygon:i._sketchDrawPolygon(i._sketchEventHandler,t);break;case $i.SketchType.Height:i._sketchDrawHeightPolyline(i._sketchEventHandler,t);break;case $i.SketchType.Spatial:i._sketchDrawSpatialPolyline(i._sketchEventHandler,t);break;case $i.SketchType.Circle:i._sketchDrawCircle(i._sketchEventHandler,t);break;case $i.SketchType.Rectangle:i._sketchDrawRectangle(i._sketchEventHandler,t);break;case $i.SketchType.Triangle:i._sketchDrawTriangleA(i._sketchEventHandler,t);break;case $i.SketchType.PolygonBody:i._sketchDrawPolygonBody(i._sketchEventHandler,t);break;case $i.SketchType.MultiplePoint:i._sketchDrawMultiplePoint(i._sketchEventHandler,t)}},sketchDrawFeacture:function(e,t,i){let n=this;if(void 0===e||void 0===e.length||e.length<2)i&&i.onError&&i.onError("输入的坐标集合异常!");else{this._sketchPoints=[];for(let t=0;t255)},_checkAlpha:function(e){if(null==e)return!1;if("number"!=typeof e)return!1;let t=parseFloat(e);return!(t<0||t>1)},_checkColorAndAlpha:function(e){let t;if(e&&void 0!==e.length&&0!==e.length)return 1===e.length&&this._checkColor(e[0])?t=[e[0],0,0,1]:2===e.length&&this._checkColor(e[0])&&this._checkColor(e[1])?t=[e[0],e[1],0,1]:3===e.length&&this._checkColor(e[0])&&this._checkColor(e[1])&&this._checkColor(e[2])?t=[e[0],e[1],e[2],1]:4===e.length&&this._checkColor(e[0])&&this._checkColor(e[1])&&this._checkColor(e[2])&&this._checkAlpha(e[3])&&(t=[e[0],e[1],e[2],e[3]]),t},sketchEditPickPolygonBody:function(e){let t=this._sketchPickPolygonBody;if(void 0===t)return void(e.onComplete&&e.onComplete("未拾取对象或拾取的对象不符合要求!"));let i=t._useGeometry.color,n=t._useGeometry.height;this._sketchPoints=t._useGeometry.cPoints,this._sketchOutputPoints=t._useGeometry.gPoints,e&&e.height&&"number"==typeof e.height&&(n=parseInt(e.height)),e&&e.color&&this._checkColorAndAlpha(e.color)&&(i=this._checkColorAndAlpha(e.color)),this._viewer.scene.primitives.remove(t),this._createPolygonBody({color:i,height:n}),e.onComplete&&e.onComplete(void 0)},sketchRemovePickPolygonBody:function(e){let t=this._sketchPickPolygonBody;void 0!==t?(this._viewer.scene.primitives.remove(t),e&&e(void 0)):e&&e("未拾取对象或拾取的对象不符合要求!")},sketchPick:function(e){let t=this,i=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);i.setInputAction((function(n){let r=t._viewer.scene.pick(n.position);r&&r.primitive&&null!=r.primitive._useGeometry?(t._sketchPickPolygonBody=r.primitive,e&&e({color:r.primitive._useGeometry.color,height:r.primitive._useGeometry.height})):(t._sketchPickPolygonBody=void 0,e&&e(void 0)),i.destroy(),i=null}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}),$i.SketchType=Object.freeze({Point:"point",MultiplePoint:"multiplePoint",Line:"line",Polygon:"polygon",Height:"height",Spatial:"spatial",Circle:"circle",Rectangle:"rectangle",Triangle:"triangle",PolygonBody:"polygonBody",DrawPoint:"drawPoint",DrawMultiplePoint:"drawMultiplePoint",DrawPolyline:"drawPolyline",DrawPolygon:"drawPolygon"}),$i.SketchIconType=Object.freeze({Normal:"normal",Blue:"blue",Green:"green",Violet:"violter"});class en{constructor(e,t){this._viewer=e,this._sketchViewModel=new $i(e,{iconType:$i.SketchIconType.Blue}),t&&t.isClear&&(this._isClear=t.isClear),this._init()}_init(){this._measureEntityName="MeasureEntity",this._entities=this._viewer.entities,this._measurePointImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0q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C",this._measureTempPoints=[]}_updateScene(){this._viewer.scene.requestRender()}_removeEntityByName(e){let t=this._entities;if(!t||!t.values)return;let i=[];for(let n=0;n左键双击结束绘制")},onComplete:function(t,i){e._initMousePointerStyle(),e._tooltipRemove()}})},measureSpatialLength:function(){let e=this;this._clear(this._isClear),this._setMousePointerStyle(),this._tooltipInit("点击开始测量"),this._tempEntitys=[],this._sketchViewModel.sketchTools($i.SketchType.Spatial,{onAdded:function(t,i){if(1===t.length)e._createPoint(t[0],"起点");else{let i=e._measureSpaceDistance(t);e._tempEntitys.push(e._createPoint(t[t.length-1],i))}},onUndo:function(){e._viewer.entities.remove(e._tempEntitys[e._tempEntitys.length-1]),e._tempEntitys.pop()},onMoving:function(t,i){e._tooltipSetText("右键单击回退
左键双击结束绘制")},onComplete:function(t,i){e._initMousePointerStyle(),e._tooltipRemove()}})},measureArea:function(){let e=this;this._clear(this._isClear),this._setMousePointerStyle(),this._tooltipInit("点击开始测量"),this._sketchViewModel.sketchTools($i.SketchType.Polygon,{onAdded:function(t,i){if(e._measureTempPoints.push(e._cartesianToGeography(t[t.length-1])),1===t.length)void 0===e._areaLabelEntity?(e._areaLabel="起点",e._areaLabelEntity=e._createPoint(t[0],new Cesium.CallbackProperty((function(){return e._areaLabel}),!1))):e._areaLabel="起点";else if(t.length>=3){let i=e._measureArea(e._measureTempPoints,t);e._areaLabel=i>1e5?(i/1e5).toFixed(2)+"km²":i.toFixed(2)+"m²"}},onUndo:function(){e._measureTempPoints.pop(),1===e._measureTempPoints.length&&(e._areaLabel="起点")},onMoving:function(t,i){e._tooltipSetText("右键单击回退
左键双击结束绘制")},onComplete:function(t,i){e._initMousePointerStyle(),e._tooltipRemove()}})},measureHeight:function(){let e=this;this._clear(this._isClear),this._setMousePointerStyle(),this._tooltipInit("点击开始测量"),this._sketchViewModel.sketchTools($i.SketchType.Height,{onAdded:function(t){e._tooltipSetText("再次单击结束测量")},onMoving:function(t,i){let n=e._calculatePolylineAltitudeHeight(t);e._altitudeLabelPosition=i,e._altitudeLabelText=n,void 0===e._altitudeDynamicLabel&&e._createAltitudeDynamicLabel()},onComplete:function(t,i){let n=e._calculatePolylineAltitudeHeight(t);e._entities.remove(e._altitudeDynamicLabel),e._createLabel(i,n),e._initMousePointerStyle(),e._tooltipRemove()}})},measureTriangle:function(){let e=this;this._clear(this._isClear),this._setMousePointerStyle(),this._tooltipInit("点击开始测量"),this._sketchViewModel.sketchTools($i.SketchType.Triangle,{onMoving:function(t){e._tooltipSetText("再次单击结束测量")},onComplete:function(t){e._initMousePointerStyle(),e._tooltipRemove();let i=[t[0],t[1]],n=e._measureSpaceDistance(i),r=[t[1],t[2]],o=e._measureSpaceDistance(r),s=[t[2],t[0]],a=e._calculatePolylineAltitudeHeight(s);e._createLabel(t[0],"斜距:"+n),e._createLabel(t[1],"平距:"+o),e._createLabel(t[2],"高度:"+a)}})}}),Object.assign(en.prototype,{queryByPolygon:function(e){let t=this;this._clear(this._isClear),this._setMousePointerStyle(),this._tooltipInit("点击开始绘制区域"),this._sketchViewModel.sketchTools($i.SketchType.Polygon,{onMoving:function(e,i){t._tooltipSetText("右键单击回退
左键双击结束绘制开始查询")},onComplete:function(i,n){let r;t._initMousePointerStyle(),t._tooltipRemove();for(let e=0;e左键双击结束绘制"),this._tempEntitys=[],this._sketchViewModel.sketchTools($i.SketchType.MultiplePoint,{onAdded:function(e,i){let n=i.lng.toFixed(6)+","+i.lat.toFixed(6);t._tempEntitys.push(t._createPoint(e,n))},onUndo:function(){t._viewer.entities.remove(t._tempEntitys[t._tempEntitys.length-1]),t._tempEntitys.pop()},onComplete:function(i,n){t._initMousePointerStyle(),t._tooltipRemove();let r=[];for(let e=0;e左键双击结束绘制开始查询")},onComplete:function(i,n){let r;t._initMousePointerStyle(),t._tooltipRemove();for(let e=0;e左键双击结束绘制")},onUndo:function(e){0===e.length?t._tooltipInit("点击开始绘制"):e.length<3?t._tooltipInit("右键单击回退"):t._tooltipInit("右键单击回退
左键双击结束绘制")},onComplete:function(i,n){t._initMousePointerStyle(),t._tooltipRemove(),e&&e()}})},drawPointFeacture:function(e,t){this._sketchViewModel.sketchDrawFeacture(e,$i.SketchType.DrawPoint,t)},drawMultiplePointFeacture:function(e,t){this._sketchViewModel.sketchDrawFeacture(e,$i.SketchType.DrawMultiplePoint,t)},drawPolylineFeacture:function(e,t){this._sketchViewModel.sketchDrawFeacture(e,$i.SketchType.DrawPolyline,t)},drawPolygonFeacture:function(e,t){this._sketchViewModel.sketchDrawFeacture(e,$i.SketchType.DrawPolygon,t)}}),Object.assign(en.prototype,{tooltipInit:function(e){this._tooltipInit(e)},tooltipRemove:function(){this._tooltipRemove()},tooltipSetText:function(e){this._tooltipSetText(e)}}),Object.assign(en.prototype,{pickPolygonBody:function(e){this._sketchViewModel.sketchPick((function(t){void 0===t?e&&e(void 0):e&&e({color:t.color,height:t.height})}))},setPolygonBody:function(e){this._sketchViewModel.sketchEditPickPolygonBody({color:e.color,height:e.height,onComplete:e.onComplete})},removePolygonBody:function(e){this._sketchViewModel.sketchRemovePickPolygonBody(e)}});class tn{constructor(e){this._viewer=e.viewer,this._definitionChanged=new Cesium.Event,this._color=void 0,this.color=e.color||Cesium.Color.BLUE,this.duration=e.duration||1e3,this.trailImage=e.trailImage,this._time=(new Date).getTime(),this._materialTypeName="jtWallMaterial",this._param={color:this.color._value.toCssColorString(),image:this.trailImage,duration:this.duration,count:0,direction:"",order:""},Cesium.Material._materialCache.addMaterial(this._materialTypeName,{fabric:{type:this._materialTypeName,uniforms:{time:-20,color:new Cesium.Color(1,0,0,.5),image:e.trailImage},source:this._getDirectionWallShader(e.param)},translucent:function(e){return!0}})}getType(e){return this._materialTypeName}getValue(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.BLUE,t.color),t.image=this.trailImage,this.duration&&(t.time=((new Date).getTime()-this._time)%this.duration/this.duration),this._viewer.scene.requestRender(),t}equals(e){return this===e||e instanceof tn&&Cesium.Property.equals(this._color,e._color)}_getDirectionWallShader(e){let t=Cesium.defaultValue(e,{}),i=void 0!==t.count&&"number"==typeof t.count&&t.count>0?t.count:1,n="horizontal"===t.direction?"horizontal":"vertical",r="+"===t.order?"+":"-";this._param.count=i,this._param.direction=n,this._param.order=r;let o="";return o+="czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n","vertical"===n?o+=" vec4 colorImage = texture2D(image, vec2(fract(float("+i+")*st.t "+r+" time), st.t));\n":"horizontal"===n&&(o+=" vec4 colorImage = texture2D(image, vec2(fract(float("+i+")*st.s "+r+" time), st.t));\n"),o+=" vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}",o}}Object.defineProperties(tn.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")});class nn{constructor(e){this._viewer=e.viewer,this._definitionChanged=new Cesium.Event,this._color=void 0,this.color=e.color||Cesium.Color.BLUE,this.count=e.count||1,this.duration=e.duration||1e3,this._time=(new Date).getTime(),this._materialTypeName="jtCircleMaterial",this._param={color:this.color._value.toCssColorString(),duration:this.duration,count:this.count},Cesium.Material._materialCache.addMaterial(this._materialTypeName,{fabric:{type:this._materialTypeName,uniforms:{time:0,color:new Cesium.Color(1,0,0,.5),count:1},source:this._getCircleMaterial()},translucent:function(e){return!0}})}_getCircleMaterial(){return"czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //着色器渲染停止,不在绘制内容 \n discard;\n }\n if (dis > 0.5)\n {\n //超出半径范围时,着色器渲染停止 \n discard;\n } else {\n //把半径分成count份,每两份之间的间隔距离 \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //循环,最多999个环 \n for (int i = 0; i <= 999; i++)\n {\n //判断是否属于数量内的环 \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n"}}Object.assign(nn.prototype,{getType:function(e){return this._materialTypeName},getValue:function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.BLUE,t.color),t.count=this.count,this.duration&&(t.time=((new Date).getTime()-this._time)%this.duration/this.duration),this._viewer.scene.requestRender(),t},equals:function(e){return this===e||e instanceof WallMaterialProperty&&Cesium.Property.equals(this._color,e._color)}}),Object.defineProperties(nn.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),Cesium.Entity.prototype.setEditType=function(e){this._editType=e},Cesium.Entity.prototype.getEditType=function(){return this._editType},Cesium.Entity.prototype.setEntityType=function(e){this._entityType=e},Cesium.Entity.prototype.getEntityType=function(e){return this._entityType},Cesium.Entity.prototype.setIsEdit=function(e){this._isEdit=e},Cesium.Entity.prototype.getIsEdit=function(){return this._isEdit},Cesium.Entity.prototype.setParams=function(e){this._params=e},Cesium.Entity.prototype.getParams=function(){return this._params},Cesium.Entity.prototype.bindEntity=function(e){this._bindEntity=e},Cesium.Entity.prototype.getBindEntity=function(){return this._bindEntity};class rn{constructor(e,t){this._viewer=e,this._init(t)}static initEditPropertyParams(){return{id:void 0,height:20,color:"rgba(255,0,255,0.8)",direction:"horizontal",order:"-",count:2,text:"",lineWidth:0,power:.25,outlineWidth:0,outlineColor:"rgba(255,0,255,0.8)"}}_init(e){if(this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._entities=this._viewer.entities,this._pointEntitys=[],this._sketchPointImage=void 0,this._iconNormal="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJ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HuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC",this._sketchEntityName="drawEditEntity",this._sketchTempPoints=[],this._sketchPoints=[],this._sketchOutputPoints=[],this._sketchWallHeights=[],this._drawEntity=void 0,this._lineLabel=void 0,this._polygonLabel=void 0,e&&e.isDrawPoint?this._isDrawPoint=e.isDrawPoint:this._isDrawPoint=!1,e&&e.isRetainDrawPoint?this._isRetainDrawPoint=e.isRetainDrawPoint:this._isRetainDrawPoint=!1,this._param={moveLineWidth:3,lineWidth:3,moveAltitudeLineWidth:2,altitudeLineWidth:2,spatialLineWidth:2,moveEllipseColor:[0,255,0,.5],moveEllipseOutline:!0,moveEllipseOutlineColor:[255,0,0,.5],moveEllipseOutlineWidth:1,spatialLineWidth:2,ellipseColor:[0,0,255,.5],ellipseOutline:!0,ellipseOutlineColor:[255,0,0,.5],ellipseOutlineWidth:1},this._setMoveLineStyle(void 0),this._setLineStyle(void 0),this._setMovePolygonStyle(void 0),this._setPolygonStyle(void 0),this._setMoveAltitudeLineStyle(void 0),this._setAltitudeLineStyle(void 0),this._setMoveEllipseStyle(void 0),this._setEllipseStyle(void 0),this._setSpatialLineStyle(void 0),e&&e.iconType)switch(e.iconType){case rn.IconType.Normal:this._sketchPointImage=this._iconNormal;break;case rn.IconType.Blue:this._sketchPointImage=this._iconBlue;break;case rn.IconType.Green:this._sketchPointImage=this._iconGreen;break;case rn.IconType.Violet:this._sketchPointImage=this._iconViolet;break;default:this._sketchPointImage=this._iconNormal}else this._sketchPointImage=this._iconNormal;this._defaultHeight=50}_arcToDegree(e){return e/Math.PI*180}_toColor(e,t,i,n){let r=new Cesium.Color(0,0,0,1);return"number"!=typeof e||"number"!=typeof t||"number"!=typeof i||"number"!=typeof n||e<0||e>255||t<0||t>255||i<0||i>255||n<0||n>1?r:new Cesium.Color(e/255,t/255,i/255,n)}_toColorFromArray(e){if(!e||void 0===e.length||0===e.length)return new Cesium.Color(1,1,1,1);let t=255,i=255,n=255,r=1;return 1===e.length?t=parseInt(e[0]):2===e.length?(t=parseInt(e[0]),i=parseInt(e[1])):3===e.length?(t=parseInt(e[0]),i=parseInt(e[1]),n=parseInt(e[2])):e.length>=4&&(t=parseInt(e[0]),i=parseInt(e[1]),n=parseInt(e[2]),r=parseFloat(e[3])),new Cesium.Color(t/255,i/255,n/255,r)}_updateScene(){this._viewer.scene.requestRender()}_getScreenClickPosition(e){let t,i=this._viewer.scene.camera.getPickRay(e),n=this._viewer.scene.globe.pick(i,this._viewer.scene);return Cesium.Ellipsoid.WGS84.cartesianToCartographic(n),Cesium.defined(n)&&(t={x:n.x,y:n.y,z:n.z}),t}_getScreenClickPositionAndHeight(e){var t=void 0,i=void 0,n=void 0,r=this._viewer.scene.camera.getPickRay(e),o=this._viewer.scene.globe.pick(r,this._viewer.scene),s=Cesium.Ellipsoid.WGS84.cartesianToCartographic(o);if(s=Cesium.Cartographic.fromCartesian(o),void 0===this._viewer.scene.pick(e)&&Cesium.defined(s))t=this._arcToDegree(s.longitude),i=this._arcToDegree(s.latitude),n=s.height;else{var a=this._viewer.scene.pickPosition(e);if(Cesium.defined(a)){s=Cesium.Cartographic.fromCartesian(a);Cesium.defined(s)&&(t=this._arcToDegree(s.longitude),i=this._arcToDegree(s.latitude),n=s.height)}}return{lng:t,lat:i,height:n}}_transfromFromScreenPoint(e){let t=this._getScreenClickPositionAndHeight(e);return null!=t.lng?{gLocation:t,sLocation:Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.height)}:{gLocation:void 0,sLocation:void 0}}_removeEntityByName(e){var t=this._entities;if(t&&t.values){for(var i=[],n=0;n=2&&(i._createVideoWall(),i._clearEvent(e))}}t.onComplete&&t.onComplete(r.sLocation,r.gLocation)}))},_sketchDrawMultiplePoint(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),i._sketchPoints.push(n.sLocation),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(n.sLocation,n.gLocation))})),this._registerRightClickEvent(e,(function(e){i._sketchPoints.length>0&&(i._sketchPoints.pop(),i._sketchOutputPoints.pop(),t.onUndo&&t.onUndo())})),this._registerLeftDoubleClickEvent(e,(function(e){i._clearEvent(),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints)}))},_sketchDrawPolyline(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createPolyline(t.polylineType),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&i._sketchTempPoints.length>1&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerRightClickEvent(e,(function(e){if(i._sketchTempPoints.length>2){if(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),i._isDrawPoint){let e=i._pointEntitys[i._pointEntitys.length-1];i._entities.remove(e),i._pointEntitys.pop()}t.onUndo&&t.onUndo()}})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<2?t.onError&&t.onError("点数少于两个,禁止结束绘制!"):(i._updatePolyline(t.isEdit),i._isRetainDrawPoint||i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))}))},_sketchDrawSpatialPolyline(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createSpatialPolyline(),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&i._sketchTempPoints.length>1&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<2?t.onError&&t.onError("绘制点少于2个,禁止结束绘制!"):(i._updateSpatialPolyline(t.isEdit),i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))})),this._registerRightClickEvent(e,(function(e){i._sketchTempPoints.length>2&&(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),t.onUndo&&t.onUndo())}))},_sketchDrawPolygon(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createPolygon(t.polygonType),i._sketchTempPoints.push(n.sLocation.clone())),i._sketchTempPoints.push(n.sLocation),i._sketchPoints.push(n.sLocation.clone()),i._sketchOutputPoints.push(n.gLocation),t.onAdded&&t.onAdded(i._sketchPoints,i._sketchOutputPoints))})),this._registerMouseMoveEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(n.sLocation)&&i._sketchTempPoints.length>1&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(n.sLocation),t.onMoving&&t.onMoving(n.sLocation))})),this._registerRightClickEvent(e,(function(e){if(i._sketchTempPoints.length>2){if(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),i._isDrawPoint){let e=i._pointEntitys[i._pointEntitys.length-1];i._entities.remove(e),i._pointEntitys.pop()}t.onUndo&&t.onUndo()}})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<3?t.onError&&t.onError("点数少于3个,禁止结束绘制!"):(i._updatePolygon(t.isEdit),i._isRetainDrawPoint||i._removePointEntitys(),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchPoints,i._sketchOutputPoints))}))},_sketchDrawCircle:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){if(0===i._sketchTempPoints.length){let e=i._transfromFromScreenPoint(n.position);if(!Cesium.defined(e.sLocation))return;i._isDrawPoint&&i._createPoint(e.sLocation,"起点"),i._sketchTempPoints.push(e.sLocation.clone()),i._sketchTempPoints.push(e.sLocation),i._sketchPoints.push(e.sLocation.clone()),i._sketchOutputPoints.push(e.gLocation),i._createCircle(e.sLocation,t.circleType),t.onAdded&&t.onAdded(e.sLocation)}else i._removePointEntitys(),i._removeEntityByObject(i._sketchTempCircle),i._updateCircle(t.isEdit),i._clearEvent(e),t.onComplete&&t.onComplete(i._sketchOutputPoints[0],i._sketchEllipseRadius)})),this._registerMouseMoveEvent(e,(function(e){if(!(i._sketchTempPoints.length<=0)){var t=i._viewer.scene.pickPosition(e.endPosition);null!=t&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(t))}}))},_sketchDrawRectangle:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){if(0===i._sketchTempPoints.length){let e=i._transfromFromScreenPoint(n.position);if(!Cesium.defined(e.sLocation))return;i._isDrawPoint&&i._createPoint(e.sLocation,"起点"),i._sketchTempPoints.push(e.sLocation),i._sketchTempPoints.push(e.sLocation),i._sketchPoints.push(e.gLocation),i._createRectangle(),t.onAdded&&t.onAdded(e.sLocation)}else i._removePointEntitys(),i._removeEntityByObject(i._sketchTempRectangle),i._updateRectangle(t.isEdit),e.destroy(),e=null,t.onComplete&&t.onComplete(i._sketchOutputPoints)})),this._registerMouseMoveEvent(e,(function(e){if(i._sketchTempPoints.length<1)return;let t=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(t.sLocation)&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(t.sLocation))}))},_sketchDrawWall:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(e){let n=i._transfromFromScreenPoint(e.position);Cesium.defined(n.sLocation)&&(i._isDrawPoint&&i._createPoint(n.sLocation,i._lineLabel),0===i._sketchTempPoints.length&&(i._createWall(t.wallType),i._sketchTempPoints.push(n.sLocation.clone()),i._sketchWallHeights.push(n.gLocation.height)),i._sketchTempPoints.push(n.sLocation),i._sketchWallHeights.push(n.gLocation.height),i._sketchPoints.push(n.sLocation.clone()))})),this._registerMouseMoveEvent(e,(function(e){let t=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(t.sLocation)&&i._sketchTempPoints.length>1&&(i._sketchTempPoints.pop(),i._sketchTempPoints.push(t.sLocation),i._sketchWallHeights.pop(),i._sketchWallHeights.push(t.gLocation.height))})),this._registerRightClickEvent(e,(function(e){if(i._sketchTempPoints.length>2&&(i._sketchPoints.pop(),i._sketchTempPoints.splice(i._sketchTempPoints.length-2,1),i._sketchWallHeights.splice(i._sketchWallHeights.length-2,1),i._isDrawPoint)){let e=i._pointEntitys[i._pointEntitys.length-1];i._entities.remove(e),i._pointEntitys.pop()}})),this._registerLeftDoubleClickEvent(e,(function(n){i._sketchPoints.length<2?t.onError&&t.onError("点数少于两个,禁止结束绘制!"):(i._updateWall(t.isEdit),i._isRetainDrawPoint||i._removePointEntitys(),i._clearEvent(e))}))},_sketchDrawVideoWall:function(e,t){let i=this;this._registerLeftClickEvent(e,(function(n){let r=i._transfromFromScreenPoint(n.position);Cesium.defined(r.sLocation)&&(i._isDrawPoint&&i._createPoint(r.sLocation,i._lineLabel),0===i._sketchOutputPoints.length?(i._sketchOutputPoints.push(r.gLocation),i._sketchOutputPoints.push(r.gLocation),i._createVideoWall()):(i._updateVideoWall(t.isEdit),i._clearEvent(e)))})),this._registerMouseMoveEvent(e,(function(e){let t=i._transfromFromScreenPoint(e.endPosition);Cesium.defined(t.sLocation)&&i._sketchOutputPoints.length>1&&(i._sketchOutputPoints.pop(),i._sketchOutputPoints.push(t.gLocation))}))},draw:function(e,t){let i=this;switch(this._clear(),i._drawEventHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),e){case rn.DrawType.Point:i._sketchDrawPoint(i._drawEventHandler,t);break;case rn.DrawType.Polyline:t.polylineType=rn.PolylineType.NormalPolyline,i._sketchDrawPolyline(i._drawEventHandler,t);break;case rn.DrawType.ArrowPolyline:t.polylineType=rn.PolylineType.ArrowsPolyline,i._sketchDrawPolyline(i._drawEventHandler,t);break;case rn.DrawType.DynamicPolyline:t.polylineType=rn.PolylineType.DynamicPolyline,i._sketchDrawPolyline(i._drawEventHandler,t);break;case rn.DrawType.GrowPolyline:t.polylineType=rn.PolylineType.GrowPolyline,i._sketchDrawPolyline(i._drawEventHandler,t);break;case rn.DrawType.OultliePolyline:t.polylineType=rn.PolylineType.OutlinePolyline,i._sketchDrawPolyline(i._drawEventHandler,t);break;case rn.DrawType.Polygon:t.polygonType=rn.PolygonType.NormalPolygon,i._sketchDrawPolygon(i._drawEventHandler,t);break;case rn.DrawType.SpatialLine:i._sketchDrawSpatialPolyline(i._drawEventHandler,t);break;case rn.DrawType.Circle:t.circleType=rn.CircleType.ColorCircle,i._sketchDrawCircle(i._drawEventHandler,t);break;case rn.DrawType.Rectangle:i._sketchDrawRectangle(i._drawEventHandler,t);break;case rn.DrawType.NormalWall:t.wallType=rn.WallType.ColorWall,i._sketchDrawWall(i._drawEventHandler,t);break;case rn.DrawType.DynamicWall:t.wallType=rn.WallType.DynamicWall,i._sketchDrawWall(i._drawEventHandler,t);break;case rn.DrawType.TextWall:t.wallType=rn.WallType.TextWall,i._sketchDrawWall(i._drawEventHandler,t);break;case rn.DrawType.DynamicCircle:t.circleType=rn.CircleType.DynamicCircle,i._sketchDrawCircle(i._drawEventHandler,t);break;case rn.DrawType.House:t.polygonType=rn.PolygonType.HousePolygon,i._sketchDrawPolygon(i._drawEventHandler,t);break;case rn.DrawType.VideoWall:i._sketchDrawVideoWall(i._drawEventHandler,t)}},Clear:function(){this._clear(!0),this._unActivateEdit(),this._removeCoorinateAxis()},sketchInit:function(){this._clear(!1)}}),Object.assign(rn.prototype,{_tooltipInit:function(e,t){this._tooltipId="tooltipSketchmodel";let i=document.getElementById(this._tooltipId);if(null===i){i=document.createElement("div"),i.id=this._tooltipId,document.body.appendChild(i);let e="";e+="top: 30px;",e+="left: 30px;",e+="position: absolute;",e+="display: flex;",e+="align-items: center;",e+="width: 12x0px;",e+="height: auto;",e+="background-color: rgba(0, 0, 0, 0.65);",e+="border-radius: 5px;",e+="color: rgb(255, 255, 255);",e+="font-size: 12px;",e+="font-family: 'Alimama_ShuHeiTi_Bold';",e+="padding: 8px;",e+="border:solid 1px rgb(255,0,0);",i.setAttribute("style",e)}null!=e&&(i.innerHTML=e),void 0===t?document.onmousemove=function(e){i.style.left=e.clientX+10+"px",i.style.top=e.clientY-i.offsetHeight/2+"px"}:(i.style.left=t.x+10+"px",i.style.top=t.y-i.offsetHeight/2+"px")},_tooltipRemove:function(){let e=document.getElementById(this._tooltipId);null!=e&&document.body.removeChild(e)},_tooltipSetText:function(e,t){let i=document.getElementById(this._tooltipId);null!=i&&(null!=e&&(i.innerHTML=e),null!=t&&(i.style.left=t.x+10+"px",i.style.top=t.y-i.offsetHeight/2+"px"))},_setMousePointerStyle:function(){document.querySelector("body").style.cursor="crosshair"},_setMouseDefaultStyle:function(){document.querySelector("body").style.cursor="default"}}),Object.assign(rn.prototype,{_createSingleCoordinateAxisArrow(e,t,i){let n=new Cesium.Entity({id:i,name:this._coordinateAxisEntityName,position:e[0],polyline:{positions:e,width:10,material:this._materialPolylineArrowProperty({color:t})}});return n.setEditType({type:rn.EditPointType.CoordinateAxis}),this._entities.add(n)},_getTranslatePostion:function(e,t){let i=Cesium.Transforms.eastNorthUpToFixedFrame(e),n=new Cesium.Matrix4;Cesium.Matrix4.setTranslation(Cesium.Matrix4.IDENTITY,t,n);let r=Cesium.Matrix4.multiply(i,n,i),o=new Cesium.Cartesian3(0,0,0);return Cesium.Matrix4.getTranslation(r,o),o},_createCoordinateAxis:function(e){this._removeCoorinateAxis();let t=this;this._coordinateAxisEntityId_x="coordinateAxisId_x",this._coordinateAxisEntityId_y="coordinateAxisId_y",this._coordinateAxisEntityId_z="coordinateAxisId_z",this._coordinateAxisEntityName="coordinateAxisEntity";let i=new Cesium.Cartesian3(150,0,0),n=this._getTranslatePostion(e,i);const r=[e,n];this._coordinateEntity_x=this._createSingleCoordinateAxisArrow(r,"rgba(0,255,0,1.0)",this._coordinateAxisEntityId_x),this._coordinateAxisBindEntity(this._coordinateEntity_x),i=new Cesium.Cartesian3(0,150,0),n=this._getTranslatePostion(e,i);const o=[e,n];this._coordinateEntity_y=this._createSingleCoordinateAxisArrow(o,"rgba(0,0,255,1.0)",this._coordinateAxisEntityId_y),this._coordinateAxisBindEntity(this._coordinateEntity_y),i=new Cesium.Cartesian3(0,0,150),n=this._getTranslatePostion(e,i);const s=[e,n];this._coordinateEntity_z=this._createSingleCoordinateAxisArrow(s,"rgba(255,0,0,1.0)",this._coordinateAxisEntityId_z),this._coordinateAxisBindEntity(this._coordinateEntity_z),this._eventCoorinateAxis=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._registerLeftDownEvent(this._eventCoorinateAxis,(function(e){t._coorinateAxisMouseDown(e)})),this._registerMouseMoveEvent(this._eventCoorinateAxis,(function(e){t._coorinateAxisMouseMove(e)})),this._registerLeftUpEvent(this._eventCoorinateAxis,(function(e){t._coorinateAxisMouseUp(e)})),this._registerRightClickEvent(this._eventCoorinateAxis,(function(e){t._removeCoorinateAxis()}))},_coordinateAxisBindEntity:function(e){if(void 0===this._editEntity)return;let t=this._editEntity.getEntityType();void 0!==t&&t===rn.DrawType.VideoWall&&e.bindEntity(this._editEntity)},_coorinateAxisMouseDown:function(e){let t=this,i=this._viewer.scene.pick(e.position);if(console.log("===Feature>>>",i),void 0!==i&&null!=i.id&&i.id instanceof Cesium.Entity){if(this._viewer.scene.screenSpaceCameraController.enableRotate=!1,i.id.getEditType().type!==rn.EditPointType.CoordinateAxis)return;this._editCoorinateAxis=i.id,this._editCoorinateAxis.polyline.width=15,this._coordinateAxisMoveStartPosition=this._viewer.scene.camera.pickEllipsoid(e.position,this._viewer.scene.globe.ellipsoid),this._coordinateAxisMoveStartScreen=e.position,this._coorinateAxisPosition=this._editCoorinateAxis.position._value,this._coordinateEntity_x.polyline.positions=new Cesium.CallbackProperty((function(){let e=new Cesium.Cartesian3(150,0,0),i=t._getTranslatePostion(t._coorinateAxisPosition,e);return[t._coorinateAxisPosition,i]}),!1),this._coordinateEntity_y.polyline.positions=new Cesium.CallbackProperty((function(){let e=new Cesium.Cartesian3(0,150,0),i=t._getTranslatePostion(t._coorinateAxisPosition,e);return[t._coorinateAxisPosition,i]}),!1),this._coordinateEntity_z.polyline.positions=new Cesium.CallbackProperty((function(){let e=new Cesium.Cartesian3(0,0,150),i=t._getTranslatePostion(t._coorinateAxisPosition,e);return[t._coorinateAxisPosition,i]}),!1),this._coordinateAxisActivateEditEntity(this._editCoorinateAxis)}},_coorinateAxisMouseMove:function(e){if(!Cesium.defined(this._editCoorinateAxis))return;let t=this._viewer.scene.camera.pickEllipsoid(e.endPosition,this._viewer.scene.globe.ellipsoid);if(!t)return;let i=this._cartesian3ToGeo(this._coordinateAxisMoveStartPosition),n=this._cartesian3ToGeo(t),r=this._editCoorinateAxis.id,o=this._editCoorinateAxis.position._value,s=this._cartesian3ToGeo(o),a=0;if(r===this._coordinateAxisEntityId_x){let e=i.longitude-n.longitude;s.longitude=s.longitude-e}else if(r===this._coordinateAxisEntityId_y){let e=i.latitude-n.latitude;s.latitude=s.latitude-e}else r===this._coordinateAxisEntityId_z&&(a=e.endPosition.y-this._coordinateAxisMoveStartScreen.y,a*=.5,s.height=s.height-a);this._coorinateAxisPosition=Cesium.Cartesian3.fromDegrees(s.longitude,s.latitude,s.height),this._moveEditEntityByCoordinateAxis(o,this._coorinateAxisPosition,a)},_coorinateAxisMouseUp:function(e){if(this._viewer.scene.screenSpaceCameraController.enableRotate=!0,void 0!==this._editCoorinateAxis){this._editCoorinateAxis.polyline.width=10;let e=new Cesium.Cartesian3(150,0,0),t=this._getTranslatePostion(this._coorinateAxisPosition,e);this._coordinateEntity_x.polyline.positions=[this._coorinateAxisPosition,t],e=new Cesium.Cartesian3(0,150,0),t=this._getTranslatePostion(this._coorinateAxisPosition,e),this._coordinateEntity_y.polyline.positions=[this._coorinateAxisPosition,t],e=new Cesium.Cartesian3(0,0,150),t=this._getTranslatePostion(this._coorinateAxisPosition,e),this._coordinateEntity_z.polyline.positions=[this._coorinateAxisPosition,t],this._coordinateEntity_x.position=this._coorinateAxisPosition,this._coordinateEntity_y.position=this._coorinateAxisPosition,this._coordinateEntity_z.position=this._coorinateAxisPosition,this._coordinateAxisUpdateEditEntity(this._editCoorinateAxis),this._editCoorinateAxis=void 0}},_moveEditEntityByCoordinateAxis:function(e,t,i){let n=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3);for(let r=0;r>>",this._editEntity),void 0===this._editEntity)return;let t=this._coordinateCalculateEntityOrientation(this._editEntity,e);console.log("===旋转>>>",t)},_getEntityEditData:function(e){if(e instanceof Cesium.Entity){let t=e.getEntityType();if(t===rn.DrawType.Polyline||t===rn.DrawType.SpatialLine)return e.polyline.positions._value;if(t===rn.DrawType.Polygon||t===rn.DrawType.House){let t=e.polygon.hierarchy._value.positions;return t[0].x!==t[t.length-1].x&&t.push(t[0].clone()),t}if(t===rn.DrawType.Rectangle){let t=e.rectangle.coordinates._value,i=Cesium.Rectangle.northwest(t);if(i.height<=0){let e=this._queryHeightFromGeo(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude));i.height=e}let n=Cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height),r=Cesium.Rectangle.southeast(t);if(r.height<=0){let e=this._queryHeightFromGeo(Cesium.Math.toDegrees(r.longitude),Cesium.Math.toDegrees(r.latitude));r.height=e}return[n,Cesium.Cartesian3.fromRadians(r.longitude,r.latitude,r.height)]}if(t===rn.DrawType.Circle||t===rn.DrawType.DynamicCircle){let t=e.position._value,i=e.ellipse.semiMajorAxis._value;return[t,this._calculateCircleBoundaryPoint(t,i)]}if(t===rn.DrawType.NormalWall||t===rn.DrawType.DynamicWall||t===rn.DrawType.TextWall){this._sketchWallHeights=[],this._sketchWallMaxHeights=[];let t=e.wall.minimumHeights._value,i=e.wall.maximumHeights._value;for(let e=0;e>>","该实体不可编辑");let n=this,r=this._getEntityEditData(e);if(this._removePointEntitys(),this._editEntity=e,t===rn.DrawType.Circle||t===rn.DrawType.DynamicCircle)this._createEditCenterPoint(r[0]),this._createEditNodePoint(r,1);else if(t===rn.DrawType.VideoWall){let e=r[0];this._removeCoorinateAxis(),this._createCoordinateAxis(e)}else{this._createEditNodePoint(r);let e=this._calculateCenterPosition(r);void 0!==e&&this._createEditCenterPoint(e)}t!==rn.DrawType.Rectangle&&t!==rn.DrawType.Circle&&t!==rn.DrawType.DynamicCircle&&t!==rn.DrawType.VideoWall&&(t===rn.DrawType.SpatialLine?this._createEditMiddlePoint(r,!0):this._createEditMiddlePoint(r)),void 0===this._sketchEditHandler&&(this._sketchEditHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas)),this._registerLeftDownEvent(this._sketchEditHandler,(function(e){let t=n._viewer.scene.pick(e.position);if(console.log("===选中的节点>>>",t),null!=t&&t.id instanceof Cesium.Entity){let i=t.id.getEditType();if(console.log("===>>>",i),void 0===i)return;n._viewer.scene.screenSpaceCameraController.enableRotate=!1;let r=t.id.position._value;if(n._editPointEntity=t.id,n._setMousePointerStyle(),i.type===rn.EditPointType.Node||i.type===rn.EditPointType.Middle?(n._entityCallbackPropertyByMouseDown(),n._removeEntityByObject(n._editPointEntity),null!=n._sketchEditEntitySpatialName&&n._removeEntityByName(n._sketchEditEntitySpatialName)):i.type===rn.EditPointType.Center&&n._entityCenterMouseDownEvent(),i.type===rn.EditPointType.Middle){let t=i.index;if(n._sketchEditPoints.splice(t,0,r),n._sketchEditIndex=t,null!=n._sketchWallHeights&&n._sketchWallHeights.length>0){let e=n._cartesian3ToGeo(r),i=n._queryHeightFromGeo(e.longitude,e.latitude);n._sketchWallHeights.splice(t,0,i);let o=n._sketchWallMaxHeights[0]-n._sketchWallHeights[0];n._sketchWallMaxHeights.splice(t,0,i+o)}n._tooltipInit("拖动中点,改变形状",e.position)}else i.type===rn.EditPointType.Node?(n._sketchEditIndex=i.index,n._tooltipInit("拖动节点,改变形状",e.position)):i.type===rn.EditPointType.Spatial?(n._sketchEditIndex=i.index,n._tooltipInit("拖动节点,改变高度",e.position)):i.type===rn.EditPointType.CoordinateAxis&&n._tooltipInit("拖动坐标轴,改变位置",e.position)}})),this._registerMouseMoveEvent(this._sketchEditHandler,(function(e){if(null!=n._editPointEntity){let t=n._transfromFromScreenPoint(e.endPosition);if(!Cesium.defined(t.sLocation))return;n._editPosition=t.sLocation;let i=n._editPointEntity.getEditType();if(i.type===rn.EditPointType.Node){n._sketchEditPoints[n._sketchEditIndex]=t.sLocation;let e=n._editEntity.getEntityType();e!=rn.DrawType.Rectangle&&e!=rn.DrawType.Circle&&e!=rn.DrawType.DynamicCircle&&(e!==rn.DrawType.Polygon&&e!==rn.DrawType.House||0!==n._sketchEditIndex?e!==rn.DrawType.NormalWall&&e!==rn.DrawType.DynamicWall&&e!==rn.DrawType.TextWall||(n._sketchWallHeights[n._sketchEditIndex]=t.gLocation.height):n._sketchEditPoints[n._sketchEditPoints.length-1]=t.sLocation,n._removeEntityByName(n._sketchEditEntityMiddleName),e===rn.DrawType.SpatialLine?n._createEditMiddlePoint(n._sketchEditPoints,!0):n._createEditMiddlePoint(n._sketchEditPoints))}else if(i.type===rn.EditPointType.Middle)n._sketchEditPoints[n._sketchEditIndex]=t.sLocation;else if(i.type===rn.EditPointType.Center)n._entityCenterMouseMoveEvent(e);else if(i.type===rn.EditPointType.Spatial){let t=n._viewer.scene.globe.ellipsoid,i=n._viewer.camera.pickEllipsoid(e.endPosition,t),r=n._sketchEditPoints[n._sketchEditIndex],o=i.z-r.z;if(o>0&&o<500)for(let e=0;e255)},_checkAlpha:function(e){if(null==e)return!1;if("number"!=typeof e)return!1;let t=parseFloat(e);return!(t<0||t>1)},_checkColorAndAlpha:function(e){let t;if(e&&void 0!==e.length&&0!==e.length)return 1===e.length&&this._checkColor(e[0])?t=[e[0],0,0,1]:2===e.length&&this._checkColor(e[0])&&this._checkColor(e[1])?t=[e[0],e[1],0,1]:3===e.length&&this._checkColor(e[0])&&this._checkColor(e[1])&&this._checkColor(e[2])?t=[e[0],e[1],e[2],1]:4===e.length&&this._checkColor(e[0])&&this._checkColor(e[1])&&this._checkColor(e[2])&&this._checkAlpha(e[3])&&(t=[e[0],e[1],e[2],e[3]]),t}}),rn.DrawType=Object.freeze({Point:"point",Polyline:"polyline",ArrowPolyline:"arrowPolyline",DynamicPolyline:"dynamicPolyline",GrowPolyline:"发光线",OultliePolyline:"outlinePolyline",Polygon:"polygon",SpatialLine:"spatialLine",Circle:"circle",DynamicCircle:"dynamicCircle",Rectangle:"rectangle",NormalWall:"normalWall",DynamicWall:"dynamicWall",House:"house",TextWall:"text",VideoWall:"videoWall"}),rn.IconType=Object.freeze({Normal:"normal",Blue:"blue",Green:"green",Violet:"violter"}),rn.EditPointType=Object.freeze({Node:"node",Middle:"middle",Center:"center",CoordinateAxis:"coordinateAxis"}),rn.WallType=Object.freeze({ColorWall:"colorWall",DynamicWall:"dynamicWall",TextWall:"textWall"}),rn.CircleType=Object.freeze({ColorCircle:"colorCircle",DynamicCircle:"dynamicCircle"}),rn.PolylineType=Object.freeze({NormalPolyline:"normalPolyline",ArrowsPolyline:"arrowsPolyline",DynamicPolyline:"dynamicPolyline",DottedPolyline:"dottedPolyline",GrowPolyline:"growPolyline",OutlinePolyline:"outlinePolyline"}),rn.PolygonType=Object.freeze({NormalPolygon:"normalPolygon",HousePolygon:"housePolygon"});var on={version:"1.0.0",PlotUtils:{}};on.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},on.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]=e[0]&&(i=Math.PI-n),i},on.PlotUtils.getAngleOfThreePoints=function(e,t,i){var n=on.PlotUtils.getAzimuth(t,e)-on.PlotUtils.getAzimuth(t,i);return 0>n?n+on.Constants.TWO_PI:n},on.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},on.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},on.PlotUtils.getCubicValue=function(e,t,i,n,r){var o=1-(e=Math.max(Math.min(e,1),0)),s=e*e,a=s*e,l=o*o,u=l*o;return[u*t[0]+3*l*e*i[0]+3*o*s*n[0]+a*r[0],u*t[1]+3*l*e*i[1]+3*o*s*n[1]+a*r[1]]},on.PlotUtils.getThirdPoint=function(e,t,i,n,r){var o=on.PlotUtils.getAzimuth(e,t),s=r?o+i:o-i,a=n*Math.cos(s),l=n*Math.sin(s);return[t[0]+a,t[1]+l]},on.PlotUtils.getArcPoints=function(e,t,i,n){var r,o,s=[],a=n-i;a=0>a?a+on.Constants.TWO_PI:a;for(var l=0;l<=on.Constants.FITTING_COUNT;l++){var u=i+a*l/on.Constants.FITTING_COUNT;r=e[0]+t*Math.cos(u),o=e[1]+t*Math.sin(u),s.push([r,o])}return s},on.PlotUtils.getBisectorNormals=function(e,t,i,n){var r=on.PlotUtils.getNormal(t,i,n),o=Math.sqrt(r[0]*r[0]+r[1]*r[1]),s=r[0]/o,a=r[1]/o,l=on.PlotUtils.distance(t,i),u=on.PlotUtils.distance(i,n);if(o>on.Constants.ZERO_TOLERANCE)if(on.PlotUtils.isClockWise(t,i,n)){var c=e*l,h=i[0]-c*a,d=i[1]+c*s,p=[h,d];c=e*u;var f=[h=i[0]+c*a,d=i[1]-c*s]}else c=e*l,p=[h=i[0]+c*a,d=i[1]-c*s],c=e*u,f=[h=i[0]-c*a,d=i[1]+c*s];else p=[h=i[0]+e*(t[0]-i[0]),d=i[1]+e*(t[1]-i[1])],f=[h=i[0]+e*(n[0]-i[0]),d=i[1]+e*(n[1]-i[1])];return[p,f]},on.PlotUtils.getNormal=function(e,t,i){var n=e[0]-t[0],r=e[1]-t[1],o=Math.sqrt(n*n+r*r);n/=o,r/=o;var s=i[0]-t[0],a=i[1]-t[1],l=Math.sqrt(s*s+a*a);return[n+(s/=l),r+(a/=l)]},on.PlotUtils.getCurvePoints=function(e,t){for(var i=[on.PlotUtils.getLeftMostControlPoint(t)],n=0;non.Constants.ZERO_TOLERANCE)var a=on.PlotUtils.mid(i,n),l=i[0]-a[0],u=i[1]-a[1],c=2/on.PlotUtils.distance(i,n),h=-c*u,d=c*l,p=h*h-d*d,f=2*h*d,m=d*d-h*h,g=o[0]-a[0],v=o[1]-a[1],y=a[0]+p*g+f*v,_=a[1]+f*g+m*v;else y=i[0]+t*(n[0]-i[0]),_=i[1]+t*(n[1]-i[1]);return[y,_]},on.PlotUtils.getRightMostControlPoint=function(e){var i=e.length,n=e[i-3],r=e[i-2],o=e[i-1],s=on.PlotUtils.getBisectorNormals(0,n,r,o)[1],a=on.PlotUtils.getNormal(n,r,o);if(Math.sqrt(a[0]*a[0]+a[1]*a[1])>on.Constants.ZERO_TOLERANCE)var l=on.PlotUtils.mid(r,o),u=o[0]-l[0],c=o[1]-l[1],h=2/on.PlotUtils.distance(r,o),d=-h*c,p=h*u,f=d*d-p*p,m=2*d*p,g=p*p-d*d,v=s[0]-l[0],y=s[1]-l[1],_=l[0]+f*v+m*y,b=l[1]+m*v+g*y;else _=o[0]+t*(r[0]-o[0]),b=o[1]+t*(r[1]-o[1]);return[_,b]},on.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,n=0;1>=n;n+=.01){for(var r=0,o=r=0,s=0;i>=s;s++){var a=on.PlotUtils.getBinomialFactor(i,s),l=Math.pow(n,s),u=Math.pow(1-n,i-s);o+=a*l*u*e[s][0],r+=a*l*u*e[s][1]}t.push([o,r])}return t.push(e[i]),t},on.PlotUtils.getBinomialFactor=function(e,t){return on.PlotUtils.getFactorial(e)/(on.PlotUtils.getFactorial(t)*on.PlotUtils.getFactorial(e-t))},on.PlotUtils.getFactorial=function(e){if(1>=e)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;e>=i;i++)t*=i;return t},on.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var n=0;i>=n;n++)for(var r=0;1>=r;r+=.05){for(var o=0,s=o=0,a=0;2>=a;a++){var l=on.PlotUtils.getQuadricBSplineFactor(a,r);s+=l*e[n+a][0],o+=l*e[n+a][1]}t.push([s,o])}return t.push(e[e.length-1]),t},on.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},on.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4};var sn={version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"},an="doublearrow",ln=.25,un=.3,cn=.85,hn=.15,dn={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},pn={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};sn.algorithm={},sn.algorithm.doubleArrow=function(e){this.connPoint=null,this.tempPoint4=null,this.points=e;var t={controlPoint:null,polygonalPoint:null};if(!(2>(a=e.length))){if(2==a)return e;var i,n,r=this.points[0],o=this.points[1],s=this.points[2],a=e.length;this.tempPoint4=3==a?sn.algorithm.getTempPoint4(r,o,s):this.points[3],this.connPoint=3==a||4==a?on.PlotUtils.mid(r,o):this.points[4],on.PlotUtils.isClockWise(r,o,s)?(i=sn.algorithm.getArrowPoints(r,this.connPoint,this.tempPoint4,!1),n=sn.algorithm.getArrowPoints(this.connPoint,o,s,!0)):(i=sn.algorithm.getArrowPoints(o,this.connPoint,s,!1),n=sn.algorithm.getArrowPoints(this.connPoint,r,this.tempPoint4,!0));var l=i.length,u=(l-5)/2,c=i.slice(0,u),h=i.slice(u,u+5),d=i.slice(u+5,l),p=n.slice(0,u),f=n.slice(u,u+5),m=n.slice(u+5,l);p=on.PlotUtils.getBezierPoints(p);var g=on.PlotUtils.getBezierPoints(m.concat(c.slice(1)));d=on.PlotUtils.getBezierPoints(d);var v=p.concat(f,g,h,d),y=sn.algorithm.array2Dto1D(v);t.controlPoint=[r,o,s,this.tempPoint4,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(y)}return t},sn.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null,this.tempPoint5=null,this.points=e;var t={controlPoint:null,polygonalPoint:null};if((i=e.length)>=2){if(2==i)return e;var i,n,r,o=this.points[0],s=this.points[1],a=this.points[2];3==(i=e.length)?(this.tempPoint4=sn.algorithm.getTempPoint4(o,s,a),this.tempPoint5=on.PlotUtils.mid(a,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=i<6?on.PlotUtils.mid(o,s):this.points[5],on.PlotUtils.isClockWise(o,s,a)?(n=sn.algorithm.getArrowPoints(o,this.connPoint,this.tempPoint4,!1),r=sn.algorithm.getArrowPoints(this.connPoint,s,a,!0)):(n=sn.algorithm.getArrowPoints(s,this.connPoint,a,!1),r=sn.algorithm.getArrowPoints(this.connPoint,o,this.tempPoint4,!0));var l=n.length,u=(l-5)/2,c=n.slice(0,u),h=n.slice(u,u+5),d=n.slice(u+5,l),p=r.slice(0,u),f=r.slice(u,u+5),m=r.slice(u+5,l);p=on.PlotUtils.getBezierPoints(p);var g=on.PlotUtils.getBezierPoints(m.concat(c.slice(1)));d=on.PlotUtils.getBezierPoints(d);var v=p.concat(f,g,h,d),y=sn.algorithm.array2Dto1D(v);t.controlPoint=[o,s,a,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(y)}return t},sn.algorithm.array2Dto1D=function(e){var t=[];return e.forEach((function(e){t.push(e[0]),t.push(e[1])})),t},sn.algorithm.getArrowPoints=function(e,t,i,n){this.type=an,this.headHeightFactor=ln,this.headWidthFactor=un,this.neckHeightFactor=cn,this.neckWidthFactor=hn;var r=on.PlotUtils.mid(e,t),o=on.PlotUtils.distance(r,i),s=on.PlotUtils.getThirdPoint(i,r,0,.3*o,!0),a=on.PlotUtils.getThirdPoint(i,r,0,.5*o,!0),l=[r,s=on.PlotUtils.getThirdPoint(r,s,on.Constants.HALF_PI,o/5,n),a=on.PlotUtils.getThirdPoint(r,a,on.Constants.HALF_PI,o/4,n),i],u=sn.algorithm.getArrowHeadPoints(l,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),c=u[0],h=u[4],d=on.PlotUtils.distance(e,t)/on.PlotUtils.getBaseLength(l)/2,p=sn.algorithm.getArrowBodyPoints(l,c,h,d),f=p.length,m=p.slice(0,f/2),g=p.slice(f/2,f);return m.push(c),g.push(h),(m=m.reverse()).push(t),(g=g.reverse()).push(e),m.reverse().concat(u,g)},sn.algorithm.getArrowHeadPoints=function(e,t,i){this.type=an,this.headHeightFactor=ln,this.headWidthFactor=un,this.neckHeightFactor=cn,this.neckWidthFactor=hn;var n=on.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],o=(on.PlotUtils.distance(t,i),n*this.headWidthFactor),s=n*this.neckWidthFactor,a=n*this.neckHeightFactor,l=on.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),u=on.PlotUtils.getThirdPoint(e[e.length-2],r,0,a,!0),c=on.PlotUtils.getThirdPoint(r,l,on.Constants.HALF_PI,o,!1),h=on.PlotUtils.getThirdPoint(r,l,on.Constants.HALF_PI,o,!0);return[on.PlotUtils.getThirdPoint(r,u,on.Constants.HALF_PI,s,!1),c,r,h,on.PlotUtils.getThirdPoint(r,u,on.Constants.HALF_PI,s,!0)]},sn.algorithm.getArrowBodyPoints=function(e,t,i,n){for(var r=on.PlotUtils.wholeDistance(e),o=on.PlotUtils.getBaseLength(e)*n,s=(o-on.PlotUtils.distance(t,i))/2,a=0,l=[],u=[],c=1;c=on.Constants.HALF_PI&&u=Math.PI&&u<1.5*Math.PI?(r=l*Math.sin(u-Math.PI),o=l*Math.cos(u-Math.PI),s=on.PlotUtils.getThirdPoint(e,a,on.Constants.HALF_PI,r,!0),n=on.PlotUtils.getThirdPoint(a,s,on.Constants.HALF_PI,o,!0)):(r=l*Math.sin(2*Math.PI-u),o=l*Math.cos(2*Math.PI-u),s=on.PlotUtils.getThirdPoint(e,a,on.Constants.HALF_PI,r,!0),n=on.PlotUtils.getThirdPoint(a,s,on.Constants.HALF_PI,o,!1)),n},sn.algorithm.tailedAttackArrow=function(e){e=sn.algorithm.dereplication(e),this.tailWidthFactor=dn.tailWidthFactor,this.swallowTailFactor=dn.swallowTailFactor,this.swallowTailPnt=dn.swallowTailPnt;var t={controlPoint:null,polygonalPoint:null};if(t.controlPoint=e,!(2>(f=e.length))){if(2==e.length)return t.polygonalPoint=e,t;var i=e,n=i[0],r=i[1];on.PlotUtils.isClockWise(i[0],i[1],i[2])&&(n=i[1],r=i[0]);var o=[on.PlotUtils.mid(n,r)].concat(i.slice(2)),s=sn.algorithm.getAttackArrowHeadPoints(o,n,r,dn),a=s[0],l=s[4],u=on.PlotUtils.distance(n,r),c=on.PlotUtils.getBaseLength(o),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=on.PlotUtils.getThirdPoint(o[1],o[0],0,h,!0);var d=u/c,p=sn.algorithm.getAttackArrowBodyPoints(o,a,l,d),f=p.length,m=[n].concat(p.slice(0,f/2));m.push(a);var g,v=[r].concat(p.slice(f/2,f));v.push(l),m=on.PlotUtils.getQBSplinePoints(m),v=on.PlotUtils.getQBSplinePoints(v),g=sn.algorithm.array2Dto1D(m.concat(s,v.reverse(),[this.swallowTailPnt,m[0]])),t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(g)}return t},sn.algorithm.getAttackArrowHeadPoints=function(e,t,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var r=on.PlotUtils.getBaseLength(e),o=r*this.headHeightFactor,s=e[e.length-1];r=on.PlotUtils.distance(s,e[e.length-2]);var a=on.PlotUtils.distance(t,i);o>a*this.headTailFactor&&(o=a*this.headTailFactor);var l=o*this.headWidthFactor,u=o*this.neckWidthFactor,c=(o=o>r?r:o)*this.neckHeightFactor,h=on.PlotUtils.getThirdPoint(e[e.length-2],s,0,o,!0),d=on.PlotUtils.getThirdPoint(e[e.length-2],s,0,c,!0),p=on.PlotUtils.getThirdPoint(s,h,on.Constants.HALF_PI,l,!1),f=on.PlotUtils.getThirdPoint(s,h,on.Constants.HALF_PI,l,!0);return[on.PlotUtils.getThirdPoint(s,d,on.Constants.HALF_PI,u,!1),p,s,f,on.PlotUtils.getThirdPoint(s,d,on.Constants.HALF_PI,u,!0)]},sn.algorithm.getAttackArrowBodyPoints=function(e,t,i,n){for(var r=on.PlotUtils.wholeDistance(e),o=on.PlotUtils.getBaseLength(e)*n,s=(o-on.PlotUtils.distance(t,i))/2,a=0,l=[],u=[],c=1;c=2&&(Cesium.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(i)):(e.positions.push(i),e.arrowEntity=e.showArrowOnMap(e.positions))))}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var e=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(t){var i=e.viewer.scene.pick(t.position);if(Cesium.defined(i)&&i.id?(e.clickStep++,i.id.objId||(e.selectPoint=i.id)):(e.modifyHandler.destroy(),e.modifyHandler=null,e.firstPoint.show=!1,e.floatPoint.show=!1,e.state=-1),2==e.clickStep){var n;if(e.clickStep=0,!(n=m.getCatesian3FromPX(e.viewer,t.position)))return;e.selectPoint&&(e.selectPoint.position.setValue(n),e.selectPoint=null)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(t){var i;e.selectPoint&&((i=m.getCatesian3FromPX(e.viewer,t.endPosition))&&(e.selectPoint.position.setValue(i),"firstPoint"==e.selectPoint.type&&(e.positions[1]=i),"floatPoint"==e.selectPoint.type&&(e.positions[2]=i)))}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i2?n.wz=e.positions.length-1:n.wz=e.positions.length,e.pointArr.push(n)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(t){var i;e.positions.length<2||(i=m.getCatesian3FromPX(e.viewer,t.endPosition))&&(e.floatPoint.position.setValue(i),e.positions.length>=2&&(Cesium.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(i)):(e.positions.push(i),e.arrowEntity=e.showArrowOnMap(e.positions),e.arrowEntity.objId=e.objId)))}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var i;if(i=m.getCatesian3FromPX(e.viewer,t.position)){for(var n=0;n4){(r=e.creatPoint(i)).wz=e.positions.length,e.pointArr.push(r);for(var n=0;n2?r.wz=e.positions.length-1:r.wz=e.positions.length,e.pointArr.push(r)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(t){var i;e.positions.length<2||(i=m.getCatesian3FromPX(e.viewer,t.endPosition))&&(e.floatPoint.position.setValue(i),e.positions.length>=2&&(Cesium.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(i)):(e.positions.push(i),e.arrowEntity=e.showArrowOnMap(e.positions),e.arrowEntity.objId=e.objId)))}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i{for(var i={straightArrowData:[],attackArrowData:[],pincerArrowData:[]},n=0;n0&&document.getElementsByClassName("MultiField-popup")[0].remove(),this.viewer=e,this.position=t,this.id="popup_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("MultiField-popup"),this.popupDiv.id=this.id,this.viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(i,n),this._render(this.position),this.eventListener=this.viewer.clock.onTick.addEventListener((e=>{this._render(this.position)})),document.getElementsByClassName("leaflet-popup-close-button")[0].onclick=()=>{this.close()}}_render(e){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e);null!=t&&(this.popupDiv.style.left=t.x-this.popupDiv.offsetWidth/2+"px",this.popupDiv.style.top=t.y-this.popupDiv.offsetHeight+40+"px"),this.viewer.camera.positionCartographic.height>2e5?this.popupDiv.style.display="none":this.popupDiv.style.display="block"}_createHtml(e,t){return'\n\t\t\t
\n\t\t\t\t'+e+'\n\t\t\t\t×\n\t\t\t
\n\t\t\t
\n\t\t\t\t\t'+this._createTable(t)+'\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t'}_createTable(e){let t='';for(let i in e)t+=`\n `;return t+="
${i}${e[i]}
",t}}Object.assign(yn.prototype,{close(){this.popupDiv.remove(),this.viewer.clock.onTick.removeEventListener(this.eventListener)}});var _n,bn="undefined"!=typeof window?window:void 0!==te?te:"undefined"!=typeof self?self:{},Cn=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:{}}),Tn=void 0!==te?te:"undefined"!=typeof window?window:{},wn=ne(Cn);"undefined"!=typeof document?_n=document:(_n=Tn["__GLOBAL_DOCUMENT_CACHE@4"])||(_n=Tn["__GLOBAL_DOCUMENT_CACHE@4"]=wn);var En=_n;function Sn(){return(Sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=400&&n.statusCode<=599){var o=r;if(t)if(Rn.TextDecoder){var s=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e}),"utf-8")}(n.headers&&n.headers["content-type"]);try{o=new TextDecoder(s).decode(r)}catch(a){}}else o=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:o})}else e(null,r)}},Un=bn,Bn=Dn.exports,Fn=On;Hn.httpHandler=Nn;function Wn(e,t,i){var n=e;return Fn(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=Bn({},t,{uri:e}),n.callback=i,n}function Hn(e,t,i){return Vn(t=Wn(e,t,i))}function Vn(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=l.response?l.response:l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(i){}return null}(l),m)try{e=JSON.parse(e)}catch(t){}return e}function r(e){return clearTimeout(u),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,g)}function o(){if(!a){var t;clearTimeout(u),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=g,o=null;return 0!==t?(r={body:n(),statusCode:t,method:h,headers:{},url:c,rawRequest:l},l.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t}(l.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),i(o,r,r.body)}}var s,a,l=e.xhr||null;l||(l=e.cors||e.useXDR?new Hn.XDomainRequest:new Hn.XMLHttpRequest);var u,c=l.url=e.uri||e.url,h=l.method=e.method||"GET",d=e.body||e.data,p=l.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:h,url:c,rawRequest:l};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),d=JSON.stringify(!0===e.json?d:e.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(o,0)},l.onload=o,l.onerror=r,l.onprogress=function(){},l.onabort=function(){a=!0},l.ontimeout=r,l.open(h,c,!f,e.username,e.password),f||(l.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(u=setTimeout((function(){if(!a){a=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),l.setRequestHeader)for(s in p)p.hasOwnProperty(s)&&l.setRequestHeader(s,p[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(d||null),l}Ln.exports=Hn,Ln.exports.default=Hn,Hn.XMLHttpRequest=Un.XMLHttpRequest||function(){},Hn.XDomainRequest="withCredentials"in new Hn.XMLHttpRequest?Hn.XMLHttpRequest:Un.XDomainRequest,function(e,t){for(var i=0;i59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function Qn(){this.values=qn(null)}function Kn(e,t,i,n){var r=n?e.split(n):[e];for(var o in r)if("string"==typeof r[o]){var s=r[o].split(i);if(2===s.length)t(s[0].trim(),s[1].trim())}}function Jn(e,t,i){var n=e;function r(){var t=Zn(e);if(null===t)throw new Xn(Xn.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function o(){e=e.replace(/^\s+/,"")}if(o(),t.startTime=r(),o(),"--\x3e"!==e.substr(0,3))throw new Xn(Xn.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),o(),t.endTime=r(),o(),function(e,t){var n=new Qn;Kn(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var o=t.split(","),s=o[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=t.split(","),n.percent(e,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(r){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(r){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(r){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}Xn.prototype=qn(Error.prototype),Xn.prototype.constructor=Xn,Xn.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Qn.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var $n=Yn.createElement&&Yn.createElement("textarea"),er={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},tr={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},ir={v:"title",lang:"lang"},nr={rt:"ruby"};function rr(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(t,i){var n=er[t];if(!n)return null;var r=e.document.createElement(n),o=ir[t];return o&&i&&(r[o]=i.trim()),r}for(var r,o,s,a,l=e.document.createElement("div"),u=l,c=[];null!==(r=i());)if("<"!==r[0])u.appendChild(e.document.createTextNode((o=r,$n.innerHTML=o,o=$n.textContent,$n.textContent="",o)));else{if("/"===r[1]){c.length&&c[c.length-1]===r.substr(2).replace(">","")&&(c.pop(),u=u.parentNode);continue}var h,d=Zn(r.substr(1,r.length-2));if(d){h=e.document.createProcessingInstruction("timestamp",d),u.appendChild(h);continue}var p=r.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(!(h=n(p[1],p[3])))continue;if(s=u,nr[(a=h).localName]&&nr[a.localName]!==s.localName)continue;if(p[2]){var f=p[2].split(".");f.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(tr.hasOwnProperty(i)){var n=t?"background-color":"color",r=tr[i];h.style[n]=r}})),h.className=f.join(" ")}c.push(p[1]),u.appendChild(h),u=h}return l}var or=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function sr(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function ar(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var o=i.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var o=0;o=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(c=c<0?-1:1,c*=Math.ceil(h/u)*u),s<0&&(c+=""===o.vertical?i.height:i.width,a=a.reverse()),r.move(d,c)}else{var p=r.lineHeight/i.height*100;switch(o.lineAlign){case"center":s-=p/2;break;case"end":s-=p}switch(o.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}a=["+y","-x","+x","-y"],r=new cr(t)}var f=function(e,t){for(var r,o=new cr(e),s=1,a=0;al&&(r=new cr(e),s=l),e=new cr(o)}return r||o}(r,a);t.move(f.toCSSCompatValues(i))}function dr(){}lr.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},lr.prototype.formatStyle=function(e,t){return 0===e?0:e+t},ur.prototype=qn(lr.prototype),ur.prototype.constructor=ur,cr.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},cr.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},cr.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},cr.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},cr.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},cr.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},cr.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},dr.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},dr.convertCueToDOMTree=function(e,t){return e&&t?rr(e,t):null};dr.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=gr(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=gr(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}vr.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var yr=vr,_r={"":!0,up:!0};function br(e){return"number"==typeof e&&e>=0&&e<=100}var Cr=function(){var e=100,t=3,i=0,n=100,r=0,o=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!br(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!br(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!br(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!br(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!br(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=function(e){return"string"==typeof e&&!!_r[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):s=t}}})},Tr=bn,wr=zn.exports={WebVTT:pr,VTTCue:yr,VTTRegion:Cr};Tr.vttjs=wr,Tr.WebVTT=wr.WebVTT;var Er=wr.VTTCue,Sr=wr.VTTRegion,kr=Tr.VTTCue,Pr=Tr.VTTRegion;wr.shim=function(){Tr.VTTCue=Er,Tr.VTTRegion=Sr},wr.restore=function(){Tr.VTTCue=kr,Tr.VTTRegion=Pr},Tr.VTTCue||wr.shim();var Ar=zn.exports;function xr(){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 Ir(e,t,i){return(Ir=xr()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&xn(r,i.prototype),r}).apply(null,arguments)}var Mr,Lr,Dr,Or,jr,Rr={exports:{}};Mr=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Lr=/^(?=([^\/?#]*))\1([^]*)$/,Dr=/(?:\/|^)\.(?=\/)/g,Or=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,Rr.exports=jr={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var n=jr.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=jr.normalizePath(n.path),jr.buildURLFromParts(n)}var r=jr.parseURL(t);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return i.alwaysNormalize?(r.path=jr.normalizePath(r.path),jr.buildURLFromParts(r)):t;var o=jr.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var s=Lr.exec(o.path);o.netLoc=s[1],o.path=s[2]}o.netLoc&&!o.path&&(o.path="/");var a={scheme:o.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(a.netLoc=o.netLoc,"/"!==r.path[0]))if(r.path){var l=o.path,u=l.substring(0,l.lastIndexOf("/")+1)+r.path;a.path=jr.normalizePath(u)}else a.path=o.path,r.params||(a.params=o.params,r.query||(a.query=o.query));return null===a.path&&(a.path=i.alwaysNormalize?jr.normalizePath(r.path):r.path),jr.buildURLFromParts(a)},parseURL:function(e){var t=Mr.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(Dr,"");e.length!==(e=e.replace(Or,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};var Nr=Rr.exports,Ur="http://example.com",Br=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=bn.location&&bn.location.href||"");var i="function"==typeof bn.URL,n=/^\/\//.test(e),r=!bn.location&&!/\/\//i.test(e);if(i?e=new bn.URL(e,bn.location||Ur):/\/\//i.test(e)||(e=Nr.buildAbsoluteURL(bn.location&&bn.location.href||"",e)),i){var o=new URL(t,e);return r?o.href.slice(Ur.length):n?o.href.slice(o.protocol.length):o.href}return Nr.buildAbsoluteURL(e,t)},Fr=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(Fr),zr=String.fromCharCode(9),Yr=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},qr=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},Xr=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}In(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var r=0;r0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Wr(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),n&&(i.key=n)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes?(s.attributes||(s.attributes={}),Sn(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(p={default:/yes/i.test(e.attributes.DEFAULT)}).default?p.autoselect=!0:p.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(p.language=e.attributes.LANGUAGE),e.attributes.URI&&(p.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(p.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(p.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(p.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=p}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,Qr.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=Zr(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;a=!0;var i=this.manifest.segments.length,n=Zr(e.attributes);s.parts=s.parts||[],s.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=d),d=n.byterange.offset+n.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+i,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,i){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=Zr(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Qr.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,i=Zr(e.attributes),n=i.type&&"PART"===i.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?d:0,n&&(d=i.byterange.offset+i.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),i.type)for(var o=0;ou&&(l-=u,l-=u,l-=fo(2))}return Number(l)},vo=function(e,t){var i=(void 0===t?{}:t).le,n=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0),e=fo(e);for(var r,o=(r=e,Math.ceil(function(e){return e.toString(2).length}(r)/8)),s=new Uint8Array(new ArrayBuffer(o)),a=0;a=t.length&&l.call(t,(function(t,i){return t===(a[i]?a[i]&e[o+i]:e[o+i])}))},bo={},Co={};function To(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var wo=To({HTML:"text/html",isHTML:function(e){return e===wo.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Eo=To({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Eo.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Co.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var n=0;n=0))throw new Ko(Zo,new Error(e.tagName+"@"+i));for(var r=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function ls(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(ls(e,t))return!0}while(e=e.nextSibling)}function us(){this.ownerDocument=this}function cs(e,t,i,n){e&&e._inc++,i.namespaceURI===Po.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function hs(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,o=0;r;)n[o++]=r,r=r.nextSibling;n.length=o,delete n[n.length]}}}function ds(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,hs(e.ownerDocument,e),t}function ps(e){return e&&e.nodeType===ss.DOCUMENT_TYPE_NODE}function fs(e){return e&&e.nodeType===ss.ELEMENT_NODE}function ms(e){return e&&e.nodeType===ss.TEXT_NODE}function gs(e,t){var i=e.childNodes||[];if(ko(i,fs)||ps(t))return!1;var n=ko(i,ps);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function vs(e,t){var i=e.childNodes||[];if(ko(i,(function(e){return fs(e)&&e!==t})))return!1;var n=ko(i,ps);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function ys(e,t,i){if(!function(e){return e&&(e.nodeType===ss.DOCUMENT_NODE||e.nodeType===ss.DOCUMENT_FRAGMENT_NODE||e.nodeType===ss.ELEMENT_NODE)}(e))throw new Ko(Xo,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new Ko(Zo,"child not in parent");if(!function(e){return e&&(fs(e)||ms(e)||ps(e)||e.nodeType===ss.DOCUMENT_FRAGMENT_NODE||e.nodeType===ss.COMMENT_NODE||e.nodeType===ss.PROCESSING_INSTRUCTION_NODE)}(t)||ps(t)&&e.nodeType!==ss.DOCUMENT_NODE)throw new Ko(Xo,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function _s(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===ss.DOCUMENT_FRAGMENT_NODE){var o=r.filter(fs);if(o.length>1||ko(r,ms))throw new Ko(Xo,"More than one element or text in fragment");if(1===o.length&&!gs(e,i))throw new Ko(Xo,"Element in fragment can not be inserted before doctype")}if(fs(t)&&!gs(e,i))throw new Ko(Xo,"Only one element can be added and only after doctype");if(ps(t)){if(ko(n,ps))throw new Ko(Xo,"Only one doctype is allowed");var s=ko(n,fs);if(i&&n.indexOf(s)1||ko(r,ms))throw new Ko(Xo,"More than one element or text in fragment");if(1===o.length&&!vs(e,i))throw new Ko(Xo,"Element in fragment can not be inserted before doctype")}if(fs(t)&&!vs(e,i))throw new Ko(Xo,"Only one element can be added and only after doctype");if(ps(t)){if(ko(n,(function(e){return ps(e)&&e!==i})))throw new Ko(Xo,"Only one doctype is allowed");var s=ko(n,fs);if(i&&n.indexOf(s)=0;d--){if(""===(p=r[d]).prefix&&p.namespace===e.namespaceURI){c=p.namespace;break}}if(c!==e.namespaceURI)for(d=r.length-1;d>=0;d--){var p;if((p=r[d]).namespace===e.namespaceURI){p.prefix&&(u=p.prefix+":"+l);break}}}t.push("<",u);for(var f=0;f"),i&&/^script$/i.test(l))for(;a;)a.data?t.push(a.data):Us(a,t,i,n,r.slice()),a=a.nextSibling;else for(;a;)Us(a,t,i,n,r.slice()),a=a.nextSibling;t.push("")}else t.push("/>");return;case Ho:case Go:for(a=e.firstChild;a;)Us(a,t,i,n,r.slice()),a=a.nextSibling;return;case jo:return Ns(t,e.name,e.value);case Ro:return t.push(e.data.replace(/[<&]/g,as).replace(/]]>/g,"]]>"));case No:return t.push("");case Wo:return t.push("\x3c!--",e.data,"--\x3e");case Vo:var y=e.publicId,_=e.systemId;if(t.push("");else if(_&&"."!=_)t.push(" SYSTEM ",_,">");else{var b=e.internalSubset;b&&t.push(" [",b,"]"),t.push(">")}return;case Fo:return t.push("");case Uo:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Bs(e,t,i){var n;switch(t.nodeType){case Oo:(n=t.cloneNode(!1)).ownerDocument=e;case Go:break;case jo:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var r=t.firstChild;r;)n.appendChild(Bs(e,r,i)),r=r.nextSibling;return n}function Fs(e,t,i){var n=new t.constructor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var o=t[r];"object"!=typeof o&&o!=n[r]&&(n[r]=o)}switch(t.childNodes&&(n.childNodes=new Jo),n.ownerDocument=e,n.nodeType){case Oo:var s=t.attributes,a=n.attributes=new ts,l=s.length;a._ownerElement=n;for(var u=0;u0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;t=t.nodeType==jo?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==jo?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},Mo(Do,ss),Mo(Do,ss.prototype),us.prototype={nodeName:"#document",nodeType:Ho,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==Go){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return Cs(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===Oo&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),ds(this,e)},replaceChild:function(e,t){Cs(this,e,t,bs),e.ownerDocument=this,t&&this.removeChild(t),fs(e)&&(this.documentElement=e)},importNode:function(e,t){return Bs(this,e,t)},getElementById:function(e){var t=null;return ls(this.documentElement,(function(i){if(i.nodeType==Oo&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=Io(e);return new $o(this,(function(i){var n=[];return t.length>0&&ls(i.documentElement,(function(r){if(r!==i&&r.nodeType===Oo){var o=r.getAttribute("class");if(o){var s=e===o;if(!s){var a=Io(o);s=t.every((l=a,function(e){return l&&-1!==l.indexOf(e)}))}s&&n.push(r)}}var l})),n}))},createElement:function(e){var t=new Ts;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new Jo,(t.attributes=new ts)._ownerElement=t,t},createDocumentFragment:function(){var e=new Ls;return e.ownerDocument=this,e.childNodes=new Jo,e},createTextNode:function(e){var t=new Ss;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ks;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Ps;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Ds;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new ws;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Ms;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Ts,n=t.split(":"),r=i.attributes=new ts;return i.childNodes=new Jo,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new ws,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},Lo(us,ss),Ts.prototype={nodeType:Oo,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===Go?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,hs(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new $o(this,(function(t){var i=[];return ls(t,(function(n){n===t||n.nodeType!=Oo||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new $o(this,(function(i){var n=[];return ls(i,(function(r){r===i||r.nodeType!==Oo||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},us.prototype.getElementsByTagName=Ts.prototype.getElementsByTagName,us.prototype.getElementsByTagNameNS=Ts.prototype.getElementsByTagNameNS,Lo(Ts,ss),ws.prototype.nodeType=jo,Lo(ws,ss),Es.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(qo[Xo])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},Lo(Es,ss),Ss.prototype={nodeName:"#text",nodeType:Ro,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Lo(Ss,Es),ks.prototype={nodeName:"#comment",nodeType:Wo},Lo(ks,Es),Ps.prototype={nodeName:"#cdata-section",nodeType:No},Lo(Ps,Es),As.prototype.nodeType=Vo,Lo(As,ss),xs.prototype.nodeType=zo,Lo(xs,ss),Is.prototype.nodeType=Bo,Lo(Is,ss),Ms.prototype.nodeType=Uo,Lo(Ms,ss),Ls.prototype.nodeName="#document-fragment",Ls.prototype.nodeType=Go,Lo(Ls,ss),Ds.prototype.nodeType=Fo,Lo(Ds,ss),Os.prototype.serializeToString=function(e,t,i){return js.call(e,t,i)},ss.prototype.toString=js;try{if(Object.defineProperty){let e=function(t){switch(t.nodeType){case Oo:case Go:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}};Object.defineProperty($o.prototype,"length",{get:function(){return es(this),this.$$length}}),Object.defineProperty(ss.prototype,"textContent",{get:function(){return e(this)},set:function(e){switch(this.nodeType){case Oo:case Go:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Ws=function(e,t,i){e["$$"+t]=i}}}catch($v){}bo.DocumentType=As,bo.DOMException=Ko,bo.DOMImplementation=os,bo.Element=Ts,bo.Node=ss,bo.NodeList=Jo,bo.XMLSerializer=Os;var Hs={},Vs={};!function(e){var t=Co.freeze;e.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),e.entityMap=e.HTML_ENTITIES}(Vs);var Gs={},zs=Co.NAMESPACE,Ys=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,qs=new RegExp("[\\-\\.0-9"+Ys.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Xs=new RegExp("^"+Ys.source+qs.source+"*(?::"+Ys.source+qs.source+"*)?$");function Zs(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Zs)}function Qs(){}function Ks(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function Js(e,t,i,n,r,o){function s(e,t,n){i.attributeNames.hasOwnProperty(e)&&o.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}for(var a,l=++t,u=0;;){var c=e.charAt(l);switch(c){case"=":if(1===u)a=e.slice(t,l),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(o.warning('attribute value must after "="'),a=e.slice(t,l)),t=l+1,!((l=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");s(a,h=e.slice(t,l).replace(/&#?\w+;/g,r),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');s(a,h=e.slice(t,l).replace(/&#?\w+;/g,r),t),o.warning('attribute "'+a+'" missed start quot('+c+")!!"),t=l+1,u=5}break;case"/":switch(u){case 0:i.setTagName(e.slice(t,l));case 5:case 6:case 7:u=7,i.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==u&&i.setTagName(e.slice(t,l)),l;case">":switch(u){case 0:i.setTagName(e.slice(t,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(h=e.slice(t,l)).slice(-1)&&(i.closed=!0,h=h.slice(0,-1));case 2:2===u&&(h=a),4==u?(o.warning('attribute "'+h+'" missed quot(")!'),s(a,h.replace(/&#?\w+;/g,r),t)):(zs.isHTML(n[""])&&h.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),s(h,h,t));break;case 3:throw new Error("attribute value missed!!")}return l;case"€":c=" ";default:if(c<=" ")switch(u){case 0:i.setTagName(e.slice(t,l)),u=6;break;case 1:a=e.slice(t,l),u=2;break;case 4:var h=e.slice(t,l).replace(/&#?\w+;/g,r);o.warning('attribute "'+h+'" missed quot(")!!'),s(a,h,t);case 5:u=6}else switch(u){case 2:i.tagName,zs.isHTML(n[""])&&a.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),s(a,a,t),t=l,u=1;break;case 5:o.warning('attribute space is required"'+a+'"!!');case 6:u=1,t=l;break;case 3:u=4,t=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function $s(e,t,i){for(var n=e.tagName,r=null,o=e.length;o--;){var s=e[o],a=s.qName,l=s.value;if((d=a.indexOf(":"))>0)var u=s.prefix=a.slice(0,d),c=a.slice(d+1),h="xmlns"===u&&c;else c=a,u=null,h="xmlns"===a&&"";s.localName=c,!1!==h&&(null==r&&(r={},ia(i,i={})),i[h]=r[h]=l,s.uri=zs.XMLNS,t.startPrefixMapping(h,l))}for(o=e.length;o--;){(u=(s=e[o]).prefix)&&("xml"===u&&(s.uri=zs.XML),"xmlns"!==u&&(s.uri=i[u||""]))}var d;(d=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,d),c=e.localName=n.slice(d+1)):(u=null,c=e.localName=n);var p=e.uri=i[u||""];if(t.startElement(p,c,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,c,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function ea(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var o=e.indexOf("",t),s=e.substring(t+1,o);if(/[&<]/.test(s))return/^script$/i.test(i)?(r.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,n),r.characters(s,0,s.length),o)}return t+1}function ta(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf(""))t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var o=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],l=!1,u=!1;s>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],u=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var c=o[s-1];return i.startDTD(a,l,u),i.endDTD(),c.index+c[0].length}}return-1}function ra(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function oa(){this.attributeNames={}}Zs.prototype=new Error,Zs.prototype.name=Zs.name,Qs.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),ia(t,t={}),function(e,t,i,n,r){function o(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?o(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function a(t){if(t>m){var i=e.substring(m,t).replace(/&#?\w+;/g,s);d&&l(m),n.characters(i,0,t-m),m=t}}function l(t,i){for(;t>=c&&(i=h.exec(e));)u=i.index,c=u+i[0].length,d.lineNumber++;d.columnNumber=t-u+1}var u=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,p=[{currentNSMap:t}],f={},m=0;for(;;){try{var g=e.indexOf("<",m);if(g<0){if(!e.substr(m).match(/^\s*$/)){var v=n.doc,y=v.createTextNode(e.substr(m));v.appendChild(y),n.currentElement=y}return}switch(g>m&&a(g),e.charAt(g+1)){case"/":var _=e.indexOf(">",g+3),b=e.substring(g+2,_).replace(/[ \t\n\r]+$/g,""),C=p.pop();_<0?(b=e.substring(g+2).replace(/[\s<].*/,""),r.error("end tag name: "+b+" is not complete:"+C.tagName),_=g+1+b.length):b.match(/\sm?m=_:a(Math.max(g,m)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},oa.prototype={setTagName:function(e){if(!Xs.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!Xs.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},Gs.XMLReader=Qs,Gs.ParseError=Zs;var sa=Co,aa=bo,la=Vs,ua=Gs,ca=aa.DOMImplementation,ha=sa.NAMESPACE,da=ua.ParseError,pa=ua.XMLReader;function fa(e){this.options=e||{locator:{}}}function ma(){this.cdata=!1}function ga(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function va(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function ya(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function _a(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}fa.prototype.parseFromString=function(e,t){var i=this.options,n=new pa,r=i.domBuilder||new ma,o=i.errorHandler,s=i.locator,a=i.xmlns||{},l=/\/x?html?$/.test(t),u=l?la.HTML_ENTITIES:la.XML_ENTITIES;return s&&r.setDocumentLocator(s),n.errorHandler=function(e,t,i){if(!e){if(t instanceof ma)return t;e=t}var n={},r=e instanceof Function;function o(t){var o=e[t];!o&&r&&(o=2==e.length?function(i){e(t,i)}:e),n[t]=o&&function(e){o("[xmldom "+t+"]\t"+e+va(i))}||function(){}}return i=i||{},o("warning"),o("error"),o("fatalError"),n}(o,r,s),n.domBuilder=i.domBuilder||r,l&&(a[""]=ha.HTML),a.xml=a.xml||ha.XML,e&&"string"==typeof e?n.parse(e,a,u):n.errorHandler.error("invalid doc source"),r.doc},ma.prototype={startDocument:function(){this.doc=(new ca).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,o=r.createElementNS(e,i||t),s=n.length;_a(this,o),this.currentElement=o,this.locator&&ga(this.locator,o);for(var a=0;at.timeline?1:-1}));var t,i},Wa=function(e){var t,i,n=[];return t=e,i=function(e,t,i,r){n=n.concat(e.playlists||[])},Ba.forEach((function(e){for(var n in t.mediaGroups[e])for(var r in t.mediaGroups[e][n]){var o=t.mediaGroups[e][n][r];i(o,e,n,r)}})),n},Ha=function(e){var t=e.playlist,i=e.mediaSequence;t.mediaSequence=i,t.segments.forEach((function(e,i){e.number=t.mediaSequence+i}))},Va=function(e){var t=e.oldManifest,i=e.newManifest,n=t.playlists.concat(Wa(t)),r=i.playlists.concat(Wa(i));return i.timelineStarts=Fa([t.timelineStarts,i.timelineStarts]),function(e){var t=e.oldPlaylists,i=e.newPlaylists,n=e.timelineStarts;i.forEach((function(e){e.discontinuitySequence=ka(n,(function(t){return t.timeline===e.timeline}));var i=function(e,t){for(var i=0;ii.timeline||i.segments.length&&e.timeline>i.segments[i.segments.length-1].timeline)&&e.discontinuitySequence--);i.segments[o].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),Ha({playlist:e,mediaSequence:i.segments[o].number})}}))}({oldPlaylists:n,newPlaylists:r,timelineStarts:i.timelineStarts}),i},Ga=function(e){return e&&e.uri+"-"+(t=e.byterange,i="bigint"==typeof t.offset||"bigint"==typeof t.length?bn.BigInt(t.offset)+bn.BigInt(t.length)-bn.BigInt(1):t.offset+t.length-1,t.offset+"-"+i);var t,i},za=function(e){return wa(e.reduce((function(e,t){var i=t.attributes.id+(t.attributes.lang||"");if(e[i]){var n;if(t.segments)t.segments[0]&&(t.segments[0].discontinuity=!0),(n=e[i].segments).push.apply(n,t.segments);t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)}else e[i]=t,e[i].attributes.timelineStarts=[];return e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{})).map((function(e){var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce((function(e,t,n){return t[i]&&e.push(n),e}),[])),e}))},Ya=function(e,t){var i=Ga(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&Ua(e,n,e.sidx.resolvedUri),e},qa=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=Ya(e[i],t);return e},Xa=function(e){var t,i=e.attributes,n=e.segments,r=e.sidx,o=e.discontinuityStarts,s={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:o,timelineStarts:i.timelineStarts,segments:n};return i.contentProtection&&(s.contentProtection=i.contentProtection),r&&(s.sidx=r),s},Za=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},Qa=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},Ka=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},Ja=function(e){return e?Object.keys(e).reduce((function(t,i){var n=e[i];return t.concat(n.playlists)}),[]):[]},$a=function(e){var t,i=e.dashPlaylists,n=e.locations,r=e.sidxMapping,o=void 0===r?{}:r,s=e.previousManifest;if(!i.length)return{};var a=i[0].attributes,l=a.sourceDuration,u=a.type,c=a.suggestedPresentationDelay,h=a.minimumUpdatePeriod,d=za(i.filter(Za)).map(Xa),p=za(i.filter(Qa)),f=za(i.filter(Ka)),m=i.map((function(e){return e.attributes.captionServices})).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:l,playlists:qa(d,o)};h>=0&&(g.minimumUpdatePeriod=1e3*h),n&&(g.locations=n),"dynamic"===u&&(g.suggestedPresentationDelay=c);var v,y,_=0===g.playlists.length,b=p.length?function(e,t,i){var n;void 0===t&&(t={}),void 0===i&&(i=!1);var r=e.reduce((function(e,r){var o=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",a=r.attributes.label||"main";if(s&&!r.attributes.label){var l=o?" ("+o+")":"";a=""+r.attributes.lang+l}e[a]||(e[a]={language:s,autoselect:!0,default:"main"===o,playlists:[],uri:""});var u=Ya(function(e,t){var i,n=e.attributes,r=e.segments,o=e.sidx,s=e.mediaSequence,a=e.discontinuitySequence,l=e.discontinuityStarts,u={attributes:(i={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuitySequence:a,discontinuityStarts:l,timelineStarts:n.timelineStarts,mediaSequence:s,segments:r};return n.contentProtection&&(u.contentProtection=n.contentProtection),o&&(u.sidx=o),t&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u}(r,i),t);return e[a].playlists.push(u),void 0===n&&"main"===o&&((n=r).default=!0),e}),{});return n||(r[Object.keys(r)[0]].default=!0),r}(p,o,_):null,C=f.length?function(e,t){return void 0===t&&(t={}),e.reduce((function(e,i){var n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(Ya(function(e){var t,i=e.attributes,n=e.segments,r=e.mediaSequence,o=e.discontinuityStarts,s=e.discontinuitySequence;void 0===n&&(n=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var a=((t={NAME:i.id,BANDWIDTH:i.bandwidth})["PROGRAM-ID"]=1,t);return i.codecs&&(a.CODECS=i.codecs),{attributes:a,uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:o,discontinuitySequence:s,mediaSequence:r,segments:n}}(i),t)),e}),{})}(f,o):null,T=d.concat(Ja(b),Ja(C)),w=T.map((function(e){return e.timelineStarts}));return g.timelineStarts=Fa(w),v=T,y=g.timelineStarts,v.forEach((function(e){e.mediaSequence=0,e.discontinuitySequence=ka(y,(function(t){return t.timeline===e.timeline})),e.segments&&e.segments.forEach((function(e,t){e.number=t}))})),b&&(g.mediaGroups.AUDIO.audio=b),C&&(g.mediaGroups.SUBTITLES.subs=C),m.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=m.reduce((function(e,t){return t?(t.forEach((function(t){var i=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e}),{})),s?Va({oldManifest:s,newManifest:g}):g},el=function(e,t,i){var n=e.NOW,r=e.clientOffset,o=e.availabilityStartTime,s=e.timescale,a=void 0===s?1:s,l=e.periodStart,u=void 0===l?0:l,c=e.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(o+u);return Math.ceil((h*a-t)/i)},tl=function(e,t){for(var i=e.type,n=e.minimumUpdatePeriod,r=void 0===n?0:n,o=e.media,s=void 0===o?"":o,a=e.sourceDuration,l=e.timescale,u=void 0===l?1:l,c=e.startNumber,h=void 0===c?1:c,d=e.periodStart,p=[],f=-1,m=0;mf&&(f=_);var b=void 0;if(y<0){var C=m+1;b=C===t.length?"dynamic"===i&&r>0&&s.indexOf("$Number$")>0?el(e,f,v):(a*u-f)/v:(t[C].t-f)/v}else b=y+1;for(var T=h+p.length+b,w=h+p.length;w=r?o:""+new Array(r-o.length+1).join("0")+o)}}(t))},rl=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,o=Da({baseUrl:e.baseUrl,source:nl(r.sourceURL,i),range:r.range});return function(e,t){return e.duration||t?e.duration?Ra(e):tl(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}(e,t).map((function(t){i.Number=t.number,i.Time=t.time;var n=nl(e.media||"",i),r=e.timescale||1,s=e.presentationTimeOffset||0,a=e.periodStart+(t.time-s)/r;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:Br(e.baseUrl||"",n),map:o,number:t.number,presentationTime:a}}))},ol=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n,o=e.periodStart;if(!i&&!t||i&&t)throw new Error(Ma);var s,a=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,o=Da({baseUrl:i,source:r.sourceURL,range:r.range}),s=Da({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=o,s}(e,t)}));return i&&(s=Ra(e)),t&&(s=tl(e,t)),s.map((function(t,i){if(a[i]){var n=a[i],r=e.timescale||1,s=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=o+(t.time-s)/r,n}})).filter((function(e){return e}))},sl=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=rl,t=Ta(n,r.template)):r.base?(i=Na,t=Ta(n,r.base)):r.list&&(i=ol,t=Ta(n,r.list));var o={attributes:n};if(!i)return o;var s=i(t,r.segmentTimeline);if(t.duration){var a=t,l=a.duration,u=a.timescale,c=void 0===u?1:u;t.duration=l/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return o.attributes=t,o.segments=s,r.base&&t.indexRange&&(o.sidx=s[0],o.segments=[]),o},al=function(e,t){return Sa(e.childNodes).filter((function(e){return e.tagName===t}))},ll=function(e){return e.textContent.trim()},ul=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(o||0)+3600*parseFloat(s||0)+60*parseFloat(a||0)+parseFloat(l||0)},cl={mediaPresentationDuration:function(e){return ul(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return ul(e)},suggestedPresentationDelay:function(e){return ul(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return ul(e)},start:function(e){return ul(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?ul(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},hl=function(e){return e&&e.attributes?Sa(e.attributes).reduce((function(e,t){var i=cl[t.name]||cl.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}},dl={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},pl=function(e,t){return t.length?Ea(e.map((function(e){return t.map((function(t){return Br(e,ll(t))}))}))):e},fl=function(e){var t=al(e,"SegmentTemplate")[0],i=al(e,"SegmentList")[0],n=i&&al(i,"SegmentURL").map((function(e){return Ta({tag:"SegmentURL"},hl(e))})),r=al(e,"SegmentBase")[0],o=i||t,s=o&&al(o,"SegmentTimeline")[0],a=i||r||t,l=a&&al(a,"Initialization")[0],u=t&&hl(t);u&&l?u.initialization=l&&hl(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});var c={template:u,segmentTimeline:s&&al(s,"S").map((function(e){return hl(e)})),list:i&&Ta(hl(i),{segmentUrls:n,initialization:hl(l)}),base:r&&Ta(hl(r),{initialization:hl(l)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},ml=function(e,t,i){return function(n){var r,o=hl(n),s=pl(t,al(n,"BaseURL")),a=al(n,"Role")[0],l={role:hl(a)},u=Ta(e,o,l),c=al(n,"Accessibility")[0],h="urn:scte:dash:cc:cea-608:2015"===(r=hl(c)).schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map((function(e){var t,i;if(i=e,/^CC\d=/.test(e)){var n=e.split("=");t=n[0],i=n[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:i}})):"urn:scte:dash:cc:cea-708:2015"===r.schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var i=e.split("="),n=i[0],r=i[1],o=void 0===r?"":r;t.channel=n,t.language=e,o.split(",").forEach((function(e){var i=e.split(":"),n=i[0],r=i[1];"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;h&&(u=Ta(u,{captionServices:h}));var d=al(n,"Label")[0];if(d&&d.childNodes.length){var p=d.childNodes[0].nodeValue.trim();u=Ta(u,{label:p})}var f=al(n,"ContentProtection").reduce((function(e,t){var i=hl(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());var n=dl[i.schemeIdUri];if(n){e[n]={attributes:i};var r=al(t,"cenc:pssh")[0];if(r){var o=ll(r);e[n].pssh=o&&Wr(o)}}return e}),{});Object.keys(f).length&&(u=Ta(u,{contentProtection:f}));var m=fl(n),g=al(n,"Representation"),v=Ta(i,m);return Ea(g.map(function(e,t,i){return function(n){var r=al(n,"BaseURL"),o=pl(t,r),s=Ta(e,hl(n)),a=fl(n);return o.map((function(e){return{segmentInfo:Ta(i,a),attributes:Ta(s,{baseUrl:e})}}))}}(u,s,v)))}},gl=function(e,t){return function(i,n){var r=pl(t,al(i.node,"BaseURL")),o=Ta(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(o.periodDuration=i.attributes.duration);var s=al(i.node,"AdaptationSet"),a=fl(i.node);return Ea(s.map(ml(o,r,a)))}},vl=function(e){if(""===e)throw new Error(Aa);var t,i,n=new ba;try{i=(t=n.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch($v){}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(xa);return i},yl=function(e,t){void 0===t&&(t={});var i=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,o=i.NOW,s=void 0===o?Date.now():o,a=i.clientOffset,l=void 0===a?0:a,u=al(e,"Period");if(!u.length)throw new Error(Pa);var c=al(e,"Location"),h=hl(e),d=pl([r],al(e,"BaseURL"));h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=s,h.clientOffset=l,c.length&&(h.locations=c.map(ll));var p=[];return u.forEach((function(e,t){var i=hl(e),n=p[t-1];i.start=function(e){var t=e.attributes,i=e.priorPeriodAttributes,n=e.mpdType;return"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==n?null:0}({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:h.type}),p.push({node:e,attributes:i})})),{locations:h.locations,representationInfo:Ea(p.map(gl(h,d)))}}(vl(e),t),n=i.representationInfo.map(sl);return $a({dashPlaylists:n,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},_l=function(e){return function(e){var t=al(e,"UTCTiming")[0];if(!t)return null;var i=hl(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(La)}return i}(vl(e))},bl=Math.pow(2,32),Cl=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))0;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i},wl=po([73,68,51]),El=function e(t,i){return void 0===i&&(i=0),(t=po(t)).length-i<10||!_o(t,wl,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=po(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?n+20:n+10}(t,i),e(t,i))},Sl=function(e){return"string"==typeof e?yo(e):e},kl=function e(t,i,n){void 0===n&&(n=!1),i=function(e){return Array.isArray(e)?e.map((function(e){return Sl(e)})):[Sl(e)]}(i),t=po(t);var r=[];if(!i.length)return r;for(var o=0;o>>0,a=t.subarray(o+4,o+8);if(0===s)break;var l=o+s;if(l>t.length){if(n)break;l=t.length}var u=t.subarray(o+8,l);_o(a,i[0])&&(1===i.length?r.push(u):r.push.apply(r,e(u,i.slice(1),n))),o=l}return r},Pl={EBML:po([26,69,223,163]),DocType:po([66,130]),Segment:po([24,83,128,103]),SegmentInfo:po([21,73,169,102]),Tracks:po([22,84,174,107]),Track:po([174]),TrackNumber:po([215]),DefaultDuration:po([35,227,131]),TrackEntry:po([174]),TrackType:po([131]),FlagDefault:po([136]),CodecID:po([134]),CodecPrivate:po([99,162]),VideoTrack:po([224]),AudioTrack:po([225]),Cluster:po([31,67,182,117]),Timestamp:po([231]),TimestampScale:po([42,215,177]),BlockGroup:po([160]),BlockDuration:po([155]),Block:po([161]),SimpleBlock:po([163])},Al=[128,64,32,16,8,4,2,1],xl=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i=i.length)return i.length;var r=xl(i,n,!1);if(_o(t.bytes,r.bytes))return n;var o=xl(i,n+r.length);return e(t,i,n+o.length+o.value+r.length)},Ll=function e(t,i){i=function(e){return Array.isArray(e)?e.map((function(e){return Il(e)})):[Il(e)]}(i),t=po(t);var n=[];if(!i.length)return n;for(var r=0;rt.length?t.length:a+s.value,u=t.subarray(a,l);_o(i[0],o.bytes)&&(1===i.length?n.push(u):n=n.concat(e(u,i.slice(1)))),r+=o.length+s.length+u.length}return n},Dl=po([0,0,0,1]),Ol=po([0,0,1]),jl=po([0,0,3]),Rl=function(e){for(var t=[],i=1;i>1&63),-1!==i.indexOf(l)&&(r=o+a),o+=a+("h264"===t?1:2)}else o++}return e.subarray(0,0)},Ul={webm:po([119,101,98,109]),matroska:po([109,97,116,114,111,115,107,97]),flac:po([102,76,97,67]),ogg:po([79,103,103,83]),ac3:po([11,119]),riff:po([82,73,70,70]),avi:po([65,86,73]),wav:po([87,65,86,69]),"3gp":po([102,116,121,112,51,103]),mp4:po([102,116,121,112]),fmp4:po([115,116,121,112]),mov:po([102,116,121,112,113,116]),moov:po([109,111,111,118]),moof:po([109,111,111,102])},Bl={aac:function(e){var t=El(e);return _o(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=El(e);return _o(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Ll(e,[Pl.EBML,Pl.DocType])[0];return _o(t,Ul.webm)},mkv:function(e){var t=Ll(e,[Pl.EBML,Pl.DocType])[0];return _o(t,Ul.matroska)},mp4:function(e){return!Bl["3gp"](e)&&!Bl.mov(e)&&(!(!_o(e,Ul.mp4,{offset:4})&&!_o(e,Ul.fmp4,{offset:4}))||(!(!_o(e,Ul.moof,{offset:4})&&!_o(e,Ul.moov,{offset:4}))||void 0))},mov:function(e){return _o(e,Ul.mov,{offset:4})},"3gp":function(e){return _o(e,Ul["3gp"],{offset:4})},ac3:function(e){var t=El(e);return _o(e,Ul.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */;nu0?a:0)}if(bn.console){var l=bn.console[i];l||"debug"!==i||(l=bn.console.info||bn.console.log),l&&o&&s.test(i)&&l[Array.isArray(r)?"apply":"call"](bn.console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return ou?[].concat(ou):[]}).filter=function(e){return(ou||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){ou&&(ou.length=0)},r.history.disable=function(){null!==ou&&(ou.length=0,ou=null)},r.history.enable=function(){null===ou&&(ou=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function Wu(){return En===bn.document}function Hu(e){return du(e)&&1===e.nodeType}function Vu(){try{return bn.parent!==bn.self}catch(e){return!0}}function Gu(e){return function(t,i){if(!Bu(t))return En[e](null);Bu(i)&&(i=En.querySelector(i));var n=Hu(i)?i:En;return n[e]&&n[e](t)}}function zu(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=En.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(su.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?Yu(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&hc(r,n),r}function Yu(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function qu(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Xu(e,t){return Fu(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function Zu(e,t){return e.classList?e.classList.add(t):Xu(e,t)||(e.className=(e.className+" "+t).trim()),e}function Qu(e,t){return e?(e.classList?e.classList.remove(t):(Fu(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):(su.warn("removeClass was called with an element that doesn't exist"),null)}function Ku(e,t,i){var n=Xu(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?Zu(e,t):Qu(e,t),e}function Ju(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function $u(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,n=i.length-1;n>=0;n--){var r=i[n].name,o=i[n].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(o=null!==o),t[r]=o}return t}function ec(e,t){return e.getAttribute(t)}function tc(e,t,i){e.setAttribute(t,i)}function ic(e,t){e.removeAttribute(t)}function nc(){En.body.focus(),En.onselectstart=function(){return!1}}function rc(){En.onselectstart=function(){return!0}}function oc(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(fu(e,"height"))),i.width||(i.width=parseFloat(fu(e,"width"))),i}}function sc(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==En[eu.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function ac(e,t){var i={x:0,y:0};if(Ru)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=fu(n,"transform");if(/^matrix/.test(r)){var o=r.slice(7,-1).split(/,\s/).map(Number);i.x+=o[4],i.y+=o[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13]}n=n.parentNode}var a={},l=sc(t.target),u=sc(e),c=u.width,h=u.height,d=t.offsetY-(u.top-l.top),p=t.offsetX-(u.left-l.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-u.left,d=t.changedTouches[0].pageY+u.top,Ru&&(p-=i.x,d-=i.y)),a.y=1-Math.max(0,Math.min(1,d/h)),a.x=Math.max(0,Math.min(1,p/c)),a}function lc(e){return du(e)&&3===e.nodeType}function uc(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function cc(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Hu(e)||lc(e)?e:"string"==typeof e&&/\S/.test(e)?En.createTextNode(e):void 0})).filter((function(e){return e}))}function hc(e,t){return cc(t).forEach((function(t){return e.appendChild(t)})),e}function dc(e,t){return hc(uc(e),t)}function pc(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}var fc,mc=Gu("querySelector"),gc=Gu("querySelectorAll"),vc=Object.freeze({__proto__:null,isReal:Wu,isEl:Hu,isInFrame:Vu,createEl:zu,textContent:Yu,prependTo:qu,hasClass:Xu,addClass:Zu,removeClass:Qu,toggleClass:Ku,setAttributes:Ju,getAttributes:$u,getAttribute:ec,setAttribute:tc,removeAttribute:ic,blockTextSelection:nc,unblockTextSelection:rc,getBoundingClientRect:oc,findPosition:sc,getPointerPosition:ac,isTextNode:lc,emptyEl:uc,normalizeContent:cc,appendContent:hc,insertContent:dc,isSingleLeftClick:pc,$:mc,$$:gc}),yc=!1,_c=function(){if(!1!==fc.options.autoSetup){var e=Array.prototype.slice.call(En.getElementsByTagName("video")),t=Array.prototype.slice.call(En.getElementsByTagName("audio")),i=Array.prototype.slice.call(En.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,o=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Oc(e,t,i){if(Ac.has(e)){var n=Ac.get(e);if(n.handlers){if(Array.isArray(t))return Ic(Oc,e,t,i);var r=function(e,t){n.handlers[t]=[],xc(e,t)};if(void 0!==t){var o=n.handlers[t];if(o)if(i){if(i.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),i=n)}},Vc=function(){};Vc.prototype.allowedEvents_={},Vc.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Dc(this,e,t),this.addEventListener=i},Vc.prototype.addEventListener=Vc.prototype.on,Vc.prototype.off=function(e,t){Oc(this,e,t)},Vc.prototype.removeEventListener=Vc.prototype.off,Vc.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Rc(this,e,t),this.addEventListener=i},Vc.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Nc(this,e,t),this.addEventListener=i},Vc.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Mc(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),jc(this,e)},Vc.prototype.dispatchEvent=Vc.prototype.trigger,Vc.prototype.queueTrigger=function(e){var t=this;Uc||(Uc=new Map);var i=e.type||e,n=Uc.get(this);n||(n=new Map,Uc.set(this,n));var r=n.get(i);n.delete(i),bn.clearTimeout(r);var o=bn.setTimeout((function(){0===n.size&&(n=null,Uc.delete(t)),t.trigger(e)}),0);n.set(i,o)};var Gc=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},zc=function(e){return e instanceof Vc||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},Yc=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},qc=function(e,t,i){if(!e||!e.nodeName&&!zc(e))throw new Error("Invalid target for "+Gc(t)+"#"+i+"; must be a DOM node or evented object.")},Xc=function(e,t,i){if(!Yc(e))throw new Error("Invalid event type for "+Gc(t)+"#"+i+"; must be a non-empty string or array.")},Zc=function(e,t,i){if("function"!=typeof e)throw new Error("Invalid listener for "+Gc(t)+"#"+i+"; must be a function.")},Qc=function(e,t,i){var n,r,o,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],o=t[1]):(n=t[0],r=t[1],o=t[2]),qc(n,e,i),Xc(r,e,i),Zc(o,e,i),{isTargetingSelf:s,target:n,type:r,listener:o=Wc(e,o)}},Kc=function(e,t,i,n){qc(e,e,t),e.nodeName?Bc[t](e,i,n):e[t](i,n)},Jc={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=rh(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return zu(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),o=r&&r[n],s=n&&n.split("-")[0],a=r&&r[s],l=i;return o&&o[e]?l=o[e]:a&&a[e]&&(l=a[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r}))),l},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[nh(e.name())]=null,this.childNameIndex_[ih(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,o=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||nh(t.name));return i&&!o.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var o=t.addChild(i,n);o&&(t[i]=o)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return mc(e,t||this.contentEl())},t.$$=function(e,t){return gc(e,t||this.contentEl())},t.hasClass=function(e){return Xu(this.el_,e)},t.addClass=function(e){Zu(this.el_,e)},t.removeClass=function(e){Qu(this.el_,e)},t.toggleClass=function(e,t){Ku(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return ec(this.el_,e)},t.setAttribute=function(e,t){tc(this.el_,e,t)},t.removeAttribute=function(e){ic(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+nh(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=fu(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+nh(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(Pn.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=bn.performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){(i=null,!0===e)&&(bn.performance.now()-t<200&&(n.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Wc(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=Wc(this,e),this.clearTimersOnDispose_(),i=bn.setTimeout((function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),bn.clearTimeout(e)),e},t.setInterval=function(e,t){e=Wc(this,e),this.clearTimersOnDispose_();var i=bn.setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),bn.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Wc(this,e),t=bn.requestAnimationFrame((function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=Wc(this,t);var n=this.requestAnimationFrame((function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),bn.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var i=t[0],n=t[1];e[i].forEach((function(t,i){return e[n](i)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),o=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(o||!s)throw n=o?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=nh(t),e.components_||(e.components_={});var a=e.getComponent("Player");if("Player"===t&&a&&a.players){var l=a.players,u=Object.keys(l);if(l&&u.length>0&&u.map((function(e){return l[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[ih(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function ch(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function hh(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ch.bind(null,"start",0,e),end:ch.bind(null,"end",1,e)},bn.Symbol&&bn.Symbol.iterator&&(t[bn.Symbol.iterator]=function(){return(e||[]).values()}),t}function dh(e,t){return Array.isArray(e)?hh(e):void 0===e||void 0===t?hh():hh([[e,t]])}function ph(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=dh(0,0));for(var o=0;ot&&(n=t),r+=n-i;return r/t}function fh(e){if(e instanceof fh)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:du(e)&&("number"==typeof e.code&&(this.code=e.code),hu(this,e)),this.message||(this.message=fh.defaultMessages[this.code]||"")}uh.prototype.supportsRaf_="function"==typeof bn.requestAnimationFrame&&"function"==typeof bn.cancelAnimationFrame,uh.registerComponent("Component",uh),fh.prototype.code=0,fh.prototype.message="",fh.prototype.status=null,fh.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],fh.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var mh=0;mh=0;n--)if(t[n].enabled){Eh(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}In(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&Eh(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,Eh(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(Th),kh=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){kh(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(An(i),"selectedIndex",{get:function(){for(var e=0;e0&&(bn.console&&bn.console.groupCollapsed&&bn.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return su.error(e)})),bn.console&&bn.console.groupEnd&&bn.console.groupEnd()),i.flush()},Hh=function(e,t){var i={uri:e},n=Bh(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),Gn(i,Wc(this,(function(e,i,n){if(e)return su.error(e,i);t.loaded_=!0,"function"!=typeof bn.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return Wh(n,t);su.error("vttjs failed to load, stopping trying to process "+t.src)})):Wh(n,t)})))},Vh=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=rh(t,{kind:Dh[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=Oh[n.mode]||"disabled",o=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new Ih(i.cues_),a=new Ih(i.activeCues_),l=!1;i.timeupdateHandler=Wc(An(i),(function(e){void 0===e&&(e={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}));return i.tech_.one("dispose",(function(){i.stopTracking()})),"disabled"!==r&&i.startTracking(),Object.defineProperties(An(i),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return r},set:function(e){Oh[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||Hh(this.src,this),this.stopTracking(),"disabled"!==r&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return a;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var o=0;o0)return void this.trigger("vttjsloaded");var t=En.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),bn.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var o=function(){return e.trigger("texttrackchange")},s=function(){o();for(var e=0;e=0;r--){var o=e[r];o[t]&&o[t](n,i)}}(e,i,a,s),a}var id={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},nd={setCurrentTime:1,setMuted:1,setVolume:1},rd={play:1,pause:1};function od(e){return function(t,i){return t===$h?$h:i[e]?i[e](t):t}}function sd(e,t,i,n,r,o){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===o&&(o=!1);var s=t,a=s[0],l=s.slice(1);if("string"==typeof a)sd(e,Kh[a],i,n,r,o);else if(a){var u=function(e,t){var i=Jh[e.id()],n=null;if(null==i)return n=t(e),Jh[e.id()]=[[t,n]],n;for(var r=0;r0;!this.player_.tech(!0)||(Iu||Pu)&&t||this.player_.tech(!0).focus(),this.player_.paused()?vh(this.player_.play()):this.player_.pause()}},t}(dd);uh.registerComponent("PosterImage",pd);var fd={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function md(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function gd(e,t,i){try{e.style[t]=i}catch($v){return}}var vd=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var o=function(e){return r.updateDisplay(e)};return t.on("loadstart",(function(e){return r.toggleDisplay(e)})),t.on("texttrackchange",o),t.on("loadedmetadata",(function(e){return r.preselectTrack(e)})),t.ready(Wc(An(r),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",o),t.on("playerresize",o),bn.addEventListener("orientationchange",o),t.on("dispose",(function(){return bn.removeEventListener("orientationchange",o)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i0;return vh(t),void(!this.player_.tech(!0)||(Iu||Pu)&&i||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var o=function(){return r.focus()};gh(t)?t.then(o,(function(){})):this.setTimeout(o,1)}else this.player_.tech(!0).focus()},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(_d);bd.prototype.controlText_="Play Video",uh.registerComponent("BigPlayButton",bd);var Cd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){Pn.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(_d);uh.registerComponent("CloseButton",Cd);var Td=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",(function(e){return n.handlePlay(e)})),n.on(t,"pause",(function(e){return n.handlePause(e)})),i.replay&&n.on(t,"ended",(function(e){return n.handleEnded(e)})),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?vh(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(_d);Td.prototype.controlText_="Play",uh.registerComponent("PlayToggle",Td);var wd=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),o=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||o>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)},Ed=wd;function Sd(e,t){return void 0===t&&(t=e),Ed(e,t)}var kd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],(function(e){return n.updateContent(e)})),n.updateTextNode_(),n}In(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=zu("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(n),this.contentEl_=zu("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Sd(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,su.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=En.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},i.updateContent=function(e){},t}(uh);kd.prototype.labelText_="Time",kd.prototype.controlText_="Time",uh.registerComponent("TimeDisplay",kd);var Pd=function(e){function t(){return e.apply(this,arguments)||this}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(kd);Pd.prototype.labelText_="Current Time",Pd.prototype.controlText_="Current Time",uh.registerComponent("CurrentTimeDisplay",Pd);var Ad=function(e){function t(t,i){var n,r=function(e){return n.updateContent(e)};return(n=e.call(this,t,i)||this).on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(kd);Ad.prototype.labelText_="Duration",Ad.prototype.controlText_="Duration",uh.registerComponent("DurationDisplay",Ad);var xd=function(e){function t(){return e.apply(this,arguments)||this}return In(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t},t}(uh);uh.registerComponent("TimeDivider",xd);var Id=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",(function(e){return n.updateContent(e)})),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(zu("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(kd);Id.prototype.labelText_="Remaining Time",Id.prototype.controlText_="Remaining Time",uh.registerComponent("RemainingTimeDisplay",Id);var Md=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",(function(e){return n.updateShowing(e)})),n}In(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=zu("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(zu("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(En.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(uh);uh.registerComponent("LiveDisplay",Md);var Ld=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}In(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=zu("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(_d);Ld.prototype.controlText_="Seek to live, currently playing live",uh.registerComponent("SeekToLive",Ld);var Dd=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},Od=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}In(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=hu({tabIndex:0},i),n=hu({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Au||e.preventDefault(),nc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;rc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"}))),t}},i.getProgress=function(){return Number(Dd(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=ac(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){Pn.isEventKey(t,"Left")||Pn.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):Pn.isEventKey(t,"Right")||Pn.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(uh);uh.registerComponent("Slider",Od);var jd=function(e,t){return Dd(e/t*100,0,100).toFixed(2)+"%"},Rd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",(function(e){return n.update(e)})),n}In(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=zu("span",{className:"vjs-control-text"}),n=zu("span",{textContent:this.localize("Loaded")}),r=En.createTextNode(": ");return this.percentageEl_=zu("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),o=t.partEls_,s=jd(r,n);t.percent_!==s&&(t.el_.style.width=s,Yu(t.percentageEl_,s),t.percent_=s);for(var a=0;ai.length;h--)t.el_.removeChild(o[h-1]);o.length=i.length}))},t}(uh);uh.registerComponent("LoadProgressBar",Rd);var Nd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Hc(Wc(An(n),n.update),Fc),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=sc(this.el_),r=oc(this.player_.el()),o=e.width*t;if(r&&n){var s=e.left-r.left+o,a=e.width-o+(r.right-e.right),l=n.width/2;sn.width&&(l=n.width),l=Math.round(l),this.el_.style.right="-"+l+"px",this.write(i)}},i.write=function(e){Yu(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var o,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var a=r.player_.liveTracker.liveWindow(),l=a-t*a;o=(l<1?"":"-")+Sd(l,a)}else o=Sd(i,s);r.update(e,t,o),n&&n()}))},t}(uh);uh.registerComponent("TimeTooltip",Nd);var Ud=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Hc(Wc(An(n),n.update),Fc),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(uh);Ud.prototype.options_={children:[]},Ru||wu||Ud.prototype.options_.children.push("timeTooltip"),uh.registerComponent("PlayProgressBar",Ud);var Bd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Hc(Wc(An(n),n.update),Fc),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},t}(uh);Bd.prototype.options_={children:["timeTooltip"]},uh.registerComponent("MouseTimeDisplay",Bd);var Fd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}In(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=Wc(this,this.update),this.update=Hc(this.update_,Fc),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in En&&"visibilityState"in En&&this.on(En,"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===En.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Fc))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==En.visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Sd(e,r),Sd(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(oc(i.el()),i.getProgress())})),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){pc(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),pc(e)){var i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99)return void r.seekToLiveEdge();var o=r.seekableStart(),s=r.liveCurrentTime();if((i=o+n*r.liveWindow())>=s&&(i=s),i<=o&&(i=o+.1),i===1/0)return}else(i=n*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?vh(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(Pn.isEventKey(t,"Space")||Pn.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(Pn.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(Pn.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Pn(t))){t.preventDefault(),t.stopPropagation();var n=10*(Pn.codes[Pn(t)]-Pn.codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else Pn.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):Pn.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in En&&"visibilityState"in En&&this.off(En,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(Od);Fd.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Ru||wu||Fd.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),uh.registerComponent("SeekBar",Fd);var Wd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=Hc(Wc(An(n),n.handleMouseMove),Fc),n.throttledHandleMouseSeek=Hc(Wc(An(n),n.handleMouseSeek),Fc),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),o=sc(r),s=ac(r,e).x;s=Dd(s,0,1),n&&n.update(o,s),i&&i.update(o,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&vh(this.player_.play())}},i.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(uh);Wd.prototype.options_={children:["seekBar"]},uh.registerComponent("ProgressControl",Wd);var Hd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return n.handlePictureInPictureChange(e)})),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return n.handlePictureInPictureEnabledChange(e)})),n.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),n.hide()):n.show()})),n.disable(),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){En.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(_d);Hd.prototype.controlText_="Picture-in-Picture",uh.registerComponent("PictureInPictureToggle",Hd);var Vd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",(function(e){return n.handleFullscreenChange(e)})),!1===En[t.fsApi_.fullscreenEnabled]&&n.disable(),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(_d);Vd.prototype.controlText_="Fullscreen",uh.registerComponent("FullscreenToggle",Vd);var Gd=function(e){function t(){return e.apply(this,arguments)||this}return In(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(uh);uh.registerComponent("VolumeLevel",Gd);var zd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Hc(Wc(An(n),n.update),Fc),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=oc(this.el_),o=oc(this.player_.el()),s=e.width*t;if(!o||!r)return;var a=e.left-o.left+s,l=e.width-s+(o.right-e.right),u=r.width/2;ar.width&&(u=r.width),this.el_.style.right="-"+u+"px"}this.write(n+"%")},i.write=function(e){Yu(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var o=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){o.update(e,t,i,n.toFixed(0)),r&&r()}))},t}(uh);uh.registerComponent("VolumeLevelTooltip",zd);var Yd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Hc(Wc(An(n),n.update),Fc),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,(function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"}))},t}(uh);Yd.prototype.options_={children:["volumeLevelTooltip"]},uh.registerComponent("MouseVolumeLevelDisplay",Yd);var qd=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",(function(e){return n.updateLastVolume_(e)})),n.on(t,"volumechange",(function(e){return n.updateARIAAttributes(e)})),t.ready((function(){return n.updateARIAAttributes()})),n}In(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){pc(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=oc(i),r=this.vertical(),o=ac(i,e);o=r?o.y:o.x,o=Dd(o,0,1),t.update(n,o,r)}pc(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(Od);qd.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Ru||wu||qd.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),qd.prototype.playerEvent="volumechange",uh.registerComponent("VolumeBar",qd);var Xd=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||pu(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(An(n=e.call(this,t,i)||this),t),n.throttledHandleMouseMove=Hc(Wc(An(n),n.handleMouseMove),Fc),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",(function(e){return n.handleMouseDown(e)})),n.on("touchstart",(function(e){return n.handleMouseDown(e)})),n.on("mousemove",(function(e){return n.handleMouseMove(e)})),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}In(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(uh);Xd.prototype.options_={children:["volumeBar"]},uh.registerComponent("VolumeControl",Xd);var Zd=function(e){function t(t,i){var n;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(An(n=e.call(this,t,i)||this),t),n.on(t,["loadstart","volumechange"],(function(e){return n.update(e)})),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;Ru&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)Qu(this.el_,"vjs-vol-"+i);Zu(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(_d);Zd.prototype.controlText_="Mute",uh.registerComponent("MuteToggle",Zd);var Qd=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||pu(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],(function(e){return n.volumePanelState_(e)})),n.on(n.muteToggle,"keyup",(function(e){return n.handleKeyPress(e)})),n.on(n.volumeControl,"keyup",(function(e){return n.handleVolumeControlKeyUp(e)})),n.on("keydown",(function(e){return n.handleKeyPress(e)})),n.on("mouseover",(function(e){return n.handleMouseOver(e)})),n.on("mouseout",(function(e){return n.handleMouseOut(e)})),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}In(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){Pn.isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),Dc(En,"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),Oc(En,"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){Pn.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(uh);Qd.prototype.options_={children:["muteToggle","volumeControl"]},uh.registerComponent("VolumePanel",Qd);var Kd=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",(function(e){return n.handleKeyDown(e)})),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}In(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof uh&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof uh&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=zu(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Dc(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||En.activeElement;if(!this.children().some((function(e){return e.el()===t}))){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter((function(t){return t.el()===e.target}))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}},i.handleKeyDown=function(e){Pn.isEventKey(e,"Left")||Pn.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Pn.isEventKey(e,"Right")||Pn.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(uh);uh.registerComponent("Menu",Kd);var Jd=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new _d(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=_d.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var o=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",o),n.on(n.menuButton_,"click",o),n.on(n.menuButton_,"keydown",(function(e){return n.handleKeyDown(e)})),n.on(n.menuButton_,"mouseenter",(function(){n.addClass("vjs-hover"),n.menu.show(),Dc(En,"keyup",n.handleMenuKeyUp_)})),n.on("mouseleave",(function(e){return n.handleMouseLeave(e)})),n.on("keydown",(function(e){return n.handleSubmenuKeyDown(e)})),n}In(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},i.createMenu=function(){var e=new Kd(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=zu("li",{className:"vjs-menu-title",textContent:nh(this.options_.title),tabIndex:-1}),i=new uh(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===o.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===o.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(ip);uh.registerComponent("OffTextTrackMenuItem",np);var rp=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return In(t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=ip),this.label_&&(i=this.label_+" off"),e.push(new np(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+o.kind+"-menu-item"),e.push(s)}}return e},t}($d);uh.registerComponent("TextTrackButton",rp);var op=function(e){function t(t,i){var n,r=i.track,o=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=o.text,i.selected=o.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(nh(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText(nh(n.label_)),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new up(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,hp)},t}(rp);dp.prototype.kinds_=["captions","subtitles"],dp.prototype.controlText_="Subtitles",uh.registerComponent("SubsCapsButton",dp);var pp=function(e){function t(t,i){var n,r=i.track,o=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)t.push(new mp(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){var t=this.player().playbackRate(),i=this.playbackRates(),n=(i.indexOf(t)+1)%i.length;this.player().playbackRate(i[n])},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Jd);gp.prototype.controlText_="Playback Rate",uh.registerComponent("PlaybackRateMenuButton",gp);var vp=function(e){function t(){return e.apply(this,arguments)||this}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n)},t}(uh);uh.registerComponent("Spacer",vp);var yp=function(e){function t(){return e.apply(this,arguments)||this}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(vp);uh.registerComponent("CustomControlSpacer",yp);var _p=function(e){function t(){return e.apply(this,arguments)||this}return In(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(uh);_p.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in En&&_p.prototype.options_.children.splice(_p.prototype.options_.children.length-1,0,"pictureInPictureToggle"),uh.registerComponent("ControlBar",_p);var bp=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",(function(e){return n.open(e)})),n}In(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Ch);bp.prototype.options_=Sn({},Ch.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),uh.registerComponent("ErrorDisplay",bp);var Cp="vjs-text-track-settings",Tp=["#000","Black"],wp=["#00F","Blue"],Ep=["#0FF","Cyan"],Sp=["#0F0","Green"],kp=["#F0F","Magenta"],Pp=["#F00","Red"],Ap=["#FFF","White"],xp=["#FF0","Yellow"],Ip=["1","Opaque"],Mp=["0.5","Semi-Transparent"],Lp=["0","Transparent"],Dp={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Tp,Ap,Pp,Sp,wp,xp,kp,Ep]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ip,Mp,Lp]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ap,Tp,Pp,Sp,wp,xp,kp,Ep]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ip,Mp]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Lp,Mp,Ip]}};function Op(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Dp.windowColor.options=Dp.backgroundColor.options;var jp=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind(An(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=zu("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),cu(Dp,(function(e){n.on(n.$(e.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}In(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=Dp[e],o=r.id.replace("%s",this.id_),s=[t,o].join(" ").trim();return["<"+i+' id="'+o+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"",'").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},i.createElColors_=function(){return zu("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return zu("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return zu("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e,t,i,n=this;return t=function(e,t,i){var r,o,s=(r=n.$(t.selector),o=t.parser,Op(r.options[r.options.selectedIndex].value,o));return void 0!==s&&(e[i]=s),e},void 0===(i={})&&(i=0),uu(e=Dp).reduce((function(i,n){return t(i,e[n],n)}),i)},i.setValues=function(e){var t=this;cu(Dp,(function(i,n){!function(e,t,i){if(t)for(var n=0;nthis.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(o=!1),o!==this.behindLiveEdge_&&(this.behindLiveEdge_=o,this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.toggleTracking()},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Fc),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(En,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(uh);uh.registerComponent("LiveTracker",Up);var Bp,Fp=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var o=0;o=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Nu?this.el_.fastSeek(e):this.el_.currentTime=e}catch($v){su($v,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&wu&&Au&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=bn.navigator&&bn.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)vh(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch($v){this.trigger("fullscreenerror",$v)}}),0);else try{e.webkitEnterFullScreen()}catch($v){this.trigger("fullscreenerror",$v)}},i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},i.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=En.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),bn.performance&&"function"==typeof bn.performance.now?e.creationTime=bn.performance.now():bn.performance&&bn.performance.timing&&"number"==typeof bn.performance.timing.navigationStart&&(e.creationTime=bn.Date.now()-bn.performance.timing.navigationStart),e},t}(Qh);Yp(qp,"TEST_VID",(function(){if(Wu()){var e=En.createElement("video"),t=En.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),qp.isSupported=function(){try{qp.TEST_VID.volume=.5}catch($v){return!1}return!(!qp.TEST_VID||!qp.TEST_VID.canPlayType)},qp.canPlayType=function(e){return qp.TEST_VID.canPlayType(e)},qp.canPlaySource=function(e,t){return qp.canPlayType(e.type)},qp.canControlVolume=function(){try{var e=qp.TEST_VID.volume;qp.TEST_VID.volume=e/2+.1;var t=e!==qp.TEST_VID.volume;return t&&Ru?(bn.setTimeout((function(){qp&&qp.prototype&&(qp.prototype.featuresVolumeControl=e!==qp.TEST_VID.volume)})),!1):t}catch($v){return!1}},qp.canMuteVolume=function(){try{var e=qp.TEST_VID.muted;return qp.TEST_VID.muted=!e,qp.TEST_VID.muted?tc(qp.TEST_VID,"muted","muted"):ic(qp.TEST_VID,"muted"),e!==qp.TEST_VID.muted}catch($v){return!1}},qp.canControlPlaybackRate=function(){if(wu&&Au&&xu<58)return!1;try{var e=qp.TEST_VID.playbackRate;return qp.TEST_VID.playbackRate=e/2+.1,e!==qp.TEST_VID.playbackRate}catch($v){return!1}},qp.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(En.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(En.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(En.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(En.createElement("audio"),"innerHTML",{get:e,set:e})}catch($v){return!1}return!0},qp.supportsNativeTextTracks=function(){return Nu||Ru&&Au},qp.supportsNativeVideoTracks=function(){return!(!qp.TEST_VID||!qp.TEST_VID.videoTracks)},qp.supportsNativeAudioTracks=function(){return!(!qp.TEST_VID||!qp.TEST_VID.audioTracks)},qp.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],i=e[1];Yp(qp.prototype,t,(function(){return qp[i]()}),!0)})),qp.prototype.featuresVolumeControl=qp.canControlVolume(),qp.prototype.movingMediaElementInDOM=!Ru,qp.prototype.featuresFullscreenResize=!0,qp.prototype.featuresProgressEvents=!0,qp.prototype.featuresTimeupdateEvents=!0,qp.prototype.featuresVideoFrameCallback=!(!qp.TEST_VID||!qp.TEST_VID.requestVideoFrameCallback),qp.patchCanPlayType=function(){Eu>=4&&!ku&&!Au&&(Bp=qp.TEST_VID&&qp.TEST_VID.constructor.prototype.canPlayType,qp.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Bp.call(this,e)})},qp.unpatchCanPlayType=function(){var e=qp.TEST_VID.constructor.prototype.canPlayType;return Bp&&(qp.TEST_VID.constructor.prototype.canPlayType=Bp),e},qp.patchCanPlayType(),qp.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch($v){}}()}},qp.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch($v){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){qp.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){qp.prototype["set"+nh(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){qp.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){qp.prototype["set"+nh(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){qp.prototype[e]=function(){return this.el_[e]()}})),Qh.withSourceHandlers(qp),qp.nativeSourceHandler={},qp.nativeSourceHandler.canPlayType=function(e){try{return qp.TEST_VID.canPlayType(e)}catch($v){return""}},qp.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return qp.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=Uh(e.src);return qp.nativeSourceHandler.canPlayType("video/"+i)}return""},qp.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},qp.nativeSourceHandler.dispose=function(){},qp.registerSourceHandler(qp.nativeSourceHandler),Qh.registerTech("Html5",qp);var Xp=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Zp={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Qp=["tiny","xsmall","small","medium","large","xlarge","huge"],Kp={};Qp.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Kp[e]="vjs-layout-"+t}));var Jp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},$p=function(e){function t(i,n,r){var o;if(i.id=i.id||n.id||"vjs_video_"+kc(),(n=hu(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var a=i;a&&1===a.nodeType;){if($u(a).hasOwnProperty("lang")){n.language=a.getAttribute("lang");break}a=a.parentNode}if((o=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return o.documentFullscreenChange_(e)},o.boundFullWindowOnEscKey_=function(e){return o.fullWindowOnEscKey(e)},o.boundUpdateStyleEl_=function(e){return o.updateStyleEl_(e)},o.boundApplyInitTime_=function(e){return o.applyInitTime_(e)},o.boundUpdateCurrentBreakpoint_=function(e){return o.updateCurrentBreakpoint_(e)},o.boundHandleTechClick_=function(e){return o.handleTechClick_(e)},o.boundHandleTechDoubleClick_=function(e){return o.handleTechDoubleClick_(e)},o.boundHandleTechTouchStart_=function(e){return o.handleTechTouchStart_(e)},o.boundHandleTechTouchMove_=function(e){return o.handleTechTouchMove_(e)},o.boundHandleTechTouchEnd_=function(e){return o.handleTechTouchEnd_(e)},o.boundHandleTechTap_=function(e){return o.handleTechTap_(e)},o.isFullscreen_=!1,o.log=au(o.id_),o.fsApi_=eu,o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,o.debugEnabled_=!1,o.audioOnlyMode_=!1,o.audioPosterMode_=!1,o.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!o.options_||!o.options_.techOrder||!o.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(o.tag=i,o.tagAttributes=i&&$u(i),o.language(o.options_.language),n.languages){var l={};Object.getOwnPropertyNames(n.languages).forEach((function(e){l[e.toLowerCase()]=n.languages[e]})),o.languages_=l}else o.languages_=t.prototype.options_.languages;o.resetCache_(),o.poster_=n.poster||"",o.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),o.changingSrc_=!1,o.playCallbacks_=[],o.playTerminatedQueue_=[],i.hasAttribute("autoplay")?o.autoplay(!0):o.autoplay(o.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach((function(e){if("function"!=typeof o[e])throw new Error('plugin "'+e+'" does not exist')})),o.scrubbing_=!1,o.el_=o.createEl(),$c(An(o),{eventBusKey:"el_"}),o.fsApi_.requestFullscreen&&(Dc(En,o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_),o.on(o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_)),o.fluid_&&o.on(["playerreset","resize"],o.boundUpdateStyleEl_);var u=rh(o.options_);n.plugins&&Object.keys(n.plugins).forEach((function(e){o[e](n.plugins[e])})),n.debug&&o.debug(!0),o.options_.playerOptions=u,o.middleware_=[],o.playbackRates(n.playbackRates),o.initChildren(),o.isAudio("audio"===i.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),Du&&o.addClass("vjs-touch-enabled"),Ru||o.addClass("vjs-workinghover"),t.players[o.id_]=An(o);var c=Ql.split(".")[0];return o.addClass("vjs-v"+c),o.userActive(!0),o.reportUserActivity(),o.one("play",(function(e){return o.listenForUserActivity_(e)})),o.on("stageclick",(function(e){return o.handleStageClick_(e)})),o.on("keydown",(function(e){return o.handleKeyDown(e)})),o.on("languagechange",(function(e){return o.handleLanguagechange(e)})),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o.on("ready",(function(){o.audioPosterMode(o.options_.audioPosterMode),o.audioOnlyMode(o.options_.audioOnlyMode)})),o}In(t,e);var i=t.prototype;return i.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),Oc(En,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Oc(En,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Jh[this.id()]=null,Zh.names.forEach((function(e){var t=Zh[e],n=i[t.getterName]();n&&n.off&&n.off()})),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var o=$u(i);if(r){for(t=this.el_=i,i=this.tag=En.createElement("video");t.children.length;)i.appendChild(t.firstChild);Xu(t,"video-js")||Zu(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{i[e]=t[e]}catch($v){}}))}if(i.setAttribute("tabindex","-1"),o.tabindex="-1",(Iu||Au&&Lu)&&(i.setAttribute("role","application"),o.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach((function(e){r&&"class"===e||t.setAttribute(e,o[e]),r&&i.setAttribute(e,o[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==bn.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=wc("vjs-styles-dimensions");var s=mc(".vjs-styles-defaults"),a=mc("head");a.insertBefore(this.styleEl_,s?s.nextSibling:a.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var l=i.getElementsByTagName("a"),u=0;u0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Ec(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*r+"%;\n }\n ")}else{var o="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(o>=0&&(a.width=o),s>=0&&(a.height=s))}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=nh(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Qh.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var o=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(o=!1);var s={source:t,autoplay:o,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Zh.names.forEach((function(e){var t=Zh[e];s[t.getterName]=i[t.privateName]})),hu(s,this.options_[n]),hu(s,this.options_[r]),hu(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var a=Qh.getTech(e);if(!a)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new a(s),this.tech_.ready(Wc(this,this.handleTechReady_),!0),bh(this.textTracksJson_||[],this.tech_),Xp.forEach((function(e){i.on(i.tech_,e,(function(t){return i["handleTech"+nh(e)+"_"](t)}))})),Object.keys(Zp).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Zp[e]+"_"].bind(i),event:t}):i["handleTech"+Zp[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return i.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return i.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return i.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return i.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return i.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return i.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return i.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return i.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return i.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return i.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return i.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return i.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return i.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return i.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return i.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return i.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return i.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||qu(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;Zh.names.forEach((function(t){var i=Zh[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=_h(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&su.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=function(){t.muted(e)};t.playTerminatedQueue_.push(i);var n=t.play();if(gh(n))return n.catch((function(e){throw i(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():gh(i=this.play())&&(i=i.catch(n)),gh(i))return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))}))},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&(su.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?vh(this.play()):this.pause()))},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},i.handleStageClick_=function(){this.reportUserActivity()},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=En[this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},i.handleTechFullscreenChange_=function(e,t){var i=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(function(){i.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},i.techCall_=function(e,t){this.ready((function(){if(e in nd)return function(e,t,i,n){return t[i](e.reduce(od(i),n))}(this.middleware_,this.tech_,e,t);if(e in rd)return td(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch($v){throw su($v),$v}}),!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in id)return function(e,t,i){return e.reduceRight(od(i),t[i]())}(this.middleware_,this.tech_,e);if(e in rd)return td(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch($v){if(void 0===this.tech_[e])throw su("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",$v),$v;if("TypeError"===$v.name)throw su("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",$v),this.tech_.isReady_=!1,$v;throw su($v),$v}}},i.play=function(){var e=this,t=this.options_.Promise||bn.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},i.play_=function(e){var t=this;void 0===e&&(e=vh),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(i||!Nu&&!Ru||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||dh(0,0)},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=dh(0,0)),e},i.bufferedPercent=function(){return ph(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},i.requestFullscreen=function(e){var t=this.options_.Promise||bn.Promise;if(t){var i=this;return new t((function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",o)}function o(){r(),t()}function s(e,t){r(),n(t)}i.one("fullscreenchange",o),i.one("fullscreenerror",s);var a=i.requestFullscreenHelper_(e);a&&(a.then(r,r),a.then(t,n))}))}return this.requestFullscreenHelper_()},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then((function(){return i.isFullscreen(!0)}),(function(){return i.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},i.exitFullscreen=function(){var e=this.options_.Promise||bn.Promise;if(e){var t=this;return new e((function(e,i){function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",r)}function r(){n(),e()}function o(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",o);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i))}))}return this.exitFullscreenHelper_()},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=En[this.fsApi_.exitFullscreen]();return t&&vh(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=En.documentElement.style.overflow,Dc(En,"keydown",this.boundFullWindowOnEscKey_),En.documentElement.style.overflow="hidden",Zu(En.body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){Pn.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Oc(En,"keydown",this.boundFullWindowOnEscKey_),En.documentElement.style.overflow=this.docOrigOverflow,Qu(En.body,"vjs-full-window"),this.trigger("exitFullWindow")},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},i.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in En&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in En)return En.exitPictureInPicture()},i.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return Pn.isEventKey(e,"f")}:i,r=t.muteKey,o=void 0===r?function(e){return Pn.isEventKey(e,"m")}:r,s=t.playPauseKey,a=void 0===s?function(e){return Pn.isEventKey(e,"k")||Pn.isEventKey(e,"Space")}:s;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var l=uh.getComponent("FullscreenToggle");!1!==En[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,e)}else if(o.call(this,e)){e.preventDefault(),e.stopPropagation(),uh.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation(),uh.getComponent("PlayToggle").prototype.handleClick.call(this,e)}},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void i.triggerReady());o=r,s=i.tech_,o.forEach((function(e){return e.setTech&&e.setTech(s)}))})),this.options_.retryOnError&&n.length>1){var r=function(){i.error(null),i.handleSrc_(n.slice(1),!0)},o=function(){i.off("error",r)};this.one("error",r),this.one("playing",o),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",o)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)},i.src=function(e){return this.handleSrc_(e,!1)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,nh(t)!==nh(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){var e=this,t=this.options_.Promise||bn.Promise;this.paused()||!t?this.doReset_():vh(this.play().then((function(){return e.doReset_()})))},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),zc(this)&&this.trigger("playerreset")},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent()},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(Jl("beforeerror").forEach((function(i){var n=i(t,e);du(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:t.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),void this.one("loadstart",(function(){this.off(["click","touchstart"],i)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new fh(e),this.addClass("vjs-error"),su.error("(CODE:"+this.error_.code+" "+fh.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Jl("error").forEach((function(e){return e(t,t.error_)}))},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n=Wc(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())})),this.on("mouseup",r),this.on("mouseleave",r);var o,s=this.getChild("controlBar");!s||Ru||wu||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},i.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight();t.forEach((function(t){t!==i&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")},i.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((function(e){return e.show()})),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},i.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var i=this.options_.Promise||bn.Promise;if(i){if(e){var n=[];return this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()),this.isFullscreen()&&n.push(this.exitFullscreen()),this.audioPosterMode()&&n.push(this.audioPosterMode(!1)),i.all(n).then((function(){return t.enableAudioOnlyUI_()}))}return i.resolve().then((function(){return t.disableAudioOnlyUI_()}))}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},i.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var i=this.options_.Promise||bn.Promise;return i?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((function(){t.enablePosterModeUI_()})):i.resolve().then((function(){t.enablePosterModeUI_()})):i.resolve().then((function(){t.disablePosterModeUI_()})):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),zc(this)&&this.trigger("languagechange"))},i.languages=function(){return rh(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=rh(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){}},vf=1/30,yf=.1,_f=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t}))},Cf=function(e,t){return _f(e,(function(e){return e-vf>=t}))},Tf=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i "+e.end(i));return t.join(", ")},wf=function(e){for(var t=[],i=0;io||(i+=t>r&&t<=o?o-t:o-r)}return i},kf=hf.createTimeRange,Pf=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},Af=function(e){return(e.segments||[]).reduce((function(e,t,i){return t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e}),[])},xf=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},If=function(e){var t=e.preloadSegment;if(t){var i=t.parts,n=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return n+=i&&i.length?i.length:0}},Mf=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=xf(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Lf=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),tr){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var a=n;aDate.now()},Nf=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Uf=function(e){var t=Rf(e);return!e.disabled&&!t},Bf=function(e,t){return t.attributes&&t.attributes[e]},Ff=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!Uf(e)&&(e.attributes.BANDWIDTH||0)0)for(var d=u-1;d>=0;d--){var p=l[d];if(a+=p.duration,s){if(a<0)continue}else if(a+vf<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:o-Of({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:d})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(u<0){for(var f=u;f<0;f++)if((a-=t.targetDuration)<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i};u=0}for(var m=u;m0)continue}else if(a-vf>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:o+Of({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:m})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}},isEnabled:Uf,isDisabled:function(e){return e.disabled},isBlacklisted:Rf,isIncompatible:Nf,playlistEnd:jf,isAes:function(e){for(var t=0;t-1&&s!==o.length-1&&(i._HLS_part=s),(s>-1||o.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var a=new bn.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&a.searchParams.set(e,i[e])})),e=a.toString()}return e}(i,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials},(function(t,i){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},i.playlistRequestError=function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,o=void 0===r?[]:r,s=e.customTagMappers,a=void 0===s?[]:s,l=e.experimentalLLHLS,u=new Kr;t&&u.on("warn",t),i&&u.on("info",i),o.forEach((function(e){return u.addParser(e)})),a.forEach((function(e){return u.addTagMapper(e)})),u.push(n),u.end();var c=u.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){c.hasOwnProperty(e)&&delete c[e]})),c.segments&&c.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!c.targetDuration){var h=10;c.segments&&c.segments.length&&(h=c.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+h),c.targetDuration=h}var d=xf(c);if(d.length&&!c.partTargetDuration){var p=d.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+p),zf.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),c.partTargetDuration=p}return c}({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var o=i||this.parseManifest_({url:n,manifestString:t});o.lastRequest=Date.now(),Xf({playlist:o,uri:n,id:r});var s=im(this.master,o);this.targetDuration=o.partTargetDuration||o.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(nm(this.media(),!!s)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),bn.clearTimeout(this.mediaUpdateTimeout),bn.clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(bn.clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=bn.setTimeout(this.media.bind(this,e,!1),n)}else{var r=this.state,o=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(o&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(nm(e,!0)),o){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=mf(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}}))}}},i.pause=function(){this.mediaUpdateTimeout&&(bn.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(bn.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=bn.setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(bn.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=bn.setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},i.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=bn.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=mf(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}}))},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Zf(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=em(e),e.segments.forEach((function(t){$f(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||bn.location.href;this.master=function(e,t){var i=Yf(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:bn.location.href,resolvedUri:bn.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Kf),om=hf.xhr,sm=hf.mergeOptions,am=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},lm=function(){var e=function e(t,i){t=sm({timeout:45e3},t);var n=e.beforeRequest||hf.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var o=(!0===hf.Vhs.xhr.original?om:hf.Vhs.xhr)(t,(function(e,t){return am(o,e,t,i)})),s=o.abort;return o.abort=function(){return o.aborted=!0,s.apply(o,arguments)},o.uri=t.uri,o.requestTime=Date.now(),o};return e.original=!0,e},um=function(e){var t,i={};return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?bn.BigInt(t.offset)+bn.BigInt(t.length)-bn.BigInt(1):t.offset+t.length-1)),i},cm=function(e,t){return e.start(t)+"-"+e.end(t)},hm=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},dm=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},pm=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ho(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},fm=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},mm=function(e){return e.resolvedUri},gm=function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",r=0;rn){if(e>n+.25*o.duration)return null;i=o}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}}(n,t);if(!o)return r({message:"valid programTime was not found"});if("estimate"===o.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:o.estimatedStart});var s={mediaSeconds:n},a=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)}(n,o.segment);return a&&(s.programDateTime=a.toISOString()),r(null,s)},_m=function e(t){var i=t.programTime,n=t.playlist,r=t.retryCount,o=void 0===r?2:r,s=t.seekTo,a=t.pauseAfterSeek,l=void 0===a||a,u=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===i||!n||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;tnew Date(a.getTime()+1e3*l)?null:(i>a&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Gf.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})}(i,n);if(!h)return c({message:i+" was not found in the stream"});var d=h.segment,p=function(e,t){var i,n;try{i=new Date(e),n=new Date(t)}catch($v){}var r=i.getTime();return(n.getTime()-r)/1e3}(d.dateTimeObject,i);if("estimate"===h.type)return 0===o?c({message:i+" is not buffered yet. Try again"}):(s(h.estimatedStart+p),void u.one("seeked",(function(){e({programTime:i,playlist:n,retryCount:o-1,seekTo:s,pauseAfterSeek:l,tech:u,callback:c})})));var f=d.start+p;u.one("seeked",(function(){return c(null,u.currentTime())})),l&&u.pause(),s(f)},bm=function(e,t){if(4===e.readyState)return t()},Cm=function(e,t,i){var n,r=[],o=!1,s=function(e,t,n,r){return t.abort(),o=!0,i(e,t,n,r)},a=function(e,t){if(!o){if(e)return s(e,t,"",r);var i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=function(){for(var e=arguments.length,t=new Array(e),i=0;i=c+u)return s(t,{response:a.subarray(u,u+c),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:o,responseType:"arraybuffer",headers:um({byterange:e.sidx.byterange})},s)}))}else this.mediaRequest_=bn.setTimeout((function(){return i(!1)}),0)},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},bn.clearTimeout(this.minimumUpdatePeriodTimeout_),bn.clearTimeout(this.mediaRequest_),bn.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,(function(n){t.haveMetadata({startingState:i,playlist:e})})))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),bn.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(bn.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;bn.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=bn.setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=bn.setTimeout((function(){return e.haveMaster_()}),0)},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=mf(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(n,r)}))):e(n,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},i.syncClientServerClock_=function(e){var t=this,i=_l(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:ff(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var o;o="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=o-Date.now(),e()}})))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e,t,i,n,r,o,s,a=this.masterPlaylistLoader_.master,l=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:a},t=e.masterXml,i=e.srcUrl,n=e.clientOffset,r=e.sidxMapping,o=e.previousManifest,s=yl(t,{manifestUri:i,clientOffset:n,sidxMapping:r,previousManifest:o}),Zf(s,i),s);a&&(l=function(e,t,i){for(var n=!0,r=wm(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),o=0;o-1)},this.trigger=function(t){var i,n,r,o;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(T.hdlr,A[e])},f=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(T.mdhd,i)},p=function(e){return t(T.mdia,f(e),m(e.type),s(e))},o=function(e){return t(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},s=function(e){return t(T.minf,"video"===e.type?t(T.vmhd,x):t(T.smhd,I),i(),v(e))},a=function(e,i){for(var n=[],r=i.length;r--;)n[r]=_(i[r]);return t.apply(null,[T.moof,o(e)].concat(n))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=h(e[i]);return t.apply(null,[T.moov,c(4294967295)].concat(n).concat(u(e)))},u=function(e){for(var i=e.length,n=[];i--;)n[i]=b(e[i]);return t.apply(null,[T.mvex].concat(n))},c=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(T.mvhd,i)},g=function(e){var i,n,r=e.samples||[],o=new Uint8Array(4+r.length);for(n=0;n>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));for(i=0;i>>8),a.push(255&o[i].byteLength),a=a.concat(Array.prototype.slice.call(o[i]));if(n=[T.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(T.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[o.length],a))),t(T.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];n.push(t(T.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return t.apply(null,n)},N=function(e){return t(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},d=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(T.tkhd,i)},_=function(e){var i,n,r,o,s,a;return i=t(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/G),a=Math.floor(e.baseMediaDecodeTime%G),n=t(T.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,a>>>24&255,a>>>16&255,a>>>8&255,255&a])),92,"audio"===e.type?(r=C(e,92),t(T.traf,i,n,r)):(o=g(e),r=C(e,o.length+92),t(T.traf,i,n,r,o))},h=function(e){return e.duration=e.duration||4294967295,t(T.trak,d(e),p(e))},b=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(T.trex,i)},F=function(e,t){var i=0,n=0,r=0,o=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(o=8)),[0,0,i|n|r|o,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},B=function(e,i){var n,r,o,s,a,l;for(i+=20+16*(s=e.samples||[]).length,o=F(s,i),(r=new Uint8Array(o.length+16*s.length)).set(o),n=o.length,l=0;l>>24,r[n++]=(16711680&a.duration)>>>16,r[n++]=(65280&a.duration)>>>8,r[n++]=255&a.duration,r[n++]=(4278190080&a.size)>>>24,r[n++]=(16711680&a.size)>>>16,r[n++]=(65280&a.size)>>>8,r[n++]=255&a.size,r[n++]=a.flags.isLeading<<2|a.flags.dependsOn,r[n++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,r[n++]=61440&a.flags.degradationPriority,r[n++]=15&a.flags.degradationPriority,r[n++]=(4278190080&a.compositionTimeOffset)>>>24,r[n++]=(16711680&a.compositionTimeOffset)>>>16,r[n++]=(65280&a.compositionTimeOffset)>>>8,r[n++]=255&a.compositionTimeOffset;return t(T.trun,r)},U=function(e,i){var n,r,o,s,a,l;for(i+=20+8*(s=e.samples||[]).length,o=F(s,i),(n=new Uint8Array(o.length+8*s.length)).set(o),r=o.length,l=0;l>>24,n[r++]=(16711680&a.duration)>>>16,n[r++]=(65280&a.duration)>>>8,n[r++]=255&a.duration,n[r++]=(4278190080&a.size)>>>24,n[r++]=(16711680&a.size)>>>16,n[r++]=(65280&a.size)>>>8,n[r++]=255&a.size;return t(T.trun,n)},C=function(e,t){return"audio"===e.type?U(e,t):B(e,t)};r=function(){return t(T.ftyp,w,E,w,S)};var z,Y,q,X,Z,Q,K,J,$=function(e){return t(T.mdat,e)},ee=a,te=function(e){var t,i=r(),n=l(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t},ie=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ne=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},se=function(e,t){var i,n,r,o,s,a=t||0,l=[];for(i=0;ipe/2))){for((s=he()[e.samplerate])||(s=t[0].data),a=0;a=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},Ce=function(e){var t,i,n=[];for(t=0;t=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},je.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},je.prototype.addText=function(e){this.rows[this.rowIdx]+=e},je.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Re=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new je(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};Re.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new je(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},Re.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Re.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Ne=function e(t){t=t||{},e.prototype.init.call(this);var i,n=this,r=t.captionServices||{},o={};Object.keys(r).forEach((function(e){i=r[e],/^SERVICE/.test(e)&&(o[e]=i.encoding)})),this.serviceEncodings=o,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};Ne.prototype=new W,Ne.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ne.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},Ne.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,o=t[r++];for(e.seq=o>>6,e.sizeCode=63&o;r>5)&&n>0&&(i=o=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},Ne.prototype.pushServiceBlock=function(e,t,i){var n,r=t,o=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,o.rowLock=(16&n)>>4,o.columnLock=(8&n)>>3,o.priority=7&n,n=i[++e],o.relativePositioning=(128&n)>>7,o.anchorVertical=127&n,n=i[++e],o.anchorHorizontal=n,n=i[++e],o.anchorPoint=(240&n)>>4,o.rowCount=15&n,n=i[++e],o.columnCount=63&n,n=i[++e],o.windowStyle=(56&n)>>3,o.penStyle=7&n,o.virtualRowCount=o.rowCount+1,e},Ne.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},Ne.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Ne.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Ne.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},Ne.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},Ne.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},Ne.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Ue={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Be=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},Fe=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],We=function(){for(var e=[],t=15;t--;)e.push("");return e},He=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,o;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=We();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=We();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=We()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))o=Be((n=(3&n)<<8)|r),this[this.mode_](e.pts,o),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),o=Be((n=(3&n)<<8)|r),this[this.mode_](e.pts,o),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=Fe.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),o=Be(n),o+=Be(r),this[this.mode_](e.pts,o),this.column_+=o.length)}else this.lastControlCode_=null}};He.prototype=new W,He.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch($v){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},He.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=We(),this.nonDisplayed_=We(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},He.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},He.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},He.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},He.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},He.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},He.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},He.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},He.prototype.isNormalChar=function(e){return e>=32&&e<=127},He.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=We(),this.displayed_=We()),void 0!==t&&t!==this.row_)for(var i=0;i"}),"");this[this.mode_](e,i)},He.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+""}),"");this.formatting_=[],this[this.mode_](e,t)}},He.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},He.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},He.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},qe=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||ze,this.push=function(e){this.type_!==ze&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Ye(e.dts,n),e.pts=Ye(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};qe.prototype=new W;var Xe,Ze=qe,Qe=Ye,Ke=function(e,t,i){var n,r="";for(n=t;n>>2;c*=4,c+=3&u[7],a.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=a.timeStamp,t.dts=a.timeStamp),this.trigger("timestamp",a)}t.frames.push(a),i+=10,i+=s}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ge.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ge.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new W,it.STREAM_TYPES={h264:27,adts:15},(nt=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},o={data:[],size:0},s=function(e,i,n){var r,o,s=new Uint8Array(e.size),a={type:i},l=0,u=0;if(e.data.length&&!(e.size<9)){for(a.trackId=e.data[0].pid,l=0;l>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8])),r="video"===i||a.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",a)}};nt.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case Ge.H264_STREAM_TYPE:e=n,t="video";break;case Ge.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ge.METADATA_STREAM_TYPE:e=o,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};null!==(e=a.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[a.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(n,"video"),s(r,"audio"),s(o,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new W;var at={PAT_PID:0,MP2T_PACKET_LENGTH:st,TransportPacketStream:tt,TransportParseStream:it,ElementaryStream:nt,TimestampRolloverStream:ot,CaptionStream:Ve.CaptionStream,Cea608Stream:Ve.Cea608Stream,Cea708Stream:Ve.Cea708Stream,MetadataStream:rt};for(var lt in Ge)Ge.hasOwnProperty(lt)&&(at[lt]=Ge[lt]);var ut,ct=at,ht=pe,dt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(ut=function(e){var t,i=0;ut.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+i+" outside syncword"})},this.push=function(n){var r,o,s,a,l,u=0;if(e||(i=0),"audio"===n.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+n.data.byteLength)).set(s),t.set(n.data,s.byteLength)):t=n.data;u+7>5,l=(a=1024*(1+(3&t[u+6])))*ht/dt[(60&t[u+2])>>>2],t.byteLength-u>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:dt[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+o,u+r)}),i++,u+=r}else"number"!=typeof c&&(c=u),u++;"number"==typeof c&&(this.skipWarn_(c,u),c=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new W;var pt,ft,mt,gt=ut,vt=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,o=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");o.set(e.subarray(r,r+s)),i=new DataView(o.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),o=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?o<>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(ft=function(){var e,t,i=0;ft.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var o=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new W,mt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(pt=function(){var e,t,i,n,r,o,s,a=new ft;pt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,a.push(e))},a.on("data",(function(s){var a={trackId:t,pts:i,dts:n,data:s,nalUnitTypeCode:31&s[0]};switch(a.nalUnitTypeCode){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp",a.escapedRBSP=r(s.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp",a.escapedRBSP=r(s.subarray(1)),a.config=o(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",a)})),a.on("done",(function(){e.trigger("done")})),a.on("partialdone",(function(){e.trigger("partialdone")})),a.on("reset",(function(){e.trigger("reset")})),a.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){a.flush()},this.partialFlush=function(){a.partialFlush()},this.reset=function(){a.reset()},this.endTimeline=function(){a.endTimeline()},s=function(e,t){var i,n=8,r=8;for(i=0;i=0?i:0,(16&e[t+5])>>4?i+20:i+10},Tt=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:e(t,i+=Ct(t,i))},wt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Et={isLikelyAacData:function(e){var t=Tt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:Ct,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=wt(e.subarray(10,14)));do{if((i=wt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return s*=4,s+=3&o[7]}break}}t+=10,t+=i}while(t=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!=(255&e[l])||240!=(240&e[l+1]))l++;else{if(e.length-l<7)break;if(l+(a=Et.parseAdtsSize(e,l))>e.length)break;o={type:"audio",data:e.subarray(l,l+a),pts:t,dts:t},this.trigger("data",o),l+=a}else{if(e.length-l<10)break;if(l+(a=Et.parseId3TagSize(e,l))>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+a)},this.trigger("data",r),l+=a}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new W;var St,kt,Pt,At,xt=yt,It=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Mt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Lt=_t.H264Stream,Dt=Et.isLikelyAacData,Ot=pe,jt=function(e,t){t.stream=e,this.trigger("log",t)},Rt=function(e,t){for(var i=Object.keys(t),n=0;n=-1e4&&i<=45e3&&(!n||a>i)&&(n=o,a=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,o,a,l,u;for(o=e.byteLength,a=e.nalCount,l=e.duration,t=i=0;tn.pts?t++:(i++,o-=r.byteLength,a-=r.nalCount,l-=r.duration);return 0===i?e:i===e.length?null:((u=e.slice(i)).byteLength=o,u.duration=l,u.nalCount=a,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,i,n,r,o,a,l;for(t=s.length-1,i=e.length-1,o=null,a=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){a=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(o=i),i--)}if(!a&&null===o)return null;if(0===(l=a?i:o))return e;var u=e.slice(l),c=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=c.byteLength,u.duration=c.duration,u.nalCount=c.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){s=e}}).prototype=new W,(At=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,At.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new W,At.prototype.flush=function(e){var t,i,n,r,o=0,s={captions:[],captionStreams:{},metadata:[],info:{}},a=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(a=this.videoTrack.timelineStartInfo.pts,Mt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts,It.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=te(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},At.prototype.setRemux=function(e){this.remuxTracks=e},(Pt=function(e){var t,i,n=this,r=!0;Pt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new ct.MetadataStream,r.aacStream=new xt,r.audioTimestampRolloverStream=new ct.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new ct.TimestampRolloverStream("timed-metadata"),r.adtsStream=new gt,r.coalesceStream=new At(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(o){"timed-metadata"!==o.type&&"audio"!==o.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new kt(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Rt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new ct.MetadataStream,r.packetStream=new ct.TransportPacketStream,r.parseStream=new ct.TransportParseStream,r.elementaryStream=new ct.ElementaryStream,r.timestampRolloverStream=new ct.TimestampRolloverStream,r.adtsStream=new gt,r.h264Stream=new Lt,r.captionStream=new ct.CaptionStream(e),r.coalesceStream=new At(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(o){var s;if("metadata"===o.type){for(s=o.tracks.length;s--;)t||"video"!==o.tracks[s].type?i||"audio"!==o.tracks[s].type||((i=o.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=o.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new St(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new kt(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Rt(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Ee(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Ee(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=Dt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new W;var Bt,Ft,Wt,Ht={Transmuxer:Pt,VideoSegmentStream:St,AudioSegmentStream:kt,AUDIO_PROPERTIES:It,VIDEO_PROPERTIES:Mt,generateSegmentTimingInfo:Ut},Vt=function(e){return e>>>0},Gt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},zt=Vt,Yt=function e(t,i){var n,r,o,s,a,l=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,o===i[0]&&(1===i.length?l.push(t.subarray(n+8,s)):(a=e(t.subarray(n+8,s),i.slice(1))).length&&(l=l.concat(a))),n=s;return l},qt=Vt,Xt=V.getUint64,Zt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Xt(e.subarray(4)):t.baseMediaDecodeTime=qt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},Qt=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Kt=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],o=4&i.flags[2],s=1&i.flags[1],a=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),o&&c&&(t={flags:Qt(e.subarray(h,h+4))},h+=4,s&&(t.duration=n.getUint32(h),h+=4),a&&(t.size=n.getUint32(h),h+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},s&&(t.duration=n.getUint32(h),h+=4),a&&(t.size=n.getUint32(h),h+=4),l&&(t.flags=Qt(e.subarray(h,h+4)),h+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},Jt=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],o=2&n.flags[2],s=8&n.flags[2],a=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),o&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),a&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},$t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ei="undefined"!=typeof window?window:void 0!==$t?$t:"undefined"!=typeof self?self:{},ti=Ie,ii=Ve.CaptionStream,ni=function(e,t){for(var i=e,n=0;n0?Zt(u[0]).baseMediaDecodeTime:0,h=Yt(o,["trun"]);t===l&&h.length>0&&(i=function(e,t,i){var n,r,o,s,a=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(r=0;r+40;){var l=t.shift();this.parse(l,o,s)}return(a=function(e,t,i){if(null===t)return null;var n=ri(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}}(e,i,n))&&a.logs&&(r.logs=r.logs.concat(a.logs)),null!==a&&a.seiNals?(this.pushNals(a.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;o?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},si=Vt,ai=function(e){return("00"+e.toString(16)).slice(-2)},li=V.getUint64;Bt=function(e,t){var i=Yt(t,["moof","traf"]).reduce((function(t,i){var n,r,o=Yt(i,["tfhd"])[0],s=si(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),a=e[s]||9e4,l=Yt(i,["tfdt"])[0],u=new DataView(l.buffer,l.byteOffset,l.byteLength);return"bigint"==typeof(n=1===l[0]?li(l.subarray(4,12)):u.getUint32(4))?r=n/ei.BigInt(a):"number"!=typeof n||isNaN(n)||(r=n/a),r11?(r.codec+=".",r.codec+=ai(c[9]),r.codec+=ai(c[10]),r.codec+=ai(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=h.subarray(28),"esds"===Gt(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+ai(c[19]),r.codec+="."+ai(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var d=Yt(e,["mdia","mdhd"])[0];d&&(r.timescale=Wt(d)),i.push(r)})),i};var ui=Bt,ci=Ft,hi=(Wt=function(e){var t=0===e[0]?12:20;return si(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},function(e){var t=31&e[1];return t<<=8,t|=e[2]}),di=function(e){return!!(64&e[1])},pi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},fi=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},mi={parseType:function(e,t){var i=hi(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=di(e),i=4+pi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=di(e),n=4+pi(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var o=12+((15&e[n+10])<<8|e[n+11]);o=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+pi(e),i=e.subarray(t),n=0,r=0,o=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===fi(31&i[r+3])&&(o=!0),o}},gi=Qe,vi={};vi.ts=mi,vi.aac=Et;var yi=pe,_i=188,bi=71,Ci=function(e,t,i){for(var n,r,o,s,a=0,l=_i,u=!1;l<=e.byteLength;)if(e[a]!==bi||e[l]!==bi&&l!==e.byteLength)a++,l++;else{switch(n=e.subarray(a,l),vi.ts.parseType(n,t.pid)){case"pes":r=vi.ts.parsePesType(n,t.table),o=vi.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&o&&(s=vi.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),u=!0)}if(u)break;a+=_i,l+=_i}for(a=(l=e.byteLength)-_i,u=!1;a>=0;)if(e[a]!==bi||e[l]!==bi&&l!==e.byteLength)a--,l--;else{switch(n=e.subarray(a,l),vi.ts.parseType(n,t.pid)){case"pes":r=vi.ts.parsePesType(n,t.table),o=vi.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&o&&(s=vi.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),u=!0)}if(u)break;a-=_i,l-=_i}},Ti=function(e,t,i){for(var n,r,o,s,a,l,u,c=0,h=_i,d=!1,p={data:[],size:0};h=0;)if(e[c]!==bi||e[h]!==bi)c--,h--;else{switch(n=e.subarray(c,h),vi.ts.parseType(n,t.pid)){case"pes":r=vi.ts.parsePesType(n,t.table),o=vi.ts.parsePayloadUnitStartIndicator(n),"video"===r&&o&&(s=vi.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),d=!0)}if(d)break;c-=_i,h-=_i}},wi=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=_i;r=3;){switch(vi.aac.parseType(e,a)){case"timed-metadata":if(e.length-a<10){i=!0;break}if((s=vi.aac.parseId3TagSize(e,a))>e.length){i=!0;break}null===o&&(t=e.subarray(a,a+s),o=vi.aac.parseAacTimestamp(t)),a+=s;break;case"audio":if(e.length-a<7){i=!0;break}if((s=vi.aac.parseAdtsSize(e,a))>e.length){i=!0;break}null===r&&(t=e.subarray(a,a+s),r=vi.aac.parseSampleRate(t)),n++,a+=s;break;default:a++}if(i)return null}if(null===r||null===o)return null;var l=yi/r;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*l,pts:o+1024*n*l}]}}(e):wi(e))&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=gi(e.dts,i),e.pts=gi(e.pts,i),e.dtsTime=e.dts/yi,e.ptsTime=e.pts/yi}))}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=gi(e.dts,n),e.pts=gi(e.pts,n),e.dtsTime=e.dts/yi,e.ptsTime=e.pts/yi})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=gi(r.dts,n),r.pts=gi(r.pts,n),r.dtsTime=r.dts/yi,r.ptsTime=r.pts/yi}}}(i,t),i):null},Si=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){var e,t;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Ht.Transmuxer(this.options),e=this.self,(t=this.transmuxer).on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var i={start:{decode:me(t.start.dts),presentation:me(t.start.pts)},end:{decode:me(t.end.dts),presentation:me(t.end.pts)},baseMediaDecodeTime:me(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=me(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){var i={start:{decode:me(t.start.dts),presentation:me(t.start.pts)},end:{decode:me(t.end.dts),presentation:me(t.end.pts)},baseMediaDecodeTime:me(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=me(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:me(t.start),end:me(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:me(t.start),end:me(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new oi,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=ui(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer])},t.probeMp4Tracks=function(e){var t=e.data,i=ci(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!=typeof i||isNaN(i)?void 0:i*pe,r=Ei(t,n),o=null;r&&((o={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(o.videoStart=r.video[0].ptsTime),o.hasAudio&&(o.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:o,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(fe(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(fe(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Si(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Si(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})))),Om=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,o=e.remux,s=e.onData,a=e.onTrackInfo,l=e.onAudioTimingInfo,u=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,h=e.onAudioSegmentTimingInfo,d=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,v=e.isEndOfTimeline,y={buffer:[]},_=v;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&function(e,t,i){var n=e.data.segment,r=n.type,o=n.initSegment,s=n.captions,a=n.captionStreams,l=n.metadata,u=n.videoFrameDtsTime,c=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:a,metadata:l});var h=e.data.segment.boxes||{data:e.data.segment.data},d={type:r,data:new Uint8Array(h.data,h.data.byteOffset,h.data.byteLength),initSegment:new Uint8Array(o.data,o.byteOffset,o.byteLength)};void 0!==u&&(d.videoFrameDtsTime=u),void 0!==c&&(d.videoFramePtsTime=c),i(d)}(i,y,s),"trackinfo"===i.data.action&&a(i.data.trackInfo),"gopInfo"===i.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(i,y),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&c(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&d([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)}({transmuxedData:y,callback:f}),jm(t))))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==o&&t.postMessage({action:"setRemux",remux:o}),i.byteLength){var b=i instanceof ArrayBuffer?i:i.buffer,C=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:b,byteOffset:C,byteLength:i.byteLength},[b])}v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},jm=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Om(e.currentTransmux))},Rm=function(e,t){e.postMessage({action:t}),jm(e)},Nm=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void Rm(t,e);t.transmuxQueue.push(Rm.bind(null,t,e))},Um=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Om(e);e.transmuxer.transmuxQueue.push(e)},Bm=function(e){Nm("reset",e)},Fm=function(e){var t=new Dm;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},Wm=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=Sn({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function r(o){o.data.action===i&&(t.removeEventListener("message",r),o.data.data&&(o.data.data=new Uint8Array(o.data.data,e.byteOffset||0,e.byteLength||o.data.data.byteLength),e.data&&(e.data=o.data.data)),n(o.data))})),e.data){var o=e.data instanceof ArrayBuffer;r.byteOffset=o?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[o?e.data:e.data.buffer];t.postMessage(r,s)}else t.postMessage(r)},Hm=2,Vm=-101,Gm=-102,zm=function(e){e.forEach((function(e){e.abort()}))},Ym=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Vm,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Gm,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Hm,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Hm,xhr:t}:null},qm=function(e,t,i){return function(n,r){var o=r.response,s=Ym(n,r);if(s)return i(s,e);if(16!==o.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Hm,xhr:r},e);for(var a=new DataView(o),l=new Uint32Array([a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12)]),u=0;u0}(f)){t.isFmp4=!0;var m=t.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),n(t,g);var v=function(e){h(t,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&l(t,e),d(null,t,{})};Wm({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var n=e.data,o=e.startTime;i=n.buffer,t.bytes=f=n,g.hasAudio&&!g.isMuxed&&r(t,"audio","start",o),g.hasVideo&&r(t,"video","start",o),m.video&&n.byteLength&&t.transmuxer?Wm({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[m.video.id],callback:function(e){i=e.data.buffer,t.bytes=f=e.data,e.logs.forEach((function(e){p(hf.mergeOptions(e,{stream:"mp4CaptionParser"}))})),v(e.captions)}}):v()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=Yl(f)),"ts"!==t.container&&"aac"!==t.container)return n(t,{hasAudio:!1,hasVideo:!1}),void d(null,t,{});Qm({segment:t,bytes:i,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:h,doneFn:d,onTransmuxerLog:p})}else d(null,t,{})},Jm=function(e,t){var i,n=e.id,r=e.key,o=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",(function e(i){if(i.data.source===n){s.removeEventListener("message",e);var r=i.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}})),i=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),s.postMessage(pm({source:n,encrypted:o,key:i,iv:r.iv}),[o.buffer,i.buffer])},$m=function(e){var t=e.activeXhrs,i=e.decryptionWorker,n=e.trackInfoFn,r=e.timingInfoFn,o=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,a=e.id3Fn,l=e.captionsFn,u=e.isEndOfTimeline,c=e.endedTimelineFn,h=e.dataFn,d=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,zm(t),d(e,g);if((f+=1)===t.length){var v=function(){if(g.encryptedBytes)return function(e){var t=e.decryptionWorker,i=e.segment,n=e.trackInfoFn,r=e.timingInfoFn,o=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,a=e.id3Fn,l=e.captionsFn,u=e.isEndOfTimeline,c=e.endedTimelineFn,h=e.dataFn,d=e.doneFn,p=e.onTransmuxerLog;Jm({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},(function(e){i.bytes=e,Km({segment:i,bytes:i.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:h,doneFn:d,onTransmuxerLog:p})}))}({decryptionWorker:i,segment:g,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:h,doneFn:d,onTransmuxerLog:p});Km({segment:g,bytes:g.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:h,doneFn:d,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return Jm({decryptionWorker:i,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(function(e){g.map.bytes=e,Xm(g,(function(e){if(e)return zm(t),d(e,g);v()}))}));v()}}}},eg=function(e){var t=e.segment,i=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=hf.mergeOptions(t.stats,function(e){var t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i}(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(e,t)}},tg=function(e){var t=e.xhr,i=e.xhrOptions,n=e.decryptionWorker,r=e.segment,o=e.abortFn,s=e.progressFn,a=e.trackInfoFn,l=e.timingInfoFn,u=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,h=e.id3Fn,d=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,v=e.onTransmuxerLog,y=[],_=$m({activeXhrs:y,decryptionWorker:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:h,captionsFn:d,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m,doneFn:g,onTransmuxerLog:v});if(r.key&&!r.key.bytes){var b=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&b.push(r.map.key);var C=t(hf.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),qm(r,b,_));y.push(C)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var T=t(hf.mergeOptions(i,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),qm(r,[r.map.key],_));y.push(T)}var w=t(hf.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:um(r.map)}),function(e){var t=e.segment,i=e.finishProcessingFn;return function(e,n){var r=Ym(e,n);if(r)return i(r,t);var o=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=o,i(null,t);t.map.bytes=o,Xm(t,(function(e){if(e)return e.xhr=n,e.status=n.status,i(e,t);i(null,t)}))}}({segment:r,finishProcessingFn:_}));y.push(w)}var E=hf.mergeOptions(i,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:um(r)}),S=t(E,Zm({segment:r,finishProcessingFn:_,responseType:E.responseType}));S.addEventListener("progress",eg({segment:r,progressFn:s,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:h,captionsFn:d,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m})),y.push(S);var k={};return y.forEach((function(e){e.addEventListener("loadend",function(e){var t=e.loadendState,i=e.abortFn;return function(e){e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}}({loadendState:k,abortFn:o}))})),function(){return zm(y)}},ig=gf("CodecUtils"),ng=function(e,t){var i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},rg=function(e){var t={};return e.forEach((function(e){var i=e.mediaType,n=e.type,r=e.details;t[i]=t[i]||[],t[i].push(to(""+n+r))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return ig("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},og=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},sg=function(e,t){var i=t.attributes||{},n=rg(function(e){var t=e.attributes||{};if(t.CODECS)return io(t.CODECS)}(t)||[]);if(ng(e,t)&&!n.audio&&!function(e,t){if(!ng(e,t))return!0;var i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(var r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1}(e,t)){var r=rg(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return io(r.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},ag=gf("PlaylistSelector"),lg=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},ug=function(e,t){if(!e)return"";var i=bn.getComputedStyle(e);return i?i[t]:""},cg=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},hg=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||bn.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||bn.Number.MAX_VALUE)},dg=function(e,t,i,n,r,o){if(e){var s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},a=e.playlists;Gf.isAudioOnly(e)&&(a=o.getAudioTrackPlaylists_(),s.audioOnly=!0);var l=a.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||bn.Number.MAX_VALUE,width:t,height:i,playlist:e}}));cg(l,(function(e,t){return e.bandwidth-t.bandwidth}));var u=(l=l.filter((function(e){return!Gf.isIncompatible(e.playlist)}))).filter((function(e){return Gf.isEnabled(e.playlist)}));u.length||(u=l.filter((function(e){return!Gf.isDisabled(e.playlist)})));var c=u.filter((function(e){return e.bandwidth*Am.BANDWIDTH_VARIANCEi||e.height>n}))).filter((function(e){return e.width===v[0].width&&e.height===v[0].height})),h=y[y.length-1],_=y.filter((function(e){return e.bandwidth===h.bandwidth}))[0]),o.experimentalLeastPixelDiffSelector){var T=m.map((function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e}));cg(T,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),b=T[0]}var w=b||_||C||d||u[0]||l[0];if(w&&w.playlist){var E="sortedPlaylistReps";return b?E="leastPixelDiffRep":_?E="resolutionPlusOneRep":C?E="resolutionBestRep":d?E="bandwidthBestRep":u[0]&&(E="enabledPlaylistReps"),ag("choosing "+lg(w)+" using "+E+" with options",s),w.playlist}return ag("could not choose a playlist with options",s),null}},pg=function(){var e=this.useDevicePixelRatio&&bn.devicePixelRatio||1;return dg(this.playlists.master,this.systemBandwidth,parseInt(ug(this.tech_.el(),"width"),10)*e,parseInt(ug(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},fg=function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var o=bn.WebKitDataCue||bn.VTTCue,s=t.metadataTrack_;if(s&&(i.forEach((function(e){var t=e.cueTime+n;!("number"!=typeof t||bn.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var i=new o(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return hf.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return hf.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return hf.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(i),s.addCue(i)}))})),s.cues&&s.cues.length)){for(var a=s.cues,l=[],u=0;u=e&&r.endTime<=t&&i.removeCue(r)},gg=function(e){return"number"==typeof e&&isFinite(e)},vg=1/60,yg=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,o=e.playlist,s=o.mediaSequence,a=o.id,l=o.segments,u=void 0===l?[]:l,c=e.mediaIndex,h=e.partIndex,d=e.timeline,p=u.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"==typeof h,g=e.segment.uri?"segment":"pre-segment",v=m?If({preloadSegment:n})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+h+"/"+v+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+d+"] selected by ["+f+"] playlist ["+a+"]"},_g=function(e){return e+"TimingInfo"},bg=function(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,o=e.audioDisabled;if(i===n)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==n}if("main"===r&&o){var a=t.pendingTimelineChange({type:"audio"});return!a||a.to!==n}return!1},Cg=function(e){var t=e.segmentDuration,i=e.maxDuration;return!!t&&Math.round(t)>i+vf},Tg=function(e,t){if("hls"!==t)return null;var i,n,r=(i={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},n=0,["video","audio"].forEach((function(e){var t=i[e+"TimingInfo"];if(t){var r,o=t.start,s=t.end;"bigint"==typeof o||"bigint"==typeof s?r=bn.BigInt(s)-bn.BigInt(o):"number"==typeof o&&"number"==typeof s&&(r=s-o),void 0!==r&&r>n&&(n=r)}})),"bigint"==typeof n&&n=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",(function(){n.isEndOfStream_()||(n.ended_=!1)})),n.fetchAtBuffer_=!1,n.logger_=gf("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(An(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",(function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),n}In(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return Fm({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&bn.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,bn.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Bm(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return hf.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=fm(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=mm(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var o=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+o+"]"),null!==this.mediaIndex)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var a=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=a}}n&&(n.mediaIndex-=o,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(bn.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&Bm(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,o=function(){0===--r&&i()};for(var s in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,o)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil((t-n)*Zl),o=Math.ceil((i-n)*Zl),s=e.slice(),a=e.length;a--&&!(e[a].pts<=o););if(-1===a)return s;for(var l=a+1;l--&&!(e[l].pts<=r););return l=Math.max(l,0),s.splice(l,a-l+1),s}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,o)),this.inbandTextTracks_)mg(e,t,this.inbandTextTracks_[s]);mg(e,t,this.segmentMetadataTrack_),o()}else this.logger_("skipping remove because no source updater or starting media info")},i.monitorBuffer_=function(){this.checkBufferTimeout_&&bn.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=bn.setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&bn.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=bn.setTimeout(this.monitorBufferTick_.bind(this),500)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,o=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&o},i.chooseNextRequest_=function(){var e=this.buffered_(),t=Ef(e)||0,i=Sf(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),o=this.playlist_.segments;if(!o.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,o=0;oi))return o}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,o,t);else if(null!==this.mediaIndex){var a=o[this.mediaIndex],l="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=a.end?a.end:t,a.parts&&a.parts[l+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=l+1):s.mediaIndex=this.mediaIndex+1}else{var u=Gf.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=u.segmentIndex,h=u.startTime,d=u.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=h,s.partIndex=d}var p=o[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!i&&f&&!f.independent)if(0===s.partIndex){var m=o[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var v=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=o.length-1&&v&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.independent,i=e.playlist,n=e.mediaIndex,r=e.startOfSegment,o=e.isSyncRequest,s=e.partIndex,a=e.forceTimestampOffset,l=e.getMediaInfoForTime,u=i.segments[n],c="number"==typeof s&&u.parts[s],h={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:c?s:null,isSyncRequest:o,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},d=void 0!==a?a:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:d});var p=Ef(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=function(e,t,i){if(null==t||!e.length)return[];var n,r=Math.ceil((t-i+3)*Zl);for(n=0;nr);n++);return e.slice(n)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h},i.timestampOffsetForSegment_=function(e){return i=(t=e).segmentTimeline,n=t.currentTimeline,r=t.startOfSegment,o=t.buffered,t.overrideCheck||i!==n?i "+s+" for "+e),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var o=i,s=i,a=!1,l=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];l&&(o=l.label,s=l.language,a=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:a,label:o,language:s},!1).track}}}(l,i.vhs_.tech_,e),mg(o,s,l[e]),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=bn.WebKitDataCue||bn.VTTCue;i.forEach((function(e){var i=e.stream;t[i].addCue(new r(e.startTime+n,e.endTime+n,e.text))}))}}({captionArray:a,inbandTextTracks:l,timestampOffset:n})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,i,this.vhs_.tech_),fg({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!bg({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!bg({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[_g(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),o="main"===this.loaderType_&&r&&r.hasVideo;o&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:o,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var o=fm(n);if(this.activeInitSegmentId_===o)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=o}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,o=e.bytes,s=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+wf(s).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+wf(a).join(", "));var l=s.length?s.start(0):0,u=s.length?s.end(s.length-1):0,c=a.length?a.start(0):0,h=a.length?a.end(a.length-1):0;if(u-l<=1&&h-c<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+o.byteLength+", audio buffer: "+wf(s).join(", ")+", video buffer: "+wf(a).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:o}));var d=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+d),this.remove(0,d,(function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=bn.setTimeout((function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()}),1e3)}),!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}))},i.appendToSourceBuffer_=function(e){var t,i,n,r=e.segmentInfo,o=e.type,s=e.initSegment,a=e.data,l=e.bytes;if(!l){var u=[a],c=a.byteLength;s&&(u.unshift(s),c+=s.byteLength),n=0,(t={bytes:c,segments:u}).bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach((function(e){i.set(e,n),n+=e.byteLength}))),l=i}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:o,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:r,type:o,bytes:l}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var i=Sn({},e,{forceTimestampOffset:!0});Sn(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,o=e.timeline!==this.currentTimeline_&&e.timeline>0,s=n||r&&o;this.logger_("Requesting "+yg(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=tg({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,o=i.stream;t.logger_(yg(e)+" logged from transmuxer stream "+o+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t=function(e,t,i){var n=t-Am.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var o=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=o}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},i.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,o=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,a=e.videoTimingInfo,l=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return l.start;var u=i.segments[n-1];return 0!==n&&u&&void 0!==u.start&&u.end===r+o?a.start:r},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,o="main"===this.loaderType_&&n,s=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);o&&e.waitingOnAppends++,s&&e.waitingOnAppends++,o&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},i.checkForIllegalMediaSwitch=function(e){var t=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},i.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,i=e.audioTimingInfo,n=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i&&"number"==typeof i.transmuxedDecodeStart?i.transmuxedDecodeStart:n.start:n.start},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Tg(e,this.sourceType_);if(t&&("warn"===t.severity?hf.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+yg(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,o=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||o)return this.logger_("bad "+(r?"segment":"part")+" "+yg(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+yg(e))},i.recordThroughput_=function(e){if(e.duration=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Vm&&this.handleTimeout_(),e.code===Gm?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var o=r.segment;if(o.map&&(o.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof bn.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,a=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"})};return s=function(){n.subtitlesTrack_.tech_.off("vttjserror",a),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",a)}o.requested=!0;try{this.parseVTTCues_(r)}catch($v){return void this.stopForError({message:$v.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=o.duration,r.cues.forEach((function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new bn.VTTCue(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[o]);n.length&&n.forEach((function(t){return e.removeCue(t)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"==typeof bn.TextDecoder?t=new bn.TextDecoder("utf8"):(t=bn.WebVTT.StringDecoder(),i=!0);var n=new bn.WebVTT.Parser(bn,bn.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){hf.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=zg(r)),n.parse(r)}var o=e.bytes;i&&(o=zg(o)),n.parse(o),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,o=r.MPEGTS/Zl-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=o,e.endTime+=o})),!i.syncInfo){var s=e.cues[0].startTime,a=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,a-n.duration)}}}else n.empty=!0},t}(wg),Xg=function(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r}return null},Zg=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var o=null,s=null,a=Af(t);r=r||0;for(var l=0;l=d)&&(s=d,o={time:h,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return o}},{name:"Discontinuity",run:function(e,t,i,n,r){var o=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,a=0;a=h)&&(s=h,o={time:c.time,segmentIndex:l,partIndex:null})}}return o}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Qg=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=gf("SyncController"),i}In(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+Of({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],o=0;o86400)hf.log.warn("Not saving expired segment info. Media sequence gap "+i+" is too large.");else for(var n=i-1;n>=0;n--){var r=e.segments[n];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var o=r.dateTimeObject;r.discontinuity&&i&&o&&(this.timelineToDatetimeMappings[r.timeline]=-o.getTime()/1e3)},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,o=e.segment,s=e.part,a=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+a.time+"] [mapping: "+a.mapping+"]")),n=e.startOfSegment,r=t.end+a.mapping;else{if(!a)return!1;n=t.start+a.mapping,r=t.end+a.mapping}return s&&(s.start=n,s.end=r),(!o.start||na){var l=void 0;l=s<0?i.start-Of({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+Of({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[o]={time:l,accuracy:a}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(hf.EventTarget),Kg=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}In(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(hf.EventTarget),Jg=Im(Mm(Lm((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var i=t((function(e){function t(e,t){for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>7))^e]=e;for(t=i=0;!h[t];t^=n||1,i=f[i]||1)for(o=(o=i^i<<1^i<<2^i<<3^i<<4)>>8^255&o^99,h[t]=o,d[o]=t,a=16843009*p[r=p[n=p[t]]]^65537*r^257*n^16843008*t,s=257*p[o]^16843008*o,e=0;e<4;e++)u[e][t]=s=s<<24^s>>>8,c[e][o]=a=a<<24^a>>>8;for(e=0;e<5;e++)u[e]=u[e].slice(0),c[e]=c[e].slice(0);return l}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],o=this._tables[1],s=e.length,l=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var u=e.slice(0),c=[];for(this._key=[u,c],t=s;t<4*s+28;t++)n=u[t-1],(t%s==0||8===s&&t%s==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),u[t]=u[t-s]^n;for(i=0;t;i++,t--)n=u[3&i?t:t-4],c[i]=t<=4||i<4?n:o[0][r[n>>>24]]^o[1][r[n>>16&255]]^o[2][r[n>>8&255]]^o[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,o){var s,a,l,u,c=this._key[1],h=e^c[0],d=n^c[1],p=i^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],C=v[3],T=v[4];for(u=0;u>>24]^_[d>>16&255]^b[p>>8&255]^C[255&f]^c[g],a=y[d>>>24]^_[p>>16&255]^b[f>>8&255]^C[255&h]^c[g+1],l=y[p>>>24]^_[f>>16&255]^b[h>>8&255]^C[255&d]^c[g+2],f=y[f>>>24]^_[h>>16&255]^b[d>>8&255]^C[255&p]^c[g+3],g+=4,h=s,d=a,p=l;for(u=0;u<4;u++)r[(3&-u)+o]=T[h>>>24]<<24^T[d>>16&255]<<16^T[p>>8&255]<<8^T[255&f]^c[g++],s=h,h=d,d=p,p=f,f=s},e}(),u=function(e){function t(){var t;return(t=e.call(this,o)||this).jobs=[],t.delay=1,t.timeout_=null,t}r(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(o),c=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},h=function(){function e(t,i,n,r){var o=e.STEP,s=new Int32Array(t.buffer),a=new Uint8Array(t.byteLength),l=0;for(this.asyncStream_=new u,this.asyncStream_.push(this.decryptChunk_(s.subarray(l,l+o),i,n,a)),l=o;l>2),m=new l(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(n=i[0],r=i[1],o=i[2],s=i[3],p=0;p=0&&(t="main-desc"),t},ev=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},tv=function(e,t){t.activePlaylistLoader=e,e.load()},iv={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;ev(i,n);var o=n.activeTrack(),s=n.activeGroup(),a=(s.filter((function(e){return e.default}))[0]||s[0]).id,l=n.tracks[a];if(o!==l){for(var u in hf.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[u].enabled=n.tracks[u]===l;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];hf.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),ev(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},nv={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,o=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();o.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&o.load()})),t.on("loadedplaylist",(function(){o.playlist(t.media(),r),n.paused()||o.load()})),t.on("error",iv[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,o=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();o.playlist(e,r),o.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&o.load()})),t.on("loadedplaylist",(function(){o.playlist(t.media(),r),n.paused()||o.load()})),t.on("error",iv[e](e,i))}},rv={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],o=t.requestOptions,s=t.master.mediaGroups,a=t.mediaTypes[e],l=a.groups,u=a.tracks,c=a.logger_,h=t.masterPlaylistLoader,d=Vf(h.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},d&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var f in l[p]||(l[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(d?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new rm(m.playlists[0],i,o):m.resolvedUri?new rm(m.resolvedUri,i,o):m.playlists&&"dash"===n?new Pm(m.playlists[0],i,o,h):null,m=hf.mergeOptions({id:f,playlistLoader:g},m),nv[e](e,m.playlistLoader,t),l[p].push(m),void 0===u[f]){var v=new hf.AudioTrack({id:f,kind:$g(m),enabled:!1,language:m.language,default:m.default,label:f});u[f]=v}}r.on("error",iv[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,o=t.segmentLoaders[e],s=t.requestOptions,a=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,c=l.tracks,h=t.masterPlaylistLoader;for(var d in a[e])for(var p in u[d]||(u[d]=[]),a[e][d])if(!a[e][d][p].forced){var f=a[e][d][p],m=void 0;if("hls"===r)m=new rm(f.resolvedUri,n,s);else if("dash"===r){if(!f.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new Pm(f.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new rm(f.playlists?f.playlists[0]:f.resolvedUri,n,s));if(f=hf.mergeOptions({id:p,playlistLoader:m},f),nv[e](e,f.playlistLoader,t),u[d].push(f),void 0===c[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}o.on("error",iv[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],o=r.groups,s=r.tracks;for(var a in n[e])for(var l in o[a]||(o[a]=[]),n[e][a]){var u=n[e][a][l];if(/^(?:CC|SERVICE)/.test(u.instreamId)){var c=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:l,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(c[h.instreamId]&&(h=hf.mergeOptions(h,c[h.instreamId])),void 0===h.default&&delete h.default,o[a].push(hf.mergeOptions({id:l},u)),void 0===s[l]){var d=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[l]=d}}}}},ov=function e(t,i){for(var n=0;n1&&Vf(t.master))for(var l=0;l "+o+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=bn.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(bn.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var o=n.main||r.length&&n[r[0]];for(var s in o)if(o[s].default){i={label:s};break}}if(!i)return t;var a=[];for(var l in n)if(n[l][i.label]){var u=n[l][i.label];if(u.playlists&&u.playlists.length)a.push.apply(a,u.playlists);else if(u.uri)a.push(u);else if(e.playlists.length)for(var c=0;c1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,i=e.buffered,n=e.currentTime,r=e.nextPlaylist,o=e.bufferLowWaterLine,s=e.bufferHighWaterLine,a=e.duration,l=e.experimentalBufferBasedABR,u=e.log;if(!r)return hf.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return u(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var h=Boolean(bf(i,n).length);if(!t.endList)return h||"number"!=typeof t.partTargetDuration?(u(c+" as current playlist is live"),!0):(u("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var d=Sf(i,n),p=l?Am.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Am.MAX_BUFFER_LOW_WATER_LINE;if(am)&&d>=o){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+d+" >= "+o+")";return l&&(v+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),u(v),!0}return u("not "+c+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){hf.browser.IE_VERSION||hf.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var l=this.selectPlaylist();if(!l)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var u=e.internal?this.logger_:hf.log.warn,c=e.message?" "+e.message:"";u((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+c+" Switching to playlist "+l.id+"."),l.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=l.targetDuration/2*1e3||5e3,d="number"==typeof l.lastRequest&&Date.now()-l.lastRequest<=h;return this.switchMedia_(l,"exclude",s||d)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var o=[];(r||"audio"===e)&&o.push("AUDIO"),(r||"subtitle"===e)&&(o.push("CLOSED-CAPTIONS"),o.push("SUBTITLES")),o.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=bf(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Sg.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Sg.Playlist.seekable(t,i,Sg.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Sg.Playlist.seekable(t,i,Sg.Playlist.liveEdgeDelay(n,t))).length)return}var o,s;this.seekable_&&this.seekable_.length&&(o=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=hf.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=sg(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||ao)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||ao,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var o,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,a=n[e],!(r?oo(a):so(a)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(o=i)}var r,a})),r&&o&&this.media().attributes.AUDIO){var a=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===a&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+a+" as "+o+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var l=[];if(["video","audio"].forEach((function(t){var i=(io(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(io(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&l.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),l.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+l.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var u=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:u,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var o=sg(e.master,r),s=[];!o.audio||so(o.audio)||oo(o.audio)||s.push("audio codec "+o.audio),!o.video||so(o.video)||oo(o.video)||s.push("video codec "+o.video),o.text&&"stpp.ttml.im1t"===o.text&&s.push("text codec "+o.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=rg(io(e)),o=og(r),s=r.video&&io(r.video)[0]||null,a=r.audio&&io(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var l=[],u=sg(t.masterPlaylistLoader_.master,r),c=og(u);if(u.audio||u.video){if(c!==o&&l.push('codec count "'+c+'" !== "'+o+'"'),!t.sourceUpdater_.canChangeType()){var h=u.video&&io(u.video)[0]||null,d=u.audio&&io(u.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&l.push('video codec "'+h.type+'" !== "'+s.type+'"'),d&&a&&d.type.toLowerCase()!==a.type.toLowerCase()&&l.push('audio codec "'+d.type+'" !== "'+a.type+'"')}l.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+l.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,o=0;o0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:yf)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Tf(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var r=this.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,a=r.videoBuffer?r.videoBuffered():null,l=this.media(),u=l.partTargetDuration?l.partTargetDuration:2*(l.targetDuration-vf),c=[s,a],h=0;h "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var o=Cf(r,t);if(o.length>0){var s=o.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+yf;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:o}}return null},e}(),fv={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},mv=function e(t,i){var n=0,r=0,o=hf.mergeOptions(fv,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},a=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},l=function(){return Date.now()-n<1e3*o.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):o.getSource&&"function"==typeof o.getSource?(n=Date.now(),o.getSource.call(t,a)):void hf.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},u=function e(){t.off("loadedmetadata",s),t.off("error",l),t.off("dispose",e)};t.on("error",l),t.on("dispose",u),t.reloadSourceOnError=function(i){u(),e(t,i)}},gv="2.14.3",vv={PlaylistLoader:rm,Playlist:Gf,utils:vm,STANDARD_PLAYLIST_SELECTOR:pg,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Gf.isEnabled);return cg(t,(function(e,t){return hg(e,t)})),t.filter((function(t){return!!sg(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:pg,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&bn.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),dg(this.playlists.master,t,parseInt(ug(this.tech_.el(),"width"),10)*n,parseInt(ug(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:hg,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||bn.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||bn.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:lm()};Object.keys(Am).forEach((function(e){Object.defineProperty(vv,e,{get:function(){return hf.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Am[e]},set:function(t){hf.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?hf.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Am[e]=t}})}));var yv="videojs-vhs",_v=function(e,t){for(var i=t.media(),n=-1,r=0;r=i&&e>=i?Math.max(e,n):n}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){hf.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return wf(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return wf(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!bn.localStorage)return!1;var t=Tv();t=t?hf.mergeOptions(t,e):e;try{bn.localStorage.setItem(yv,JSON.stringify(t))}catch($v){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=Vf(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!Nf(e)})).map((function(t,i){return new hv(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=bn.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),bv({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))},i.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Cv({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){if("output-restricted"===t.status){var i=e.masterPlaylistController_.master();if(i&&i.playlists){var n,r=[];if(i.playlists.forEach((function(e){e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,r.push(e))})),r.length)(n=hf.log).warn.apply(n,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(r)),e.masterPlaylistController_.fastQualityChange_()}}})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==hf.browser.IE_VERSION&&i?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=hf.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),_v(t,i.playlists)})),this.playlists.on("mediachange",(function(){_v(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":gv,"mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return Gg.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&bn.URL.revokeObjectURL&&(bn.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return ym({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),_m({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(hf.getComponent("Component")),Ev={name:"videojs-http-streaming",VERSION:gv,canHandleSource:function(e,t){void 0===t&&(t={});var i=hf.mergeOptions(hf.options,t);return Ev.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=hf.mergeOptions(hf.options,i);return t.vhs=new wv(e,t,n),hf.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return hf.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=lm(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=hf.mergeOptions(hf.options,t),n=i.vhs,r=(n=void 0===n?{}:n).overrideNative,o=void 0===r?!hf.browser.IS_ANY_SAFARI:r,s=i.hls,a=(s=void 0===s?{}:s).overrideNative,l=void 0!==a&&a,u=co(e);return u&&(!vv.supportsTypeNatively(u)||l||o)?"maybe":""}};(oo("avc1.4d400d,mp4a.40.2")&&hf.getTech("Html5").registerSourceHandler(Ev,0),hf.VhsHandler=wv,Object.defineProperty(hf,"HlsHandler",{get:function(){return hf.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),wv},configurable:!0}),hf.VhsSourceHandler=Ev,Object.defineProperty(hf,"HlsSourceHandler",{get:function(){return hf.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ev},configurable:!0}),hf.Vhs=vv,Object.defineProperty(hf,"Hls",{get:function(){return hf.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),vv},configurable:!0}),hf.use||(hf.registerComponent("Hls",vv),hf.registerComponent("Vhs",vv)),hf.options.vhs=hf.options.vhs||{},hf.options.hls=hf.options.hls||{},hf.getPlugin&&hf.getPlugin("reloadSourceOnError"))||(hf.registerPlugin||hf.plugin)("reloadSourceOnError",(function(e){mv(this,e)}));var Sv,kv=hf.getComponent("Tech"),Pv=hf.dom,Av=hf.url,xv=hf.createTimeRange,Iv=hf.mergeOptions,Mv=bn&&bn.navigator||{},Lv=function(e){function t(i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return i.source&&r.ready((function(){this.setSource(i.source)}),!0),i.startTime&&r.ready((function(){this.load(),this.play(),this.currentTime(i.startTime)}),!0),bn.videojs=bn.videojs||{},bn.videojs.Flash=bn.videojs.Flash||{},bn.videojs.Flash.onReady=t.onReady,bn.videojs.Flash.onEvent=t.onEvent,bn.videojs.Flash.onError=t.onError,r.on("seeked",(function(){this.lastSeekTarget_=void 0})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.createEl=function(){var e=this.options_;e.swf||(e.swf="https://vjs.zencdn.net/swf/5.4.2/video-js.swf");var i=e.techId,n=Iv({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:e.autoplay,preload:e.preload,loop:e.loop,muted:e.muted},e.flashVars),r=Iv({wmode:"opaque",bgcolor:"#000000"},e.params),o=Iv({id:i,name:i,class:"vjs-tech"},e.attributes);return this.el_=t.embed(e.swf,n,r,o),this.el_.tech=this,this.el_},t.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},t.prototype.pause=function(){this.el_.vjs_pause()},t.prototype.src=function(e){return void 0===e?this.currentSrc():this.setSrc(e)},t.prototype.setSrc=function(e){var t=this;e=Av.getAbsoluteURL(e),this.el_.vjs_src(e),this.autoplay()&&this.setTimeout((function(){return t.play()}),0)},t.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},t.prototype.setCurrentTime=function(t){var i=this.seekable();i.length&&(t=(t=t>i.start(0)?t:i.start(0))=0?e:1/0},t.prototype.load=function(){this.el_.vjs_load()},t.prototype.poster=function(){this.el_.vjs_getProperty("poster")},t.prototype.setPoster=function(){},t.prototype.seekable=function(){var e=this.duration();return 0===e?xv():xv(0,e)},t.prototype.buffered=function(){var e=this.el_.vjs_getProperty("buffered");return 0===e.length?xv():xv(e[0][0],e[0][1])},t.prototype.supportsFullScreen=function(){return!1},t.prototype.enterFullScreen=function(){return!1},t.prototype.getVideoPlaybackQuality=function(){var e=this.el_.vjs_getProperty("getVideoPlaybackQuality");return bn.performance&&"function"==typeof bn.performance.now?e.creationTime=bn.performance.now():bn.performance&&bn.performance.timing&&"number"==typeof bn.performance.timing.navigationStart&&(e.creationTime=bn.Date.now()-bn.performance.timing.navigationStart),e},t}(kv),Dv=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","loop","controls","volume","muted","defaultMuted"],Ov=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],jv=Lv.prototype;function Rv(e){var t=e.charAt(0).toUpperCase()+e.slice(1);jv["set"+t]=function(t){return this.el_.vjs_setProperty(e,t)}}function Nv(e){jv[e]=function(){return this.el_.vjs_getProperty(e)}}for(var Uv=0;Uv=10},kv.withSourceHandlers(Lv),Lv.nativeSourceHandler={},Lv.nativeSourceHandler.canPlayType=function(e){return e in Lv.formats?"maybe":""},Lv.nativeSourceHandler.canHandleSource=function(e,t){var i,n,r=void 0;return e.type?r=e.type.replace(/;.*/,"").toLowerCase():(i=e.src,r=(n=Av.getFileExtension(i))?"video/"+n:""),Lv.nativeSourceHandler.canPlayType(r)},Lv.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Lv.nativeSourceHandler.dispose=function(){},Lv.registerSourceHandler(Lv.nativeSourceHandler),Lv.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},Lv.onReady=function(e){var t=Pv.$("#"+e),i=t&&t.tech;i&&i.el()&&Lv.checkReady(i)},Lv.checkReady=function(e){e.el()&&(e.el().vjs_getProperty?e.triggerReady():this.setTimeout((function(){Lv.checkReady(e)}),50))},Lv.onEvent=function(e,t){var i=Pv.$("#"+e).tech,n=Array.prototype.slice.call(arguments,2);i.setTimeout((function(){i.trigger(t,n)}),1)},Lv.onError=function(e,t){var i=Pv.$("#"+e).tech;if("srcnotfound"===t)return i.error(4);"string"==typeof t?i.error("FLASH: "+t):(t.origin="flash",i.error(t))},Lv.version=function(){var e="0,0,0";try{e=new bn.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch($v){try{Mv.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(e=(Mv.plugins["Shockwave Flash 2.0"]||Mv.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(t){}}return e.split(",")},Lv.embed=function(e,t,i,n){var r=Lv.getEmbedCode(e,t,i,n);return Pv.createEl("div",{innerHTML:r}).childNodes[0]},Lv.getEmbedCode=function(e,t,i,n){var r="",o="",s="";return t&&Object.getOwnPropertyNames(t).forEach((function(e){r+=e+"="+t[e]+"&"})),i=Iv({movie:e,flashvars:r,allowScriptAccess:"always",allowNetworking:"all"},i),Object.getOwnPropertyNames(i).forEach((function(e){o+=''})),n=Iv({data:e,width:"100%",height:"100%"},n),Object.getOwnPropertyNames(n).forEach((function(e){s+=e+'="'+n[e]+'" '})),'"+o+""},(Sv=Lv).streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},Sv.streamFromParts=function(e,t){return e+"&"+t},Sv.streamToParts=function(e){var t={connection:"",stream:""};if(!e)return t;var i=e.search(/&(?![\w-]+=)/),n=void 0;return-1!==i?n=i+1:0===(i=n=e.lastIndexOf("/")+1)&&(i=n=e.length),t.connection=e.substring(0,i),t.stream=e.substring(n,e.length),t},Sv.isStreamingType=function(e){return e in Sv.streamingFormats},Sv.RTMP_RE=/^rtmp[set]?:\/\//i,Sv.isStreamingSrc=function(e){return Sv.RTMP_RE.test(e)},Sv.rtmpSourceHandler={},Sv.rtmpSourceHandler.canPlayType=function(e){return Sv.isStreamingType(e)?"maybe":""},Sv.rtmpSourceHandler.canHandleSource=function(e,t){var i=Sv.rtmpSourceHandler.canPlayType(e.type);return i||(Sv.isStreamingSrc(e.src)?"maybe":"")},Sv.rtmpSourceHandler.handleSource=function(e,t,i){var n=Sv.streamToParts(e.src);t.setRtmpConnection(n.connection),t.setRtmpStream(n.stream)},Sv.registerSourceHandler(Sv.rtmpSourceHandler),kv.getTech("Flash")?(hf.log.warn("Not using videojs-flash as it appears to already be registered"),hf.log.warn("videojs-flash should only be used with video.js@6 and above")):hf.registerTech("Flash",Lv),Lv.VERSION="2.2.1";var Fv={exports:{}};!function(e,t){var i;self,i=function(){return function(){var e={"./node_modules/es6-promise/dist/es6-promise.js":function(e,t,i){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ e.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,o=void 0,s=void 0,a=function(e,t){b[r]=e,b[r+1]=t,2===(r+=2)&&(s?s(C):w())};function l(e){s=e}function u(e){a=e}var c="undefined"!=typeof window?window:void 0,h=c||{},d=h.MutationObserver||h.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function m(){return function(){return process.nextTick(C)}}function g(){return void 0!==o?function(){o(C)}:_()}function v(){var e=0,t=new d(C),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function y(){var e=new MessageChannel;return e.port1.onmessage=C,function(){return e.port2.postMessage(0)}}function _(){var e=setTimeout;return function(){return e(C,1)}}var b=new Array(1e3);function C(){for(var e=0;e0&&s.length>r&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=c.bind(n);return r.listener=i,n.wrapFn=r,r}function d(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var u=l.length,c=f(l,u);for(i=0;i=0;o--)if(i[o]===t||i[o].listener===t){s=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},"./node_modules/webworkify-webpack/index.js":function(e,t,i){function n(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var n=i(i.s=ENTRY_MODULE);return n.default||n}var r="[\\.|\\-|\\+|\\w|/|@]+",o="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function s(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(e,t,n){var a={};a[n]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return a;for(var c,h=u[1],d=new RegExp("(\\\\n|\\W)"+s(h)+o,"g");c=d.exec(l);)"dll-reference"!==c[3]&&a[n].push(c[3]);for(d=new RegExp("\\("+s(h)+'\\("(dll-reference\\s('+r+'))"\\)\\)'+o,"g");c=d.exec(l);)e[c[2]]||(a[n].push(c[1]),e[c[2]]=i(c[1]).m),a[c[2]]=a[c[2]]||[],a[c[2]].push(c[4]);for(var p,f=Object.keys(a),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var r={main:i.m},o=t.all?{main:Object.keys(r.main)}:function(e,t){for(var i={main:[t]},n={main:[]},r={main:{}};l(i);)for(var o=Object.keys(i),s=0;s=e[r]&&t0&&e[0].originalDts=t[r].dts&&et[n].lastSample.originalDts&&e=t[n].lastSample.originalDts&&(n===t.length-1||n0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},"./src/core/mse-controller.js":function(e,t,i){i.r(t);var n=i("./node_modules/events/events.js"),r=i.n(n),o=i("./src/utils/logger.js"),s=i("./src/utils/browser.js"),a=i("./src/core/mse-events.js"),l=i("./src/core/media-segment-info.js"),u=i("./src/utils/exception.js"),c=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(r()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new l.IDRSampleList}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new u.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(r){o.default.e(this.TAG,r.message)}n.removeEventListener("error",this.e.onSourceBufferError),n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(r){o.default.e(this.TAG,r.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var i=e,n=""+i.container;i.codec&&i.codec.length>0&&(n+=";codecs="+i.codec);var r=!1;if(o.default.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])o.default.v(this.TAG,"Notice: "+i.type+" mimeType changed, origin: "+this._mimeTypes[i.type]+", target: "+n);else{r=!0;try{var l=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);l.addEventListener("error",this.e.onSourceBufferError),l.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(u){return o.default.e(this.TAG,u.message),void this._emitter.emit(a.default.ERROR,{code:u.code,msg:u.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),r||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),s.default.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var i=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{i.abort()}catch(c){o.default.e(this.TAG,c.message)}this._idrList.clear();var n=this._pendingSegments[t];if(n.splice(0,n.length),"closed"!==this._mediaSource.readyState){for(var r=0;r=1&&e-n.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){for(var n=i.buffered,r=!1,o=0;o=this._config.autoCleanupMaxBackwardDuration){r=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:s,end:l})}}else a0&&(isNaN(t)||i>t)&&(o.default.v(this.TAG,"Update MediaSource duration from "+t+" to "+i),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];i.length&&!t.updating;){var n=i.shift();t.remove(n.start,n.end)}},e.prototype._doAppendSegments=function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var i=e[t].shift();if(i.timestampOffset){var n=this._sourceBuffers[t].timestampOffset,r=i.timestampOffset/1e3;Math.abs(n-r)>.1&&(o.default.v(this.TAG,"Update MPEG audio timestampOffset from "+n+" to "+r),this._sourceBuffers[t].timestampOffset=r),delete i.timestampOffset}if(!i.data||0===i.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(i.data),this._isBufferFull=!1,"video"===t&&i.hasOwnProperty("info")&&this._idrList.appendArray(i.info.syncPoints)}catch(s){this._pendingSegments[t].unshift(i),22===s.code?(this._isBufferFull||this._emitter.emit(a.default.BUFFER_FULL),this._isBufferFull=!0):(o.default.e(this.TAG,s.message),this._emitter.emit(a.default.ERROR,{code:s.code,msg:s.message}))}}},e.prototype._onSourceOpen=function(){if(o.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(a.default.SOURCE_OPEN)},e.prototype._onSourceEnded=function(){o.default.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){o.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(a.default.UPDATE_END)},e.prototype._onSourceBufferError=function(e){o.default.e(this.TAG,"SourceBuffer Error: "+e)},e}();t.default=c},"./src/core/mse-events.js":function(e,t,i){i.r(t),t.default={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"}},"./src/core/transmuxer.js":function(e,t,i){i.r(t);var n=i("./node_modules/events/events.js"),r=i.n(n),o=i("./node_modules/webworkify-webpack/index.js"),s=i.n(o),a=i("./src/utils/logger.js"),l=i("./src/utils/logging-control.js"),u=i("./src/core/transmuxing-controller.js"),c=i("./src/core/transmuxing-events.js"),h=i("./src/core/media-info.js"),d=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(r()),t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=s()("./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},l.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:l.default.getConfig()})}catch(n){a.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new u.default(e,t)}else this._controller=new u.default(e,t);if(this._controller){var i=this._controller;i.on(c.default.IO_ERROR,this._onIOError.bind(this)),i.on(c.default.DEMUX_ERROR,this._onDemuxError.bind(this)),i.on(c.default.INIT_SEGMENT,this._onInitSegment.bind(this)),i.on(c.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),i.on(c.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),i.on(c.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),i.on(c.default.MEDIA_INFO,this._onMediaInfo.bind(this)),i.on(c.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),i.on(c.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),i.on(c.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),i.on(c.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),l.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},e.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},e.prototype.seek=function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)},e.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},e.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(c.default.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(c.default.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(c.default.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(c.default.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(c.default.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(c.default.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(c.default.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(c.default.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(c.default.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(c.default.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(c.default.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case c.default.INIT_SEGMENT:case c.default.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case c.default.LOADING_COMPLETE:case c.default.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case c.default.MEDIA_INFO:Object.setPrototypeOf(i,h.default.prototype),this._emitter.emit(t.msg,i);break;case c.default.METADATA_ARRIVED:case c.default.SCRIPTDATA_ARRIVED:case c.default.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case c.default.IO_ERROR:case c.default.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case c.default.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":a.default.emitter.emit("log",i.type,i.logcat)}},e}();t.default=d},"./src/core/transmuxing-controller.js":function(e,t,i){i.r(t);var n=i("./node_modules/events/events.js"),r=i.n(n),o=i("./src/utils/logger.js"),s=i("./src/utils/browser.js"),a=i("./src/core/media-info.js"),l=i("./src/demux/flv-demuxer.js"),u=i("./src/remux/mp4-remuxer.js"),c=i("./src/demux/demux-errors.js"),h=i("./src/io/io-controller.js"),d=i("./src/core/transmuxing-events.js"),p=function(){function e(e,t){this.TAG="TransmuxingController",this._emitter=new(r()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach((function(n){n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)})),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){this._currentSegmentIndex=e;var i=this._mediaDataSource.segments[e],n=this._ioctl=new h.default(i,this._config,e);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var i=this._mediaInfo.segments[t];if(null==i)this._pendingSeekTime=e;else{var n=i.getNearestKeyframe(e);this._remuxer.seek(n.milliseconds),this._ioctl.seek(n.fileposition),this._pendingResolveSeekPoint=n.milliseconds}}else{var r=this._mediaInfo.segments[t];null==r?(this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t)):(n=r.getNearestKeyframe(e),this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,i=t.length-1,n=0;n0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((n=l.default.probe(e)).match){this._demuxer=new l.default(n,this._config),this._remuxer||(this._remuxer=new u.default(this._config));var s=this._mediaDataSource;null==s.duration||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),"boolean"==typeof s.hasAudio&&(this._demuxer.overridedHasAudio=s.hasAudio),"boolean"==typeof s.hasVideo&&(this._demuxer.overridedHasVideo=s.hasVideo),this._demuxer.timestampBase=s.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else n=null,o.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){i._internalAbort()})),this._emitter.emit(d.default.DEMUX_ERROR,c.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r},e.prototype._onMediaInfo=function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,a.default.prototype));var i=Object.assign({},e);Object.setPrototypeOf(i,a.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=i,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(d.default.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(d.default.SCRIPTDATA_ARRIVED,e)},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e+1;t0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(d.default.RECOMMEND_SEEKPOINT,n)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t=this._mediaInfo.segments[e],i=Object.assign({},t);i.duration=this._mediaInfo.duration,i.segmentCount=this._mediaInfo.segmentCount,delete i.segments,delete i.keyframesIndex,this._emitter.emit(d.default.MEDIA_INFO,i)},e.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(d.default.STATISTICS_INFO,e)},e}();t.default=p},"./src/core/transmuxing-events.js":function(e,t,i){i.r(t),t.default={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},"./src/core/transmuxing-worker.js":function(e,t,i){i.r(t);var n=i("./src/utils/logging-control.js"),r=i("./src/utils/polyfill.js"),o=i("./src/core/transmuxing-controller.js"),s=i("./src/core/transmuxing-events.js");t.default=function(e){var t=null,i=function(t,i){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:i}})}.bind(this);function a(t,i){var n={msg:s.default.INIT_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function l(t,i){var n={msg:s.default.MEDIA_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function u(){var t={msg:s.default.LOADING_COMPLETE};e.postMessage(t)}function c(){var t={msg:s.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function h(t){var i={msg:s.default.MEDIA_INFO,data:t};e.postMessage(i)}function d(t){var i={msg:s.default.METADATA_ARRIVED,data:t};e.postMessage(i)}function p(t){var i={msg:s.default.SCRIPTDATA_ARRIVED,data:t};e.postMessage(i)}function f(t){var i={msg:s.default.STATISTICS_INFO,data:t};e.postMessage(i)}function m(t,i){e.postMessage({msg:s.default.IO_ERROR,data:{type:t,info:i}})}function g(t,i){e.postMessage({msg:s.default.DEMUX_ERROR,data:{type:t,info:i}})}function v(t){e.postMessage({msg:s.default.RECOMMEND_SEEKPOINT,data:t})}r.default.install(),e.addEventListener("message",(function(r){switch(r.data.cmd){case"init":(t=new o.default(r.data.param[0],r.data.param[1])).on(s.default.IO_ERROR,m.bind(this)),t.on(s.default.DEMUX_ERROR,g.bind(this)),t.on(s.default.INIT_SEGMENT,a.bind(this)),t.on(s.default.MEDIA_SEGMENT,l.bind(this)),t.on(s.default.LOADING_COMPLETE,u.bind(this)),t.on(s.default.RECOVERED_EARLY_EOF,c.bind(this)),t.on(s.default.MEDIA_INFO,h.bind(this)),t.on(s.default.METADATA_ARRIVED,d.bind(this)),t.on(s.default.SCRIPTDATA_ARRIVED,p.bind(this)),t.on(s.default.STATISTICS_INFO,f.bind(this)),t.on(s.default.RECOMMEND_SEEKPOINT,v.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(r.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var y=r.data.param;n.default.applyConfig(y),!0===y.enableCallback?n.default.addLogListener(i):n.default.removeLogListener(i)}}))}},"./src/demux/amf-parser.js":function(e,t,i){i.r(t);var n,r=i("./src/utils/logger.js"),o=i("./src/utils/utf8-conv.js"),s=i("./src/utils/exception.js"),a=(n=new ArrayBuffer(2),new DataView(n).setInt16(0,256,!0),256===new Int16Array(n)[0]),l=function(){function e(){}return e.parseScriptData=function(t,i,n){var o={};try{var s=e.parseValue(t,i,n),a=e.parseValue(t,i+s.size,n-s.size);o[s.data]=a.data}catch($v){r.default.e("AMF",$v.toString())}return o},e.parseObject=function(t,i,n){if(n<3)throw new s.IllegalStateException("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),o=e.parseValue(t,i+r.size,n-r.size),a=o.objectEnd;return{data:{name:r.data,value:o.data},size:r.size+o.size,objectEnd:a}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new s.IllegalStateException("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!a);return{data:n>0?(0,o.default)(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new s.IllegalStateException("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!a);return{data:n>0?(0,o.default)(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new s.IllegalStateException("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!a),o=n.getInt16(8,!a);return{data:new Date(r+=60*o*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new s.IllegalStateException("Data not enough when parse Value");var o,l=new DataView(t,i,n),u=1,c=l.getUint8(0),h=!1;try{switch(c){case 0:o=l.getFloat64(1,!a),u+=8;break;case 1:o=!!l.getUint8(1),u+=1;break;case 2:var d=e.parseString(t,i+1,n-1);o=d.data,u+=d.size;break;case 3:o={};var p=0;for(9==(16777215&l.getUint32(n-4,!a))&&(p=3);u32)throw new n.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var o=Math.min(r,this._current_word_bits_left),s=this._current_word>>>32-o;return this._current_word<<=o,this._current_word_bits_left-=o,i=i<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}();t.default=r},"./src/demux/flv-demuxer.js":function(e,t,i){i.r(t);var n=i("./src/utils/logger.js"),r=i("./src/demux/amf-parser.js"),o=i("./src/demux/sps-parser.js"),s=i("./src/demux/demux-errors.js"),a=i("./src/core/media-info.js"),l=i("./src/utils/exception.js"),u=function(){function e(e,t){var i;this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new a.default,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=(i=new ArrayBuffer(2),new DataView(i).setInt16(0,256,!0),256===new Int16Array(i)[0])}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e),i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var n,r,o=(4&t[4])>>>2!=0,s=0!=(1&t[4]),a=(n=t)[r=5]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:o,hasVideoTrack:s}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new a.default},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new l.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0,o=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;r=e.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,i+r!==this._dataOffset&&n.default.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(s=new DataView(t,r)).getUint32(0,!o)&&n.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),r+=4);rt.byteLength)break;var a=s.getUint8(0),u=16777215&s.getUint32(0,!o);if(r+11+u+4>t.byteLength)break;if(8===a||9===a||18===a){var c=s.getUint8(4),h=s.getUint8(5),d=s.getUint8(6)|h<<8|c<<16|s.getUint8(7)<<24;0!=(16777215&s.getUint32(7,!o))&&n.default.w(this.TAG,"Meet tag which has StreamID != 0!");var p=r+11;switch(a){case 8:this._parseAudioData(t,p,u,d);break;case 9:this._parseVideoData(t,p,u,d,i+r);break;case 18:this._parseScriptData(t,p,u)}var f=s.getUint32(11+u,!o);f!==11+u&&n.default.w(this.TAG,"Invalid PrevTagSize "+f),r+=11+u+4}else n.default.w(this.TAG,"Unsupported tag type "+a+", skipped"),r+=11+u+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),r},e.prototype._parseScriptData=function(e,t,i){var o=r.default.parseScriptData(e,t,i);if(o.hasOwnProperty("onMetaData")){if(null==o.onMetaData||"object"!=typeof o.onMetaData)return void n.default.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&n.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=o;var s=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},s)),"boolean"==typeof s.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=s.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof s.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=s.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof s.audiodatarate&&(this._mediaInfo.audioDataRate=s.audiodatarate),"number"==typeof s.videodatarate&&(this._mediaInfo.videoDataRate=s.videodatarate),"number"==typeof s.width&&(this._mediaInfo.width=s.width),"number"==typeof s.height&&(this._mediaInfo.height=s.height),"number"==typeof s.duration){if(!this._durationOverrided){var a=Math.floor(s.duration*this._timescale);this._duration=a,this._mediaInfo.duration=a}}else this._mediaInfo.duration=0;if("number"==typeof s.framerate){var l=Math.floor(1e3*s.framerate);if(l>0){var u=l/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=l,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=u}}if("object"==typeof s.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var c=s.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(c),s.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=s,n.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(o).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},o))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n>>4;if(2===a||10===a){var l=0,u=(12&o)>>>2;if(u>=0&&u<=4){l=this._flvSoundRateTable[u];var c=1&o,h=this._audioMetadata,d=this._audioTrack;if(h||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(h=this._audioMetadata={}).type="audio",h.id=d.id,h.timescale=this._timescale,h.duration=this._duration,h.audioSampleRate=l,h.channelCount=0===c?1:2),10===a){var p=this._parseAACAudioData(e,t+1,i-1);if(null==p)return;if(0===p.packetType){h.config&&n.default.w(this.TAG,"Found another AudioSpecificConfig!");var f=p.data;h.audioSampleRate=f.samplingRate,h.channelCount=f.channelCount,h.codec=f.codec,h.originalCodec=f.originalCodec,h.config=f.config,h.refSampleDuration=1024/h.audioSampleRate*h.timescale,n.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",h),(v=this._mediaInfo).audioCodec=h.originalCodec,v.audioSampleRate=h.audioSampleRate,v.audioChannelCount=h.channelCount,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&this._onMediaInfo(v)}else if(1===p.packetType){var m=this._timestampBase+r,g={unit:p.data,length:p.data.byteLength,dts:m,pts:m};d.samples.push(g),d.length+=p.data.length}else n.default.e(this.TAG,"Flv: Unsupported AAC data type "+p.packetType)}else if(2===a){if(!h.codec){var v;if(null==(f=this._parseMP3AudioData(e,t+1,i-1,!0)))return;h.audioSampleRate=f.samplingRate,h.channelCount=f.channelCount,h.codec=f.codec,h.originalCodec=f.originalCodec,h.refSampleDuration=1152/h.audioSampleRate*h.timescale,n.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h),(v=this._mediaInfo).audioCodec=h.codec,v.audioSampleRate=h.audioSampleRate,v.audioChannelCount=h.channelCount,v.audioDataRate=f.bitRate,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&this._onMediaInfo(v)}var y=this._parseMP3AudioData(e,t+1,i-1,!1);if(null==y)return;m=this._timestampBase+r;var _={unit:y,length:y.byteLength,dts:m,pts:m};d.samples.push(_),d.length+=y.length}}else this._onError(s.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+u)}else this._onError(s.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+a)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var r={},o=new Uint8Array(e,t,i);return r.packetType=o[0],0===o[0]?r.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):r.data=o.subarray(1),r}n.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,r,o=new Uint8Array(e,t,i),a=null,l=0,u=null;if(l=n=o[0]>>>3,(r=(7&o[0])<<1|o[1]>>>7)<0||r>=this._mpegSamplingRates.length)this._onError(s.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var c=this._mpegSamplingRates[r],h=(120&o[1])>>>3;if(!(h<0||h>=8)){5===l&&(u=(7&o[1])<<1|o[2]>>>7,o[2]);var d=self.navigator.userAgent.toLowerCase();return-1!==d.indexOf("firefox")?r>=6?(l=5,a=new Array(4),u=r-3):(l=2,a=new Array(2),u=r):-1!==d.indexOf("android")?(l=2,a=new Array(2),u=r):(l=5,u=r,a=new Array(4),r>=6?u=r-3:1===h&&(l=2,a=new Array(2),u=r)),a[0]=l<<3,a[0]|=(15&r)>>>1,a[1]=(15&r)<<7,a[1]|=(15&h)<<3,5===l&&(a[1]|=(15&u)>>>1,a[2]=(1&u)<<7,a[2]|=8,a[3]=0),{config:a,samplingRate:c,channelCount:h,codec:"mp4a.40."+l,originalCodec:"mp4a.40."+n}}this._onError(s.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,r){if(!(i<4)){this._littleEndian;var o=new Uint8Array(e,t,i),s=null;if(r){if(255!==o[0])return;var a=o[1]>>>3&3,l=(6&o[1])>>1,u=(240&o[2])>>>4,c=(12&o[2])>>>2,h=3!=(o[3]>>>6&3)?2:1,d=0,p=0;switch(a){case 0:d=this._mpegAudioV25SampleRateTable[c];break;case 2:d=this._mpegAudioV20SampleRateTable[c];break;case 3:d=this._mpegAudioV10SampleRateTable[c]}switch(l){case 1:u>>4,u=15&a;7===u?this._parseAVCVideoPacket(e,t+1,i-1,r,o,l):this._onError(s.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+u)}},e.prototype._parseAVCVideoPacket=function(e,t,i,r,o,a){if(i<4)n.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,u=new DataView(e,t,i),c=u.getUint8(0),h=(16777215&u.getUint32(0,!l))<<8>>8;if(0===c)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===c)this._parseAVCVideoData(e,t+4,i-4,r,o,a,h);else if(2!==c)return void this._onError(s.default.FORMAT_ERROR,"Flv: Invalid video packet type "+c)}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){if(i<7)n.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var r=this._videoMetadata,a=this._videoTrack,l=this._littleEndian,u=new DataView(e,t,i);r?void 0!==r.avcc&&n.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(r=this._videoMetadata={}).type="video",r.id=a.id,r.timescale=this._timescale,r.duration=this._duration);var c=u.getUint8(0),h=u.getUint8(1);if(u.getUint8(2),u.getUint8(3),1===c&&0!==h)if(this._naluLengthSize=1+(3&u.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var d=31&u.getUint8(5);if(0!==d){d>1&&n.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+d);for(var p=6,f=0;f1&&n.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+S),p++,f=0;f=i){n.default.w(this.TAG,"Malformed Nalu near timestamp "+f+", offset = "+d+", dataSize = "+i);break}var g=u.getUint32(d,!l);if(3===p&&(g>>>=8),g>i-p)return void n.default.w(this.TAG,"Malformed Nalus near timestamp "+f+", NaluSize > DataSize!");var v=31&u.getUint8(d+p);5===v&&(m=!0);var y=new Uint8Array(e,t+d,p+g),_={type:v,data:y};c.push(_),h+=y.byteLength,d+=p+g}if(c.length){var b=this._videoTrack,C={units:c,length:h,isKeyframe:m,dts:f,cts:a,pts:f+a};m&&(C.fileposition=o),b.samples.push(C),b.length+=h}},e}();t.default=u},"./src/demux/sps-parser.js":function(e,t,i){i.r(t);var n=i("./src/demux/exp-golomb.js"),r=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,o=0;o=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),r=new n.default(i);r.readByte();var o=r.readByte();r.readByte();var s=r.readByte();r.readUEG();var a=e.getProfileString(o),l=e.getLevelString(s),u=1,c=420,h=8;if((100===o||110===o||122===o||244===o||44===o||83===o||86===o||118===o||128===o||138===o||144===o)&&(3===(u=r.readUEG())&&r.readBits(1),u<=3&&(c=[0,420,422,444][u]),h=r.readUEG()+8,r.readUEG(),r.readBits(1),r.readBool()))for(var d=3!==u?8:12,p=0;p0&&I<16?(E=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][I-1],S=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][I-1]):255===I&&(E=r.readByte()<<8|r.readByte(),S=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var M=r.readBits(32),L=r.readBits(32);P=r.readBool(),k=(A=L)/(x=2*M)}}var D=1;1===E&&1===S||(D=E/S);var O=0,j=0;0===u?(O=1,j=2-_):(O=3===u?1:2,j=(1===u?2:1)*(2-_));var R=16*(v+1),N=16*(y+1)*(2-_);R-=(b+C)*O,N-=(T+w)*j;var U=Math.ceil(R*D);return r.destroy(),r=null,{profile_string:a,level_string:l,bit_depth:h,ref_frames:g,chroma_format:c,chroma_format_string:e.getChromaFormatString(c),frame_rate:{fixed:P,fps:k,fps_den:x,fps_num:A},sar_ratio:{width:E,height:S},codec_size:{width:R,height:N},present_size:{width:U,height:N}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0;r=15048,t=!r.default.msedge||e;return self.fetch&&self.ReadableStream&&t}catch($v){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t),a=new self.Headers;if("object"==typeof r.headers){var l=r.headers;for(var u in l)l.hasOwnProperty(u)&&a.append(u,l[u])}var c={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var u in this._config.headers)a.append(u,this._config.headers[u]);!1===e.cors&&(c.mode="same-origin"),e.withCredentials&&(c.credentials="include"),e.referrerPolicy&&(c.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,c.signal=this._abortController.signal),this._status=o.LoaderStatus.kConnecting,self.fetch(r.url,c).then((function(e){if(i._requestAbort)return i._status=o.LoaderStatus.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&i._onURLRedirect){var t=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(t)}var n=e.headers.get("Content-Length");return null!=n&&(i._contentLength=parseInt(n),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,e.body.getReader())}if(i._status=o.LoaderStatus.kError,!i._onError)throw new s.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(o.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!i._abortController||!i._abortController.signal.aborted){if(i._status=o.LoaderStatus.kError,!i._onError)throw e;i._onError(o.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==o.LoaderStatus.kBuffering||!r.default.chrome)&&this._abortController)try{this._abortController.abort()}catch($v){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){if(i.done)if(null!==t._contentLength&&t._receivedLength0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new r.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===l.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new c.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new h.default(t,i)}else{if("custom"!==e.seekType)throw new d.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new d.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=u.default;else if(s.default.isSupported())this._loaderClass=s.default;else if(a.default.isSupported())this._loaderClass=a.default;else{if(!l.default.isSupported())throw new d.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=l.default}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},e.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var i={from:e,to:-1};this._currentRange={from:i.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,i),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new d.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+10485760){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,r=0,o=i;if(e=t[n]&&e=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize0){var o=this._stashBuffer.slice(0,this._stashUsed);(l=this._dispatchChunks(o,this._stashByteStart))0&&(u=new Uint8Array(o,l),a.set(u,0),this._stashUsed=u.byteLength,this._stashByteStart+=l):(this._stashUsed=0,this._stashByteStart+=l),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(l=this._dispatchChunks(e,t))this._bufferSize&&(this._expandBuffer(s),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,l),0),this._stashUsed+=s,this._stashByteStart=t+l);else if(0===this._stashUsed){var s;(l=this._dispatchChunks(e,t))this._bufferSize&&this._expandBuffer(s),(a=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,l),0),this._stashUsed+=s,this._stashByteStart=t+l)}else{var a,l;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(a=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(l=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var u=new Uint8Array(this._stashBuffer,l);a.set(u,0)}this._stashUsed-=l,this._stashByteStart+=l}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),r=t.byteLength-i;if(i0){var o=new Uint8Array(this._stashBuffer,0,this._bufferSize),s=new Uint8Array(t,i);o.set(s,0),this._stashUsed=s.byteLength,this._stashByteStart+=i}return 0}n.default.w(this.TAG,r+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,r}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(n.default.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=o.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case o.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var i=this._currentRange.to+1;return void(i0)for(var o=i.split("&"),s=0;s0;a[0]!==this._startName&&a[0]!==this._endName&&(l&&(r+="&"),r+=o[s])}return 0===r.length?t:t+"?"+r},e}();t.default=n},"./src/io/range-seek-handler.js":function(e,t,i){i.r(t);var n=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i={};if(0!==t.from||-1!==t.to){var n=void 0;n=-1!==t.to?"bytes="+t.from.toString()+"-"+t.to.toString():"bytes="+t.from.toString()+"-",i.Range=n}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}},e.prototype.removeURLParameters=function(e){return e},e}();t.default=n},"./src/io/speed-sampler.js":function(e,t,i){i.r(t);var n=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();t.default=n},"./src/io/websocket-loader.js":function(e,t,i){i.r(t);var n,r=i("./src/io/loader.js"),o=i("./src/utils/exception.js"),s=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),a=function(e){function t(){var t=e.call(this,"websocket-loader")||this;return t.TAG="WebSocketLoader",t._needStash=!0,t._ws=null,t._requestAbort=!1,t._receivedLength=0,t}return s(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch($v){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=r.LoaderStatus.kConnecting}catch($v){this._status=r.LoaderStatus.kError;var i={code:$v.code,msg:$v.message};if(!this._onError)throw new o.RuntimeException(i.msg);this._onError(r.LoaderErrors.EXCEPTION,i)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=r.LoaderStatus.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=r.LoaderStatus.kBuffering},t.prototype._onWebSocketClose=function(e){!0!==this._requestAbort?(this._status=r.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(i.result)},i.readAsArrayBuffer(e.data)}else{this._status=r.LoaderStatus.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new o.RuntimeException(n.msg);this._onError(r.LoaderErrors.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=r.LoaderStatus.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new o.RuntimeException(t.msg);this._onError(r.LoaderErrors.EXCEPTION,t)},t}(r.BaseLoader);t.default=a},"./src/io/xhr-moz-chunked-loader.js":function(e,t,i){i.r(t);var n,r=i("./src/utils/logger.js"),o=i("./src/io/loader.js"),s=i("./src/utils/exception.js"),a=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),l=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return a(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch($v){return r.default.w("MozChunkedLoader",$v.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(i=e.redirectedURL);var n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="moz-chunked-arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onloadend=this._onLoadEnd.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var s=n.headers;for(var a in s)s.hasOwnProperty(a)&&r.setRequestHeader(a,s[a])}if("object"==typeof this._config.headers)for(var a in s=this._config.headers)s.hasOwnProperty(a)&&r.setRequestHeader(a,s[a]);this._status=o.LoaderStatus.kConnecting,r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=o.LoaderStatus.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=o.LoaderStatus.kError,!this._onError)throw new s.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=o.LoaderStatus.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==o.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},t.prototype._onLoadEnd=function(e){!0!==this._requestAbort?this._status!==o.LoaderStatus.kError&&(this._status=o.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=o.LoaderStatus.kError;var t=0,i=null;if(this._contentLength&&e.loaded=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var s in o)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s])}if("object"==typeof this._config.headers)for(var s in o=this._config.headers)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s]);r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=s.LoaderStatus.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=s.LoaderStatus.kBuffering}else{if(this._status=s.LoaderStatus.kError,!this._onError)throw new a.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(s.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==s.LoaderStatus.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,o=i;if(e=t[n]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var n=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new l.default(this._mediaDataSource,this._config),this._transmuxer.on(u.default.INIT_SEGMENT,(function(t,i){e._msectl.appendInitSegment(i)})),this._transmuxer.on(u.default.MEDIA_SEGMENT,(function(t,i){if(e._msectl.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var n=e._mediaElement.currentTime;i.info.endDts>=1e3*(n+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(o.default.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(u.default.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(a.default.LOADING_COMPLETE)})),this._transmuxer.on(u.default.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(a.default.RECOVERED_EARLY_EOF)})),this._transmuxer.on(u.default.IO_ERROR,(function(t,i){e._emitter.emit(a.default.ERROR,d.ErrorTypes.NETWORK_ERROR,t,i)})),this._transmuxer.on(u.default.DEMUX_ERROR,(function(t,i){e._emitter.emit(a.default.ERROR,d.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(u.default.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(a.default.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(u.default.METADATA_ARRIVED,(function(t){e._emitter.emit(a.default.METADATA_ARRIVED,t)})),this._transmuxer.on(u.default.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(a.default.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(u.default.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(a.default.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(u.default.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,i=0,n=0;n=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(o.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){o.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,i=!1,n=0;n=r&&e=s-this._config.lazyLoadRecoverDuration&&(i=!0);break}}i&&(window.clearInterval(this._progressChecker),this._progressChecker=null,i&&(o.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t=this._mediaElement.buffered,i=0;i=n&&e0){var r=this._mediaElement.buffered.start(0);(r<1&&e0&&t.currentTime0){var n=i.start(0);if(n<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(o.default.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(o.default.STATISTICS_INFO,this.statisticsInfo)},e}();t.default=l},"./src/player/player-errors.js":function(e,t,i){i.r(t),i.d(t,{ErrorTypes:function(){return o},ErrorDetails:function(){return s}});var n=i("./src/io/loader.js"),r=i("./src/demux/demux-errors.js"),o={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},s={NETWORK_EXCEPTION:n.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:r.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:r.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:r.default.CODEC_UNSUPPORTED}},"./src/player/player-events.js":function(e,t,i){i.r(t),t.default={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"}},"./src/remux/aac-silent.js":function(e,t,i){i.r(t);var n=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();t.default=n},"./src/remux/mp4-generator.js":function(e,t,i){i.r(t);var n=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,i=null,n=Array.prototype.slice.call(arguments,1),r=n.length,o=0;o>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);var s=8;for(o=0;o>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,n=t.duration,r=t.presentWidth,o=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,o>>>8&255,255&o,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,n=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var i=null;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i=null;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.esds=function(t){var i=t.config||[],n=i.length,r=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(i).concat([6,1,2]));return e.box(e.types.esds,r)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,r=t.codecHeight,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,n>>>8&255,255&n,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,o,e.box(e.types.avcC,i))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,n=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,n)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)},e.traf=function(t,i){var n=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),s=e.sdtp(t),a=e.trun(t,s.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,o,a,s)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,r=new Uint8Array(4+n),o=0;o>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var a=0;a>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*a)}return e.box(e.types.trun,s)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();n.init(),t.default=n},"./src/remux/mp4-remuxer.js":function(e,t,i){i.r(t);var n=i("./src/utils/logger.js"),r=i("./src/remux/mp4-generator.js"),o=i("./src/remux/aac-silent.js"),s=i("./src/utils/browser.js"),a=i("./src/core/media-segment-info.js"),l=i("./src/utils/exception.js"),u=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new a.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new a.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!s.default.chrome||!(s.default.version.major<50||50===s.default.version.major&&s.default.version.build<2661)),this._fillSilentAfterSeek=s.default.msedge||s.default.msie,this._mp3UseMpegAudio=!s.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new l.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",o=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",o="",i=new Uint8Array):i=r.default.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=r.default.generateInitSegment(t)}if(!this._onInitSegment)throw new l.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:o,container:e+"/"+n,mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var i,l=e,u=l.samples,c=void 0,h=-1,d=this._audioMeta.refSampleDuration,p="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,f=this._dtsBaseInited&&void 0===this._audioNextDts,m=!1;if(u&&0!==u.length&&(1!==u.length||t)){var g=0,v=null,y=0;p?(g=0,y=l.length):(g=8,y=8+l.length);var _=null;if(u.length>1&&(y-=(_=u.pop()).length),null!=this._audioStashedLastSample){var b=this._audioStashedLastSample;this._audioStashedLastSample=null,u.unshift(b),y+=b.length}null!=_&&(this._audioStashedLastSample=_);var C=u[0].dts-this._dtsBase;if(this._audioNextDts)c=C-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())c=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(m=!0);else{var T=this._audioSegmentInfoList.getLastSampleBefore(C);if(null!=T){var w=C-(T.originalDts+T.duration);w<=3&&(w=0),c=C-(T.dts+T.duration+w)}else c=0}if(m){var E=C-c,S=this._videoSegmentInfoList.getLastSegmentBefore(C);if(null!=S&&S.beginDts=3*d&&this._fillAudioTimestampGap&&!s.default.safari){L=!0;var R,N=Math.floor(c/d);n.default.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: "+M+" ms, curRefDts: "+j+" ms, dtsCorrection: "+Math.round(c)+" ms, generate: "+N+" frames"),k=Math.floor(j),O=Math.floor(j+d)-k,null==(R=o.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))&&(n.default.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),R=I),D=[];for(var U=0;U=1?A[A.length-1].duration:Math.floor(d),this._audioNextDts=k+O;-1===h&&(h=k),A.push({dts:k,pts:k,cts:0,unit:b.unit,size:b.unit.byteLength,duration:O,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),L&&A.push.apply(A,D)}}if(0===A.length)return l.samples=[],void(l.length=0);for(p?v=new Uint8Array(y):((v=new Uint8Array(y))[0]=y>>>24&255,v[1]=y>>>16&255,v[2]=y>>>8&255,v[3]=255&y,v.set(r.default.types.mdat,4)),x=0;x1&&(p-=(f=s.pop()).length),null!=this._videoStashedLastSample){var m=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(m),p+=m.length}null!=f&&(this._videoStashedLastSample=f);var g=s[0].dts-this._dtsBase;if(this._videoNextDts)l=g-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())l=0;else{var v=this._videoSegmentInfoList.getLastSampleBefore(g);if(null!=v){var y=g-(v.originalDts+v.duration);y<=3&&(y=0),l=g-(v.dts+v.duration+y)}else l=0}for(var _=new a.MediaSegmentInfo,b=[],C=0;C=1?b[b.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),w){var A=new a.SampleInfo(E,k,P,m.dts,!0);A.fileposition=m.fileposition,_.appendSyncPoint(A)}b.push({dts:E,pts:k,cts:S,units:m.units,size:m.length,isKeyframe:w,duration:P,originalDts:T,flags:{isLeading:0,dependsOn:w?2:1,isDependedOn:w?1:0,hasRedundancy:0,isNonSync:w?0:1}})}for((d=new Uint8Array(p))[0]=p>>>24&255,d[1]=p>>>16&255,d[2]=p>>>8&255,d[3]=255&p,d.set(r.default.types.mdat,4),C=0;C=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},o={};if(r.browser){o[r.browser]=!0;var s=r.majorVersion.split(".");o.version={major:parseInt(r.majorVersion,10),string:r.version},s.length>1&&(o.version.minor=parseInt(s[1],10)),s.length>2&&(o.version.build=parseInt(s[2],10))}if(r.platform&&(o[r.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),o.rv||o.iemobile){o.rv&&delete o.rv;var a="msie";r.browser=a,o.msie=!0}if(o.edge){delete o.edge;var l="msedge";r.browser=l,o.msedge=!0}if(o.opr){var u="opera";r.browser=u,o.opera=!0}if(o.safari&&o.android){var c="android";r.browser=c,o.android=!0}for(var h in o.name=r.browser,o.platform=r.platform,n)n.hasOwnProperty(h)&&delete n[h];Object.assign(n,o)}(),t.default=n},"./src/utils/exception.js":function(e,t,i){i.r(t),i.d(t,{RuntimeException:function(){return o},IllegalStateException:function(){return s},InvalidArgumentException:function(){return a},NotImplementedException:function(){return l}});var n,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),s=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(o),a=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(o),l=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(o)},"./src/utils/logger.js":function(e,t,i){i.r(t);var n=i("./node_modules/events/events.js"),r=i.n(n),o=function(){function e(){}return e.e=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",n),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},e.d=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",n),e.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},e.v=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE&&console.log(n)},e}();o.GLOBAL_TAG="flv.js",o.FORCE_GLOBAL_TAG=!1,o.ENABLE_ERROR=!0,o.ENABLE_INFO=!0,o.ENABLE_WARN=!0,o.ENABLE_DEBUG=!0,o.ENABLE_VERBOSE=!0,o.ENABLE_CALLBACK=!1,o.emitter=new(r()),t.default=o},"./src/utils/logging-control.js":function(e,t,i){i.r(t);var n=i("./node_modules/events/events.js"),r=i.n(n),o=i("./src/utils/logger.js"),s=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return o.default.FORCE_GLOBAL_TAG},set:function(t){o.default.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return o.default.GLOBAL_TAG},set:function(t){o.default.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return o.default.ENABLE_VERBOSE&&o.default.ENABLE_DEBUG&&o.default.ENABLE_INFO&&o.default.ENABLE_WARN&&o.default.ENABLE_ERROR},set:function(t){o.default.ENABLE_VERBOSE=t,o.default.ENABLE_DEBUG=t,o.default.ENABLE_INFO=t,o.default.ENABLE_WARN=t,o.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return o.default.ENABLE_DEBUG},set:function(t){o.default.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return o.default.ENABLE_VERBOSE},set:function(t){o.default.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return o.default.ENABLE_INFO},set:function(t){o.default.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return o.default.ENABLE_WARN},set:function(t){o.default.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return o.default.ENABLE_ERROR},set:function(t){o.default.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:o.default.GLOBAL_TAG,forceGlobalTag:o.default.FORCE_GLOBAL_TAG,enableVerbose:o.default.ENABLE_VERBOSE,enableDebug:o.default.ENABLE_DEBUG,enableInfo:o.default.ENABLE_INFO,enableWarn:o.default.ENABLE_WARN,enableError:o.default.ENABLE_ERROR,enableCallback:o.default.ENABLE_CALLBACK}},e.applyConfig=function(e){o.default.GLOBAL_TAG=e.globalTag,o.default.FORCE_GLOBAL_TAG=e.forceGlobalTag,o.default.ENABLE_VERBOSE=e.enableVerbose,o.default.ENABLE_DEBUG=e.enableDebug,o.default.ENABLE_INFO=e.enableInfo,o.default.ENABLE_WARN=e.enableWarn,o.default.ENABLE_ERROR=e.enableError,o.default.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){o.default.emitter.addListener("log",t),o.default.emitter.listenerCount("log")>0&&(o.default.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){o.default.emitter.removeListener("log",t),0===o.default.emitter.listenerCount("log")&&(o.default.ENABLE_CALLBACK=!1,e._notifyChange())},e}();s.emitter=new(r()),t.default=s},"./src/utils/polyfill.js":function(e,t,i){i.r(t);var n=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i=128){t.push(String.fromCharCode(65535&s)),r+=2;continue}}else if(i[r]<240){if(n(i,r,2)&&(s=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2])>=2048&&55296!=(63488&s)){t.push(String.fromCharCode(65535&s)),r+=3;continue}}else if(i[r]<248){var s;if(n(i,r,3)&&(s=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3])>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}return i.m=e,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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch($v){if("object"==typeof window)return window}}(),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("./src/index.js")}()},e.exports=i()}(Fv);var Wv=ie(Fv.exports);const Hv=hf.getTech("Html5"),Vv=hf.mergeOptions||hf.util.mergeOptions,Gv={mediaDataSource:{},config:{}};class zv extends Hv{constructor(e,t){super(e=Vv(Gv,e),t)}setSrc(e){this.flvPlayer&&(this.flvPlayer.detachMediaElement(),this.flvPlayer.destroy());const t=this.options_.mediaDataSource,i=this.options_.config;t.type=void 0===t.type?"flv":t.type,t.url=e,this.flvPlayer=Wv.createPlayer(t,i),this.flvPlayer.attachMediaElement(this.el_),this.flvPlayer.load()}dispose(){this.flvPlayer&&(this.flvPlayer.detachMediaElement(),this.flvPlayer.destroy()),super.dispose()}}zv.isSupported=function(){return Wv&&Wv.isSupported()},zv.formats={"video/flv":"FLV","video/x-flv":"FLV"},zv.canPlayType=function(e){return zv.isSupported()&&e in zv.formats?"maybe":""},zv.canPlaySource=function(e,t){return zv.canPlayType(e.type)},zv.VERSION="__VERSION__",hf.registerTech("Flvjs",zv);class Yv{constructor(e,t,i){switch(document.getElementsByClassName("popup-video").length>0&&document.getElementsByClassName("popup-video")[0].remove(),this.viewer=e,this.position=t,this.id="popup_video_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("popup-video"),this.popupDiv.id=this.id,this.viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(i),i.type){case"hls":this.videotype="application/x-mpegURL";break;case"rtmp":this.videotype="rtmp/flv";break;case"flv":this.videotype="video/x-flv";break;case"mp4":this.videotype="video/mp4"}this.videoPlayer=hf(document.querySelector("#myvideo"),{controls:!0,autoplay:"muted",loop:!0,muted:!1,fluid:!0,aspectRatio:"16:9",reload:"auto",fullscreen:{options:{navigationUI:"hide"}},sources:[{src:i.url,type:this.videotype}]},(function(){console.log("onPlayerReady",this)})),this._render(this.position),this.eventListener=this.viewer.clock.onTick.addEventListener((e=>{this._render(this.position)})),document.getElementsByClassName("popup-video-close-button")[0].onclick=()=>{this.close()}}_render(e){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e);null!=t&&(this.popupDiv.style.left=t.x-this.popupDiv.offsetWidth/2+"px",this.popupDiv.style.top=t.y-this.popupDiv.offsetHeight+40+"px"),this.viewer.camera.positionCartographic.height>2e5?this.popupDiv.style.display="none":this.popupDiv.style.display="block"}_createHtml(e){return`\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t`}}Object.assign(Yv.prototype,{close(){this.popupDiv.remove(),this.viewer.clock.onTick.removeEventListener(this.eventListener),hf("myvideo").dispose(),this.videoPlayer.dispose()}});class qv{constructor(e,t,i){switch(document.getElementsByClassName("popup-video2").length>0&&document.getElementsByClassName("popup-video2")[0].remove(),this.viewer=e,this.position=t,this.id="popup_video_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("popup-video2"),this.popupDiv.id=this.id,this.viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(i),i.type){case"hls":this.videotype="application/x-mpegURL";break;case"rtmp":this.videotype="rtmp/flv";break;case"flv":this.videotype="video/x-flv";break;case"mp4":this.videotype="video/mp4"}this.videoPlayer=hf(document.querySelector("#myvideo"),{controls:!0,autoplay:"muted",loop:!0,muted:!1,fluid:!0,aspectRatio:"16:9",reload:"auto",fullscreen:{options:{navigationUI:"hide"}},sources:[{src:i.url,type:this.videotype}]},(function(){console.log("onPlayerReady",this)})),this._render(this.position),this.eventListener=this.viewer.clock.onTick.addEventListener((e=>{this._render(this.position)})),document.getElementsByClassName("popup-close-button")[0].onclick=()=>{this.close()}}_render(e){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e);null!=t&&(this.popupDiv.style.left=t.x-this.popupDiv.offsetWidth-120+"px",this.popupDiv.style.top=t.y+"px"),this.viewer.camera.positionCartographic.height>2e5?this.popupDiv.style.display="none":this.popupDiv.style.display="block"}_createHtml(e){return`\n\t\t
\n\t\t
\n\t\t
\n\t\t\n\t\t\n\t\t`}}Object.assign(qv.prototype,{close(){this.popupDiv.remove(),this.viewer.clock.onTick.removeEventListener(this.eventListener)}});class Xv{constructor(e,t,i,n){document.getElementsByClassName("popup1").length>0&&document.getElementsByClassName("popup1")[0].remove(),this.viewer=e,this.position=t,this.id="popup_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("popup1"),this.popupDiv.id=this.id,this.viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(i,n),this._render(this.position),this.eventListener=this.viewer.clock.onTick.addEventListener((e=>{this._render(this.position)})),document.getElementsByClassName("leaflet-popup-close-button")[0].onclick=()=>{this.close()}}_render(e){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e);null!=t&&(this.popupDiv.style.left=t.x-this.popupDiv.offsetWidth/2+"px",this.popupDiv.style.top=t.y-this.popupDiv.offsetHeight+40+"px"),this.viewer.camera.positionCartographic.height>2e5?this.popupDiv.style.display="none":this.popupDiv.style.display="block"}_createHtml(e,t){return`\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t`}}Object.assign(Xv.prototype,{close(){this.popupDiv.remove(),this.viewer.clock.onTick.removeEventListener(this.eventListener)}});class Zv{constructor(e,t,i,n){document.getElementsByClassName("popup2").length>0&&document.getElementsByClassName("popup2")[0].remove(),this.viewer=e,this.position=t,this.id="popup_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("popup2"),this.popupDiv.id=this.id,this.viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(i,n),this._render(this.position),this.eventListener=this.viewer.clock.onTick.addEventListener((e=>{this._render(this.position)})),document.getElementsByClassName("popup-close-button")[0].onclick=()=>{this.close()}}_render(e){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e);null!=t&&(this.popupDiv.style.left=t.x-this.popupDiv.offsetWidth-120+"px",this.popupDiv.style.top=t.y+"px"),this.viewer.camera.positionCartographic.height>2e5?this.popupDiv.style.display="none":this.popupDiv.style.display="block"}_createHtml(e,t){return`\n\t\t
\n\t\t
\n\t\t
\n\t\t\n\t\t\n\t\t`}}Object.assign(Zv.prototype,{close(){this.popupDiv.remove(),this.viewer.clock.onTick.removeEventListener(this.eventListener)}});class Qv{constructor(e,t,i,n){document.getElementsByClassName("popup3").length>0&&document.getElementsByClassName("popup3")[0].remove(),this.viewer=e,this.position=t,this.id="popup_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("popup3"),this.popupDiv.id=this.id,this.viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(i,n),this._render(this.position),this.eventListener=this.viewer.clock.onTick.addEventListener((e=>{this._render(this.position)})),document.getElementsByClassName("popup-close-button")[0].onclick=()=>{this.close()}}_render(e){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e);null!=t&&(this.popupDiv.style.left=t.x+70+"px",this.popupDiv.style.top=t.y-this.popupDiv.offsetHeight-20+"px"),this.viewer.camera.positionCartographic.height>2e5?this.popupDiv.style.display="none":this.popupDiv.style.display="block"}_createHtml(e,t){return`\n\t\t
\n\t\t
\n\t\t\n\t\t\n\t\t`}}Object.assign(Qv.prototype,{close(){this.popupDiv.remove(),this.viewer.clock.onTick.removeEventListener(this.eventListener)}});let Kv={MultiFieldAdaptWindow:yn,VideoWindow:Yv,VideoWindow2:qv,HtmlWindow:Xv,HtmlWindow2:Zv,HtmlWindow3:Qv};class Jv{constructor(e){if(!e)throw new n("no viewer object!");this._viewer=e}_createHtml(e){return'\n\t\t\t\t\n\t\t'}}Object.assign(Jv.prototype,{VideoRegionEntity(e,t){return new Promise(((r,o)=>{let s=this;if(!i(e))throw new n("points is required.");switch(e.length<3&&o("面对象,点数至少3个"),e.map((e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0))),document.getElementsByClassName("VideoMapping").length>0&&document.getElementsByClassName("VideoMapping")[0].remove(),this.id="VideoMapping_"+fi(),this.popupDiv=document.createElement("div"),this.popupDiv.classList.add("VideoMapping"),this.popupDiv.id=this.id,this._viewer.container.append(this.popupDiv),this.popupDiv.innerHTML=this._createHtml(t),t.type){case"hls":this.videotype="application/x-mpegURL";break;case"rtmp":this.videotype="rtmp/flv";break;case"flv":this.videotype="video/x-flv";break;case"mp4":this.videotype="video/mp4"}this.videoPlayer=hf(document.querySelector("#myVideoMapping"),{controls:!0,autoplay:"muted",loop:!0,muted:!1,fluid:!0,aspectRatio:"16:9",reload:"auto",fullscreen:{options:{navigationUI:"hide"}},sources:[{src:t.url,type:this.videotype}]},(function(){console.log("onPlayerReady",this);let e=s._viewer.entities.add({polygon:{height:.1,hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights([121.600444,37.398272,37.95,121.600443,37.398272,33,121.600443,37.398341,33,121.600444,37.398341,37.95])),material:document.getElementById("myVideoMapping"),perPositionHeight:!0}});r(e)}))}))}});e.CommonTools=en,e.CoordTransform=m,e.DrawMilitaryPlot=vn,e.DrawTools=rn,e.FloatingLayer=v,e.LocateUtil=_,e.PointObject=Zi,e.PolygonObject=Ji,e.PolylineObject=Ki,e.PopupWindow=Kv,e.ReminderTip=b,e.SceneControl=qi,e.SceneEffects=Gi,e.SketchViewModel=$i,e.SpatialAnalysis=hi,e.TerrainAnalysis=yi,e.TrackRoam=Xi,e.VERSION="2.01",e.VideoPlugin=Jv,e.common=gi,e.jtMap3d=c,e.layer=g,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));