diff --git a/css/741.c3045c83.css b/css/181.9efa21e6.css similarity index 81% rename from css/741.c3045c83.css rename to css/181.9efa21e6.css index 42604dd..23e1a8f 100644 --- a/css/741.c3045c83.css +++ b/css/181.9efa21e6.css @@ -1 +1 @@ -@charset "UTF-8";@keyframes plyr-progress{to{background-position:25px 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{0%{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:400;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui :after,.plyr--full-ui :before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:2px;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:9px;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:13px;font-size:var(--plyr-font-size-small,13px);left:0;padding:10px;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:15px;font-size:var(--plyr-font-size-base,15px);padding:20px;padding:calc(var(--plyr-control-spacing, 10px)*2)}}@media (min-width:768px){.plyr__captions{font-size:18px;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(-40px);transform:translateY(calc(var(--plyr-control-spacing, 10px)*-4))}.plyr__caption{background:#000c;background:var(--plyr-captions-background,#000c);border-radius:2px;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:#0000;border:0;border-radius:4px;border-radius:var(--plyr-control-radius,4px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:7px;padding:calc(var(--plyr-control-spacing, 10px)*.7);position:relative;transition:all .1s ease-in-out}.plyr__control svg{display:block;fill:currentColor;height:18px;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:18px;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control:focus-visible{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}a.plyr__control{text-decoration:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,a.plyr__control:after,a.plyr__control:before{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:2.5px;margin-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:2.5px;padding-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 5px;padding:0 calc(var(--plyr-control-spacing, 10px)/2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip],.plyr__controls:empty{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:#ffffffe6;background:var(--plyr-menu-background,#ffffffe6);border-radius:8px;border-radius:var(--plyr-menu-radius,8px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-menu-shadow,0 1px 2px #00000026);color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:15px;font-size:var(--plyr-font-size-base,15px);margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container:after{border:4px solid #0000;border-top-color:#ffffffe6;border:var(--plyr-menu-arrow-size,4px) solid #0000;border-top-color:var(--plyr-menu-background,#ffffffe6);content:"";height:0;position:absolute;right:14px;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7 - var(--plyr-menu-arrow-size, 4px)/2);top:100%;width:0}.plyr__menu__container [role=menu]{padding:7px;padding:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:13px;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding:4.66667px 10.5px;padding:calc(var(--plyr-control-spacing, 10px)*.7/1.5) calc(var(--plyr-control-spacing, 10px)*.7*1.5);-webkit-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control:after{border:4px solid #0000;border:var(--plyr-menu-item-arrow-size,4px) solid #0000;content:"";position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:28px;padding-right:calc(var(--plyr-control-spacing, 10px)*.7*4)}.plyr__menu__container .plyr__control--forward:after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:6.5px;right:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--forward:focus-visible:after,.plyr__menu__container .plyr__control--forward:hover:after{border-left-color:initial}.plyr__menu__container .plyr__control--back{font-weight:400;font-weight:var(--plyr-font-weight-regular,400);margin:7px;margin:calc(var(--plyr-control-spacing, 10px)*.7);margin-bottom:3.5px;margin-bottom:calc(var(--plyr-control-spacing, 10px)*.7/2);padding-left:28px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*4);position:relative;width:calc(100% - 14px);width:calc(100% - var(--plyr-control-spacing, 10px)*.7*2)}.plyr__menu__container .plyr__control--back:after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:6.5px;left:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back:before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color,#fff);content:"";height:1px;left:0;margin-top:3.5px;margin-top:calc(var(--plyr-control-spacing, 10px)*.7/2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back:focus-visible:after,.plyr__menu__container .plyr__control--back:hover:after{border-right-color:initial}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:7px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container .plyr__control[role=menuitemradio]:after,.plyr__menu__container .plyr__control[role=menuitemradio]:before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]:before{background:#0000001a;content:"";display:block;flex-shrink:0;height:16px;margin-right:10px;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]:after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before{background:#00b2ff;background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio]:focus-visible:before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover:before{background:#23282f1a}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:-5px;margin-right:calc(var(--plyr-control-spacing, 10px)*.7*-1 + 2px);overflow:hidden;padding-left:24.5px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*3.5);pointer-events:none}.plyr--full-ui input[type=range]{appearance:none;background:#0000;border:0;border-radius:26px;border-radius:calc(var(--plyr-range-thumb-height, 13px)*2);color:#00b2ff;color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));display:block;height:19px;height:calc(var(--plyr-range-thumb-active-shadow-width, 3px)*2 + var(--plyr-range-thumb-height, 13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:#0000;background-image:linear-gradient(90deg,currentColor,#0000 0);background-image:linear-gradient(to right,currentColor var(--value,0),#0000 var(--value,0));border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-webkit-slider-thumb{appearance:none;background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33);height:13px;height:var(--plyr-range-thumb-height,13px);margin-top:-4px;margin-top:calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px))/2*-1);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-track{background:#0000;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33);height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{color:#0000}.plyr--full-ui input[type=range]::-ms-fill-upper,.plyr--full-ui input[type=range]::-ms-track{background:#0000;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:#0000;background:currentColor;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33);height:13px;height:var(--plyr-range-thumb-height,13px);margin-top:0;position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range]:focus-visible::-webkit-slider-runnable-track{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}.plyr--full-ui input[type=range]:focus-visible::-moz-range-track{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}.plyr--full-ui input[type=range]:focus-visible::-ms-track{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}.plyr__poster{background-color:#000;background-color:var(--plyr-video-background,var(--plyr-video-background,#000));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:13px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time:before{content:"⁄";margin-right:10px;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:#fff;background:var(--plyr-tooltip-background,#fff);border-radius:5px;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-tooltip-shadow,0 1px 2px #00000026);color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:13px;font-size:var(--plyr-font-size-small,13px);font-weight:400;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:10px;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:5px 7.5px;padding:calc(var(--plyr-control-spacing, 10px)/2) calc(var(--plyr-control-spacing, 10px)/2*1.5);pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;white-space:nowrap;z-index:2}.plyr__tooltip:before{border-left:4px solid #0000;border-left:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-right:4px solid #0000;border-right:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-top:4px solid #fff;border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,#fff);bottom:-4px;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr .plyr__control:focus-visible .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translateY(10px) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip:before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip:before{left:16px;left:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7)}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translateY(10px) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip:before{left:auto;right:16px;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7);transform:translateX(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control:focus-visible .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child:focus-visible .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child:focus-visible .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0) scale(1)}.plyr__progress{left:6.5px;left:calc(var(--plyr-range-thumb-height, 13px)*.5);margin-right:13px;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:-6.5px;margin-left:calc(var(--plyr-range-thumb-height, 13px)*-.5);margin-right:-6.5px;margin-right:calc(var(--plyr-range-thumb-height, 13px)*-.5);width:calc(100% + 13px);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:120px;overflow-wrap:break-word}.plyr__progress__buffer{-webkit-appearance:none;background:#0000;border:0;border-radius:100px;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin-top:-2.5px;margin-top:calc(var(--plyr-range-track-height, 5px)/2*-1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:#0000}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,#23282f99 25%,#0000 0,#0000 50%,#23282f99 0,#23282f99 75%,#0000 0,#0000);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,#23282f99) 25%,#0000 25%,#0000 50%,var(--plyr-progress-loading-background,#23282f99) 50%,var(--plyr-progress-loading-background,#23282f99) 75%,#0000 75%,#0000);background-repeat:repeat-x;background-size:25px 25px;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:#0000}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:#ffffff40;background-color:var(--plyr-video-progress-buffered-background,#ffffff40)}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:#c1c8d199;background-color:var(--plyr-audio-progress-buffered-background,#c1c8d199)}.plyr__progress__marker{background-color:#fff;background-color:var(--plyr-progress-marker-background,#fff);border-radius:1px;height:5px;height:var(--plyr-range-track-height,5px);position:absolute;top:50%;transform:translate(-50%,-50%);width:3px;width:var(--plyr-progress-marker-width,3px);z-index:3}.plyr__volume{align-items:center;display:flex;position:relative}.plyr__volume input[type=range]{margin-left:5px;margin-left:calc(var(--plyr-control-spacing, 10px)/2);margin-right:5px;margin-right:calc(var(--plyr-control-spacing, 10px)/2);max-width:90px;min-width:60px;position:relative;z-index:2}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:10px;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control:focus-visible,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,#c1c8d199))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,#c1c8d199))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,#c1c8d199))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#23282f1a)}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#23282f1a)}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#23282f1a)}.plyr--audio .plyr__progress__buffer{color:#c1c8d199;color:var(--plyr-audio-progress-buffered-background,#c1c8d199)}.plyr--video{overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));border-radius:inherit;height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio:16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(#0000,#000000bf);background:var(--plyr-video-controls-background,linear-gradient(#0000,#000000bf));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:5px;padding:calc(var(--plyr-control-spacing, 10px)/2);padding-top:20px;padding-top:calc(var(--plyr-control-spacing, 10px)*2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:10px;padding:var(--plyr-control-spacing,10px);padding-top:35px;padding-top:calc(var(--plyr-control-spacing, 10px)*3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control:focus-visible,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:15px;padding:calc(var(--plyr-control-spacing, 10px)*1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,#ffffff40))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,#ffffff40))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,#ffffff40))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#ffffff80)}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#ffffff80)}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#ffffff80)}.plyr--video .plyr__progress__buffer{color:#ffffff40;color:var(--plyr-video-progress-buffered-background,#ffffff40)}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen video{height:100%}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;height:100%;inset:0;margin:0;position:fixed;width:100%;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;cursor:pointer;inset:0;overflow:hidden;position:absolute;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads:after{background:#23282f;border-radius:2px;bottom:10px;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:10px;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads:empty:after{display:none}.plyr__cues{background:currentColor;display:block;height:5px;height:var(--plyr-range-track-height,5px);left:0;opacity:.8;position:absolute;top:50%;transform:translateY(-50%);width:3px;z-index:3}.plyr__preview-thumb{background-color:#fff;background-color:var(--plyr-tooltip-background,#fff);border-radius:8px;border-radius:var(--plyr-menu-radius,8px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-tooltip-shadow,0 1px 2px #00000026);margin-bottom:10px;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:3px;pointer-events:none;position:absolute;transform:translateY(10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0) scale(1)}.plyr__preview-thumb:before{border-left:4px solid #0000;border-left:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-right:4px solid #0000;border-right:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-top:4px solid #fff;border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,#fff);bottom:-4px;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:7px;border-radius:calc(var(--plyr-menu-radius, 8px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container:after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container:after{border-radius:inherit;box-shadow:inset 0 0 0 1px #00000026;content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:linear-gradient(#0000,#000000bf);background:var(--plyr-video-controls-background,linear-gradient(#0000,#000000bf));border-bottom-left-radius:7px;border-bottom-left-radius:calc(var(--plyr-menu-radius, 8px) - 1px);border-bottom-right-radius:7px;border-bottom-right-radius:calc(var(--plyr-menu-radius, 8px) - 1px);bottom:0;left:0;line-height:1.1;padding:20px 6px 6px;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:13px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__preview-scrubbing{filter:blur(1px);height:100%;inset:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(1px,1px,1px,1px);border:0!important;height:1px!important;overflow:hidden;padding:0!important;position:absolute!important;width:1px!important}.plyr [hidden]{display:none!important}.tm-viewport[data-v-40a605de]{width:100%;height:100%;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tm-media[data-v-40a605de]{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-drag:none}.tm-video-wrap[data-v-40a605de]{width:100%;max-width:800px;touch-action:auto}.plyr-video[data-v-40a605de]{width:100%}.tm-audio-wrap[data-v-40a605de]{display:flex;flex-direction:column;align-items:center;gap:20px;padding:24px;width:100%;max-width:400px;touch-action:auto}.plyr-audio[data-v-40a605de]{width:100%}.audio-cover[data-v-40a605de]{width:200px;height:200px;border-radius:12px;overflow:hidden;background:hsla(0,0%,100%,.1);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 32px rgba(0,0,0,.3)}.cover-img[data-v-40a605de]{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.audio-icon-large[data-v-40a605de]{width:80px;height:80px;color:hsla(0,0%,100%,.4)}.audio-info[data-v-40a605de]{text-align:center;width:100%}.audio-title[data-v-40a605de]{font-size:18px;font-weight:600;color:#fff;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio-artist[data-v-40a605de]{font-size:14px;color:hsla(0,0%,100%,.6)}.audio-placeholder[data-v-40a605de],.video-placeholder[data-v-40a605de]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:hsla(0,0%,100%,.4)}.video-placeholder svg[data-v-40a605de]{width:80px;height:80px}.audio-placeholder .audio-name[data-v-40a605de]{font-size:14px;color:hsla(0,0%,100%,.6);text-align:center;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plyr{--plyr-color-main:#3b82f6}.plyr--audio .plyr__controls{background:hsla(0,0%,100%,.1);border-radius:8px}.public-browse[data-v-22855501]{min-height:100vh;background:#0a0a0a;color:#fff}.header[data-v-22855501]{position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:16px 32px;background:hsla(0,0%,6%,.95);backdrop-filter:blur(10px);border-bottom:1px solid #1a1a1a}.logo[data-v-22855501]{font-size:20px;font-weight:600;color:#fff;cursor:pointer;transition:opacity .2s}.logo[data-v-22855501]:hover{opacity:.8}.breadcrumb[data-v-22855501]{display:flex;align-items:center;gap:4px;font-size:14px}.breadcrumb-item[data-v-22855501]{padding:6px 12px;border-radius:6px;cursor:pointer;transition:background .2s;color:#ccc}.breadcrumb-item[data-v-22855501]:hover{background:#252525;color:#fff}.breadcrumb-sep[data-v-22855501]{color:#444}.file-count[data-v-22855501]{color:#666;font-size:14px}.error-container[data-v-22855501],.loading-container[data-v-22855501]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;color:#666}.loading-spinner[data-v-22855501]{width:48px;height:48px;border:3px solid #222;border-top-color:#3b82f6;border-radius:50%;animation:spin-22855501 1s linear infinite}.loading-spinner-small[data-v-22855501]{width:24px;height:24px;border:2px solid #222;border-top-color:#3b82f6;border-radius:50%;animation:spin-22855501 1s linear infinite}@keyframes spin-22855501{to{transform:rotate(1turn)}}.retry-btn[data-v-22855501]{margin-top:20px;padding:10px 32px;background:#3b82f6;border:none;border-radius:8px;color:#fff;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn[data-v-22855501]:hover{background:#2563eb}.gallery-container[data-v-22855501]{padding:8px}@media (min-width:1200px){.gallery-container[data-v-22855501]{max-width:1400px;margin:0 auto;padding:24px}}.folders-section[data-v-22855501]{margin-bottom:24px}.folders-grid[data-v-22855501]{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:16px}.folder-card[data-v-22855501]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px;background:#141414;border-radius:12px;border:1px solid #1a1a1a;cursor:pointer;transition:all .2s}.folder-card[data-v-22855501]:hover{background:#1a1a1a;border-color:#333;transform:translateY(-2px)}.folder-icon[data-v-22855501]{width:48px;height:48px;margin-bottom:12px;color:#555}.folder-icon svg[data-v-22855501]{width:100%;height:100%}.folder-name[data-v-22855501]{font-size:14px;color:#999;text-align:center;word-break:break-all}.waterfall[data-v-22855501]{display:flex;gap:16px}.waterfall-column[data-v-22855501]{flex:1;display:flex;flex-direction:column;gap:16px}.waterfall-item[data-v-22855501]{cursor:pointer}.image-wrapper[data-v-22855501]{position:relative;border-radius:12px;overflow:hidden;background:#141414;border:1px solid #1a1a1a;min-height:180px}.image-wrapper[data-v-22855501]:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#141414 25%,#1a1a1a 50%,#141414 75%);background-size:200% 100%;animation:shimmer-22855501 1.5s infinite;z-index:1;pointer-events:none}.image-wrapper.loaded[data-v-22855501]:before{display:none}.image-wrapper.loaded[data-v-22855501]{min-height:auto}.image-wrapper img[data-v-22855501],.image-wrapper video[data-v-22855501]{width:100%;display:block;position:relative;z-index:2}@keyframes shimmer-22855501{0%{background-position:200% 0}to{background-position:-200% 0}}.image-wrapper[data-v-22855501]:hover{border-color:#333}.overlay[data-v-22855501]{position:absolute;inset:0;background:linear-gradient(transparent 50%,rgba(0,0,0,.85));opacity:0;transition:opacity .2s;display:flex;align-items:flex-end;justify-content:flex-end;padding:12px;z-index:10}.image-wrapper:hover .overlay[data-v-22855501]{opacity:1}.file-placeholder[data-v-22855501]{width:100%;height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#141414;color:#555;gap:12px;padding:16px;box-sizing:border-box}.file-placeholder svg[data-v-22855501]{width:48px;height:48px}.file-name[data-v-22855501]{font-size:12px;color:hsla(0,0%,100%,.7);text-align:center;word-break:break-all;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.audio-placeholder[data-v-22855501]{width:100%;height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(135deg,#1a1a2e,#16213e);gap:12px;padding:16px;box-sizing:border-box}.audio-icon[data-v-22855501]{width:48px;height:48px;color:hsla(0,0%,100%,.6)}.audio-name[data-v-22855501]{font-size:12px;color:hsla(0,0%,100%,.7);text-align:center;word-break:break-all;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.overlay-actions[data-v-22855501]{display:flex;gap:8px}.action-btn[data-v-22855501]{width:32px;height:32px;border:none;border-radius:50%;background:hsla(0,0%,100%,.08);backdrop-filter:blur(8px);cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center;color:hsla(0,0%,100%,.6)}.action-btn svg[data-v-22855501]{width:16px;height:16px}.action-btn[data-v-22855501]:hover{background:hsla(0,0%,100%,.2);color:#fff;transform:scale(1.1)}.load-trigger[data-v-22855501]{display:flex;justify-content:center;align-items:center;padding:48px;min-height:100px}.loading-more[data-v-22855501]{display:flex;align-items:center;gap:12px;color:#666;font-size:14px}.no-more[data-v-22855501]{color:#444;font-size:14px}.credit-link[data-v-22855501]{display:block;margin-top:8px;color:#555;font-size:12px;text-decoration:none;transition:color .2s;text-align:center}.credit-link[data-v-22855501]:hover{color:#888}.preview-modal[data-v-22855501]{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.97);display:flex;align-items:center;justify-content:center;overflow:hidden}.preview-content[data-v-22855501]{padding:60px 80px;box-sizing:border-box;overflow:hidden}.preview-content-mobile[data-v-22855501],.preview-content[data-v-22855501]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.preview-content-mobile[data-v-22855501]{flex-direction:column;padding:0;position:absolute;top:0;left:0}.mobile-video-native[data-v-22855501]{width:100%;height:100%;-o-object-fit:contain;object-fit:contain;background:#000}.mobile-audio-native[data-v-22855501]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(135deg,#1a1a2e,#16213e);padding:20px;box-sizing:border-box}.audio-cover-simple[data-v-22855501]{width:120px;height:120px;background:hsla(0,0%,100%,.1);border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:20px}.audio-cover-simple svg[data-v-22855501]{width:60px;height:60px;color:hsla(0,0%,100%,.6)}.audio-name-simple[data-v-22855501]{font-size:16px;color:hsla(0,0%,100%,.9);text-align:center;margin-bottom:30px;max-width:80%;word-break:break-all}.mobile-audio-player[data-v-22855501]{width:90%;max-width:320px;margin-bottom:20px}.swipe-hint[data-v-22855501]{font-size:12px;color:hsla(0,0%,100%,.4)}.other-file-preview[data-v-22855501]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:hsla(0,0%,100%,.6);gap:16px}.other-file-preview svg[data-v-22855501]{width:64px;height:64px}.other-file-preview .file-name[data-v-22855501]{font-size:14px;color:hsla(0,0%,100%,.7);text-align:center;padding:0 20px;word-break:break-all}.swipe-viewport[data-v-22855501]{width:100%;height:100%;overflow:hidden;position:relative}.swipe-track[data-v-22855501]{width:300%;height:100%;display:flex;will-change:transform}.swipe-slide[data-v-22855501]{width:33.333%;flex-shrink:0;height:100%;display:flex;align-items:center;justify-content:center}.preview-image[data-v-22855501],.preview-video[data-v-22855501]{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.preview-close[data-v-22855501]{position:fixed;top:20px;right:20px;background:hsla(0,0%,100%,.1);border:none;color:#fff;cursor:pointer;width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .2s;z-index:1010}.preview-close[data-v-22855501]:hover{background:hsla(0,0%,100%,.2)}.preview-close svg[data-v-22855501]{width:28px;height:28px}.page-indicator[data-v-22855501]{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.6);color:hsla(0,0%,100%,.8);padding:8px 16px;border-radius:20px;font-size:14px;z-index:1010}.preview-next[data-v-22855501],.preview-prev[data-v-22855501]{position:fixed;top:50%;transform:translateY(-50%);background:hsla(0,0%,100%,.1);border:none;color:#fff;padding:16px;cursor:pointer;border-radius:50%;width:56px;height:56px;display:flex;align-items:center;justify-content:center;transition:background .2s;z-index:1010}.preview-next[data-v-22855501]:hover,.preview-prev[data-v-22855501]:hover{background:hsla(0,0%,100%,.2)}.preview-next svg[data-v-22855501],.preview-prev svg[data-v-22855501]{width:32px;height:32px}.preview-prev[data-v-22855501]{left:20px}.preview-next[data-v-22855501]{right:20px}.rotate-btn[data-v-22855501]{position:fixed;bottom:30px;right:20px;background:hsla(0,0%,100%,.1);border:none;color:#fff;cursor:pointer;width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .2s;z-index:1010}.rotate-btn[data-v-22855501]:hover{background:hsla(0,0%,100%,.2)}.rotate-btn svg[data-v-22855501]{width:24px;height:24px}@media (max-width:768px){.page-indicator[data-v-22855501]{bottom:40px}}@media (max-width:1199px) and (min-width:601px){.gallery-container[data-v-22855501]{padding:12px}.waterfall-column[data-v-22855501],.waterfall[data-v-22855501]{gap:10px}.image-wrapper[data-v-22855501]{border-radius:8px}}@media (max-width:600px){.header[data-v-22855501]{padding:10px 12px}.header-left .logo[data-v-22855501]{font-size:16px}.breadcrumb[data-v-22855501]{font-size:12px}.breadcrumb-item[data-v-22855501]{padding:4px 8px}.file-count[data-v-22855501]{font-size:12px}.gallery-container[data-v-22855501]{padding:6px}.waterfall-column[data-v-22855501],.waterfall[data-v-22855501]{gap:6px}.image-wrapper[data-v-22855501]{border-radius:6px;min-height:120px}.folders-section[data-v-22855501]{margin-bottom:12px}.folders-grid[data-v-22855501]{grid-template-columns:repeat(2,1fr);gap:8px}.folder-card[data-v-22855501]{padding:16px 12px;border-radius:8px}.folder-icon[data-v-22855501]{width:36px;height:36px;margin-bottom:8px}.folder-name[data-v-22855501]{font-size:12px}.load-trigger[data-v-22855501]{padding:24px;min-height:60px}}.copy-toast{position:fixed;bottom:80px;left:50%;transform:translateX(-50%) translateY(20px);background:rgba(0,0,0,.8);color:#fff;padding:10px 24px;border-radius:20px;font-size:14px;opacity:0;transition:all .3s ease;z-index:9999;pointer-events:none}.copy-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.public-browse.light-mode[data-v-22855501]{background:#f5f5f5;color:#333}.light-mode .header[data-v-22855501]{background:hsla(0,0%,100%,.95);border-bottom-color:#e0e0e0}.light-mode .logo[data-v-22855501]{color:#333}.light-mode .breadcrumb-item[data-v-22855501]{color:#666}.light-mode .breadcrumb-item[data-v-22855501]:hover{background:#e8e8e8;color:#333}.light-mode .breadcrumb-sep[data-v-22855501]{color:#ccc}.light-mode .error-container[data-v-22855501],.light-mode .file-count[data-v-22855501],.light-mode .loading-container[data-v-22855501]{color:#999}.light-mode .loading-spinner-small[data-v-22855501],.light-mode .loading-spinner[data-v-22855501]{border-color:#ddd;border-top-color:#3b82f6}.light-mode .folder-card[data-v-22855501]{background:#fff;border-color:#e0e0e0}.light-mode .folder-card[data-v-22855501]:hover{background:#fafafa;border-color:#ccc}.light-mode .folder-icon[data-v-22855501]{color:#999}.light-mode .folder-name[data-v-22855501]{color:#666}.light-mode .image-wrapper[data-v-22855501]{background:#fff;border-color:#e0e0e0}.light-mode .image-wrapper[data-v-22855501]:before{background:linear-gradient(90deg,#f5f5f5 25%,#fff 50%,#f5f5f5 75%)}.light-mode .image-wrapper[data-v-22855501]:hover{border-color:#ccc}.light-mode .file-placeholder[data-v-22855501]{color:#ccc;background:#f5f5f5;color:#999}.light-mode .file-name[data-v-22855501]{color:rgba(0,0,0,.6)}.light-mode .audio-placeholder[data-v-22855501]{background:linear-gradient(135deg,#e8f4f8,#d4e5f7)}.light-mode .audio-icon[data-v-22855501]{color:rgba(0,0,0,.4)}.light-mode .audio-name[data-v-22855501]{color:rgba(0,0,0,.6)}.light-mode .no-more[data-v-22855501]{color:#bbb}.light-mode .credit-link[data-v-22855501]{color:#aaa}.light-mode .credit-link[data-v-22855501]:hover{color:#666}.light-mode .loading-more[data-v-22855501]{color:#999} \ No newline at end of file +@charset "UTF-8";@keyframes plyr-progress{to{background-position:25px 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{0%{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:400;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui :after,.plyr--full-ui :before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:2px;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:9px;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:13px;font-size:var(--plyr-font-size-small,13px);left:0;padding:10px;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:15px;font-size:var(--plyr-font-size-base,15px);padding:20px;padding:calc(var(--plyr-control-spacing, 10px)*2)}}@media (min-width:768px){.plyr__captions{font-size:18px;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(-40px);transform:translateY(calc(var(--plyr-control-spacing, 10px)*-4))}.plyr__caption{background:#000c;background:var(--plyr-captions-background,#000c);border-radius:2px;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:#0000;border:0;border-radius:4px;border-radius:var(--plyr-control-radius,4px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:7px;padding:calc(var(--plyr-control-spacing, 10px)*.7);position:relative;transition:all .1s ease-in-out}.plyr__control svg{display:block;fill:currentColor;height:18px;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:18px;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control:focus-visible{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}a.plyr__control{text-decoration:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,a.plyr__control:after,a.plyr__control:before{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:2.5px;margin-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:2.5px;padding-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 5px;padding:0 calc(var(--plyr-control-spacing, 10px)/2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip],.plyr__controls:empty{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:#ffffffe6;background:var(--plyr-menu-background,#ffffffe6);border-radius:8px;border-radius:var(--plyr-menu-radius,8px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-menu-shadow,0 1px 2px #00000026);color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:15px;font-size:var(--plyr-font-size-base,15px);margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container:after{border:4px solid #0000;border-top-color:#ffffffe6;border:var(--plyr-menu-arrow-size,4px) solid #0000;border-top-color:var(--plyr-menu-background,#ffffffe6);content:"";height:0;position:absolute;right:14px;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7 - var(--plyr-menu-arrow-size, 4px)/2);top:100%;width:0}.plyr__menu__container [role=menu]{padding:7px;padding:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:13px;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding:4.66667px 10.5px;padding:calc(var(--plyr-control-spacing, 10px)*.7/1.5) calc(var(--plyr-control-spacing, 10px)*.7*1.5);-webkit-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control:after{border:4px solid #0000;border:var(--plyr-menu-item-arrow-size,4px) solid #0000;content:"";position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:28px;padding-right:calc(var(--plyr-control-spacing, 10px)*.7*4)}.plyr__menu__container .plyr__control--forward:after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:6.5px;right:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--forward:focus-visible:after,.plyr__menu__container .plyr__control--forward:hover:after{border-left-color:initial}.plyr__menu__container .plyr__control--back{font-weight:400;font-weight:var(--plyr-font-weight-regular,400);margin:7px;margin:calc(var(--plyr-control-spacing, 10px)*.7);margin-bottom:3.5px;margin-bottom:calc(var(--plyr-control-spacing, 10px)*.7/2);padding-left:28px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*4);position:relative;width:calc(100% - 14px);width:calc(100% - var(--plyr-control-spacing, 10px)*.7*2)}.plyr__menu__container .plyr__control--back:after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:6.5px;left:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back:before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color,#fff);content:"";height:1px;left:0;margin-top:3.5px;margin-top:calc(var(--plyr-control-spacing, 10px)*.7/2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back:focus-visible:after,.plyr__menu__container .plyr__control--back:hover:after{border-right-color:initial}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:7px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container .plyr__control[role=menuitemradio]:after,.plyr__menu__container .plyr__control[role=menuitemradio]:before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]:before{background:#0000001a;content:"";display:block;flex-shrink:0;height:16px;margin-right:10px;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]:after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before{background:#00b2ff;background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio]:focus-visible:before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover:before{background:#23282f1a}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:-5px;margin-right:calc(var(--plyr-control-spacing, 10px)*.7*-1 + 2px);overflow:hidden;padding-left:24.5px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*3.5);pointer-events:none}.plyr--full-ui input[type=range]{appearance:none;background:#0000;border:0;border-radius:26px;border-radius:calc(var(--plyr-range-thumb-height, 13px)*2);color:#00b2ff;color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));display:block;height:19px;height:calc(var(--plyr-range-thumb-active-shadow-width, 3px)*2 + var(--plyr-range-thumb-height, 13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:#0000;background-image:linear-gradient(90deg,currentColor,#0000 0);background-image:linear-gradient(to right,currentColor var(--value,0),#0000 var(--value,0));border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-webkit-slider-thumb{appearance:none;background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33);height:13px;height:var(--plyr-range-thumb-height,13px);margin-top:-4px;margin-top:calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px))/2*-1);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-track{background:#0000;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33);height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{color:#0000}.plyr--full-ui input[type=range]::-ms-fill-upper,.plyr--full-ui input[type=range]::-ms-track{background:#0000;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:#0000;background:currentColor;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33);height:13px;height:var(--plyr-range-thumb-height,13px);margin-top:0;position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range]:focus-visible::-webkit-slider-runnable-track{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}.plyr--full-ui input[type=range]:focus-visible::-moz-range-track{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}.plyr--full-ui input[type=range]:focus-visible::-ms-track{outline:2px dashed #00b2ff;outline:2px dashed var(--plyr-focus-visible-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));outline-offset:2px}.plyr__poster{background-color:#000;background-color:var(--plyr-video-background,var(--plyr-video-background,#000));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:13px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time:before{content:"⁄";margin-right:10px;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:#fff;background:var(--plyr-tooltip-background,#fff);border-radius:5px;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-tooltip-shadow,0 1px 2px #00000026);color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:13px;font-size:var(--plyr-font-size-small,13px);font-weight:400;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:10px;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:5px 7.5px;padding:calc(var(--plyr-control-spacing, 10px)/2) calc(var(--plyr-control-spacing, 10px)/2*1.5);pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;white-space:nowrap;z-index:2}.plyr__tooltip:before{border-left:4px solid #0000;border-left:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-right:4px solid #0000;border-right:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-top:4px solid #fff;border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,#fff);bottom:-4px;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr .plyr__control:focus-visible .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translateY(10px) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip:before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip:before{left:16px;left:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7)}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translateY(10px) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip:before{left:auto;right:16px;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7);transform:translateX(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control:focus-visible .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child:focus-visible .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child:focus-visible .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0) scale(1)}.plyr__progress{left:6.5px;left:calc(var(--plyr-range-thumb-height, 13px)*.5);margin-right:13px;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:-6.5px;margin-left:calc(var(--plyr-range-thumb-height, 13px)*-.5);margin-right:-6.5px;margin-right:calc(var(--plyr-range-thumb-height, 13px)*-.5);width:calc(100% + 13px);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:120px;overflow-wrap:break-word}.plyr__progress__buffer{-webkit-appearance:none;background:#0000;border:0;border-radius:100px;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin-top:-2.5px;margin-top:calc(var(--plyr-range-track-height, 5px)/2*-1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:#0000}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,#23282f99 25%,#0000 0,#0000 50%,#23282f99 0,#23282f99 75%,#0000 0,#0000);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,#23282f99) 25%,#0000 25%,#0000 50%,var(--plyr-progress-loading-background,#23282f99) 50%,var(--plyr-progress-loading-background,#23282f99) 75%,#0000 75%,#0000);background-repeat:repeat-x;background-size:25px 25px;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:#0000}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:#ffffff40;background-color:var(--plyr-video-progress-buffered-background,#ffffff40)}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:#c1c8d199;background-color:var(--plyr-audio-progress-buffered-background,#c1c8d199)}.plyr__progress__marker{background-color:#fff;background-color:var(--plyr-progress-marker-background,#fff);border-radius:1px;height:5px;height:var(--plyr-range-track-height,5px);position:absolute;top:50%;transform:translate(-50%,-50%);width:3px;width:var(--plyr-progress-marker-width,3px);z-index:3}.plyr__volume{align-items:center;display:flex;position:relative}.plyr__volume input[type=range]{margin-left:5px;margin-left:calc(var(--plyr-control-spacing, 10px)/2);margin-right:5px;margin-right:calc(var(--plyr-control-spacing, 10px)/2);max-width:90px;min-width:60px;position:relative;z-index:2}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:10px;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control:focus-visible,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,#c1c8d199))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,#c1c8d199))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,#c1c8d199))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#23282f1a)}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#23282f1a)}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#23282f1a)}.plyr--audio .plyr__progress__buffer{color:#c1c8d199;color:var(--plyr-audio-progress-buffered-background,#c1c8d199)}.plyr--video{overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));border-radius:inherit;height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio:16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(#0000,#000000bf);background:var(--plyr-video-controls-background,linear-gradient(#0000,#000000bf));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:5px;padding:calc(var(--plyr-control-spacing, 10px)/2);padding-top:20px;padding-top:calc(var(--plyr-control-spacing, 10px)*2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:10px;padding:var(--plyr-control-spacing,10px);padding-top:35px;padding-top:calc(var(--plyr-control-spacing, 10px)*3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control:focus-visible,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:15px;padding:calc(var(--plyr-control-spacing, 10px)*1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,#ffffff40))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,#ffffff40))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,#ffffff40))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#ffffff80)}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#ffffff80)}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px #23282f26,0 0 0 1px #23282f33),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,#ffffff80)}.plyr--video .plyr__progress__buffer{color:#ffffff40;color:var(--plyr-video-progress-buffered-background,#ffffff40)}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen video{height:100%}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;height:100%;inset:0;margin:0;position:fixed;width:100%;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;cursor:pointer;inset:0;overflow:hidden;position:absolute;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads:after{background:#23282f;border-radius:2px;bottom:10px;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:10px;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads:empty:after{display:none}.plyr__cues{background:currentColor;display:block;height:5px;height:var(--plyr-range-track-height,5px);left:0;opacity:.8;position:absolute;top:50%;transform:translateY(-50%);width:3px;z-index:3}.plyr__preview-thumb{background-color:#fff;background-color:var(--plyr-tooltip-background,#fff);border-radius:8px;border-radius:var(--plyr-menu-radius,8px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-tooltip-shadow,0 1px 2px #00000026);margin-bottom:10px;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:3px;pointer-events:none;position:absolute;transform:translateY(10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0) scale(1)}.plyr__preview-thumb:before{border-left:4px solid #0000;border-left:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-right:4px solid #0000;border-right:var(--plyr-tooltip-arrow-size,4px) solid #0000;border-top:4px solid #fff;border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,#fff);bottom:-4px;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:7px;border-radius:calc(var(--plyr-menu-radius, 8px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container:after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container:after{border-radius:inherit;box-shadow:inset 0 0 0 1px #00000026;content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:linear-gradient(#0000,#000000bf);background:var(--plyr-video-controls-background,linear-gradient(#0000,#000000bf));border-bottom-left-radius:7px;border-bottom-left-radius:calc(var(--plyr-menu-radius, 8px) - 1px);border-bottom-right-radius:7px;border-bottom-right-radius:calc(var(--plyr-menu-radius, 8px) - 1px);bottom:0;left:0;line-height:1.1;padding:20px 6px 6px;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:13px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__preview-scrubbing{filter:blur(1px);height:100%;inset:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(1px,1px,1px,1px);border:0!important;height:1px!important;overflow:hidden;padding:0!important;position:absolute!important;width:1px!important}.plyr [hidden]{display:none!important}.tm-viewport[data-v-40a605de]{width:100%;height:100%;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tm-media[data-v-40a605de]{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-drag:none}.tm-video-wrap[data-v-40a605de]{width:100%;max-width:800px;touch-action:auto}.plyr-video[data-v-40a605de]{width:100%}.tm-audio-wrap[data-v-40a605de]{display:flex;flex-direction:column;align-items:center;gap:20px;padding:24px;width:100%;max-width:400px;touch-action:auto}.plyr-audio[data-v-40a605de]{width:100%}.audio-cover[data-v-40a605de]{width:200px;height:200px;border-radius:12px;overflow:hidden;background:hsla(0,0%,100%,.1);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 32px rgba(0,0,0,.3)}.cover-img[data-v-40a605de]{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.audio-icon-large[data-v-40a605de]{width:80px;height:80px;color:hsla(0,0%,100%,.4)}.audio-info[data-v-40a605de]{text-align:center;width:100%}.audio-title[data-v-40a605de]{font-size:18px;font-weight:600;color:#fff;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio-artist[data-v-40a605de]{font-size:14px;color:hsla(0,0%,100%,.6)}.audio-placeholder[data-v-40a605de],.video-placeholder[data-v-40a605de]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:hsla(0,0%,100%,.4)}.video-placeholder svg[data-v-40a605de]{width:80px;height:80px}.audio-placeholder .audio-name[data-v-40a605de]{font-size:14px;color:hsla(0,0%,100%,.6);text-align:center;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plyr{--plyr-color-main:#3b82f6}.plyr--audio .plyr__controls{background:hsla(0,0%,100%,.1);border-radius:8px}.public-browse[data-v-eef21a24]{min-height:100vh;background:#0a0a0a;color:#fff}.header[data-v-eef21a24]{position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;padding:16px 32px;background:hsla(0,0%,6%,.95);backdrop-filter:blur(10px);border-bottom:1px solid #1a1a1a}.logo[data-v-eef21a24]{font-size:20px;font-weight:600;color:#fff;cursor:pointer;transition:opacity .2s}.logo[data-v-eef21a24]:hover{opacity:.8}.breadcrumb[data-v-eef21a24]{display:flex;align-items:center;gap:4px;font-size:14px}.breadcrumb-item[data-v-eef21a24]{padding:6px 12px;border-radius:6px;cursor:pointer;transition:background .2s;color:#ccc}.breadcrumb-item[data-v-eef21a24]:hover{background:#252525;color:#fff}.breadcrumb-sep[data-v-eef21a24]{color:#444}.file-count[data-v-eef21a24]{color:#666;font-size:14px}.error-container[data-v-eef21a24],.loading-container[data-v-eef21a24]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;color:#666}.loading-spinner[data-v-eef21a24]{width:48px;height:48px;border:3px solid #222;border-top-color:#3b82f6;border-radius:50%;animation:spin-eef21a24 1s linear infinite}.loading-spinner-small[data-v-eef21a24]{width:24px;height:24px;border:2px solid #222;border-top-color:#3b82f6;border-radius:50%;animation:spin-eef21a24 1s linear infinite}@keyframes spin-eef21a24{to{transform:rotate(1turn)}}.retry-btn[data-v-eef21a24]{margin-top:20px;padding:10px 32px;background:#3b82f6;border:none;border-radius:8px;color:#fff;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn[data-v-eef21a24]:hover{background:#2563eb}.gallery-container[data-v-eef21a24]{padding:8px}@media (min-width:1200px){.gallery-container[data-v-eef21a24]{max-width:1400px;margin:0 auto;padding:24px}}.folders-section[data-v-eef21a24]{margin-bottom:24px}.folders-grid[data-v-eef21a24]{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:16px}.folder-card[data-v-eef21a24]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px;background:#141414;border-radius:12px;border:1px solid #1a1a1a;cursor:pointer;transition:all .2s}.folder-card[data-v-eef21a24]:hover{background:#1a1a1a;border-color:#333;transform:translateY(-2px)}.folder-icon[data-v-eef21a24]{width:48px;height:48px;margin-bottom:12px;color:#555}.folder-icon svg[data-v-eef21a24]{width:100%;height:100%}.folder-name[data-v-eef21a24]{font-size:14px;color:#999;text-align:center;word-break:break-all}.waterfall[data-v-eef21a24]{display:flex;gap:16px}.waterfall-column[data-v-eef21a24]{flex:1;display:flex;flex-direction:column;gap:16px}.waterfall-item[data-v-eef21a24]{cursor:pointer}.image-wrapper[data-v-eef21a24]{position:relative;border-radius:12px;overflow:hidden;background:#141414;border:1px solid #1a1a1a;min-height:180px}.image-wrapper[data-v-eef21a24]:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#141414 25%,#1a1a1a 50%,#141414 75%);background-size:200% 100%;animation:shimmer-eef21a24 1.5s infinite;z-index:1;pointer-events:none}.image-wrapper.loaded[data-v-eef21a24]:before{display:none}.image-wrapper.loaded[data-v-eef21a24]{min-height:auto}.image-wrapper img[data-v-eef21a24],.image-wrapper video[data-v-eef21a24]{width:100%;display:block;position:relative;z-index:2}@keyframes shimmer-eef21a24{0%{background-position:200% 0}to{background-position:-200% 0}}.image-wrapper[data-v-eef21a24]:hover{border-color:#333}.overlay[data-v-eef21a24]{position:absolute;inset:0;background:linear-gradient(transparent 50%,rgba(0,0,0,.85));opacity:0;transition:opacity .2s;display:flex;align-items:flex-end;justify-content:flex-end;padding:12px;z-index:10}.image-wrapper:hover .overlay[data-v-eef21a24]{opacity:1}.file-placeholder[data-v-eef21a24]{width:100%;height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#141414;color:#555;gap:12px;padding:16px;box-sizing:border-box}.file-placeholder svg[data-v-eef21a24]{width:48px;height:48px}.file-name[data-v-eef21a24]{font-size:12px;color:hsla(0,0%,100%,.7);text-align:center;word-break:break-all;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.audio-placeholder[data-v-eef21a24]{width:100%;height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(135deg,#1a1a2e,#16213e);gap:12px;padding:16px;box-sizing:border-box}.audio-icon[data-v-eef21a24]{width:48px;height:48px;color:hsla(0,0%,100%,.6)}.audio-name[data-v-eef21a24]{font-size:12px;color:hsla(0,0%,100%,.7);text-align:center;word-break:break-all;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.overlay-actions[data-v-eef21a24]{display:flex;gap:8px}.action-btn[data-v-eef21a24]{width:32px;height:32px;border:none;border-radius:50%;background:hsla(0,0%,100%,.08);backdrop-filter:blur(8px);cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center;color:hsla(0,0%,100%,.6)}.action-btn svg[data-v-eef21a24]{width:16px;height:16px}.action-btn[data-v-eef21a24]:hover{background:hsla(0,0%,100%,.2);color:#fff;transform:scale(1.1)}.load-trigger[data-v-eef21a24]{display:flex;justify-content:center;align-items:center;padding:48px;min-height:100px}.loading-more[data-v-eef21a24]{display:flex;align-items:center;gap:12px;color:#666;font-size:14px}.no-more[data-v-eef21a24]{color:#444;font-size:14px}.credit-link[data-v-eef21a24]{display:block;margin-top:8px;color:#555;font-size:12px;text-decoration:none;transition:color .2s;text-align:center}.credit-link[data-v-eef21a24]:hover{color:#888}.preview-modal[data-v-eef21a24]{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.97);display:flex;align-items:center;justify-content:center;overflow:hidden}.preview-content[data-v-eef21a24]{padding:60px 80px;box-sizing:border-box;overflow:hidden}.preview-content-mobile[data-v-eef21a24],.preview-content[data-v-eef21a24]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.preview-content-mobile[data-v-eef21a24]{flex-direction:column;padding:0;position:absolute;top:0;left:0}.mobile-video-native[data-v-eef21a24]{width:100%;height:100%;-o-object-fit:contain;object-fit:contain;background:#000}.mobile-audio-native[data-v-eef21a24]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(135deg,#1a1a2e,#16213e);padding:20px;box-sizing:border-box}.audio-cover-simple[data-v-eef21a24]{width:120px;height:120px;background:hsla(0,0%,100%,.1);border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:20px}.audio-cover-simple svg[data-v-eef21a24]{width:60px;height:60px;color:hsla(0,0%,100%,.6)}.audio-name-simple[data-v-eef21a24]{font-size:16px;color:hsla(0,0%,100%,.9);text-align:center;margin-bottom:30px;max-width:80%;word-break:break-all}.mobile-audio-player[data-v-eef21a24]{width:90%;max-width:320px;margin-bottom:20px}.swipe-hint[data-v-eef21a24]{font-size:12px;color:hsla(0,0%,100%,.4)}.other-file-preview[data-v-eef21a24]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:hsla(0,0%,100%,.6);gap:16px}.other-file-preview svg[data-v-eef21a24]{width:64px;height:64px}.other-file-preview .file-name[data-v-eef21a24]{font-size:14px;color:hsla(0,0%,100%,.7);text-align:center;padding:0 20px;word-break:break-all}.swipe-viewport[data-v-eef21a24]{width:100%;height:100%;overflow:hidden;position:relative}.swipe-track[data-v-eef21a24]{width:300%;height:100%;display:flex;will-change:transform}.swipe-slide[data-v-eef21a24]{width:33.333%;flex-shrink:0;height:100%;display:flex;align-items:center;justify-content:center}.preview-image[data-v-eef21a24],.preview-video[data-v-eef21a24]{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.preview-close[data-v-eef21a24]{position:fixed;top:20px;right:20px;background:hsla(0,0%,100%,.1);border:none;color:#fff;cursor:pointer;width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .2s;z-index:1010}.preview-close[data-v-eef21a24]:hover{background:hsla(0,0%,100%,.2)}.preview-close svg[data-v-eef21a24]{width:28px;height:28px}.page-indicator[data-v-eef21a24]{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.6);color:hsla(0,0%,100%,.8);padding:8px 16px;border-radius:20px;font-size:14px;z-index:1010}.preview-next[data-v-eef21a24],.preview-prev[data-v-eef21a24]{position:fixed;top:50%;transform:translateY(-50%);background:hsla(0,0%,100%,.1);border:none;color:#fff;padding:16px;cursor:pointer;border-radius:50%;width:56px;height:56px;display:flex;align-items:center;justify-content:center;transition:background .2s;z-index:1010}.preview-next[data-v-eef21a24]:hover,.preview-prev[data-v-eef21a24]:hover{background:hsla(0,0%,100%,.2)}.preview-next svg[data-v-eef21a24],.preview-prev svg[data-v-eef21a24]{width:32px;height:32px}.preview-prev[data-v-eef21a24]{left:20px}.preview-next[data-v-eef21a24]{right:20px}.rotate-btn[data-v-eef21a24]{position:fixed;bottom:30px;right:20px;background:hsla(0,0%,100%,.1);border:none;color:#fff;cursor:pointer;width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .2s;z-index:1010}.rotate-btn[data-v-eef21a24]:hover{background:hsla(0,0%,100%,.2)}.rotate-btn svg[data-v-eef21a24]{width:24px;height:24px}@media (max-width:768px){.page-indicator[data-v-eef21a24]{bottom:40px}}@media (max-width:1199px) and (min-width:601px){.gallery-container[data-v-eef21a24]{padding:12px}.waterfall-column[data-v-eef21a24],.waterfall[data-v-eef21a24]{gap:10px}.image-wrapper[data-v-eef21a24]{border-radius:8px}}@media (max-width:600px){.header[data-v-eef21a24]{padding:10px 12px}.header-left .logo[data-v-eef21a24]{font-size:16px}.breadcrumb[data-v-eef21a24]{font-size:12px}.breadcrumb-item[data-v-eef21a24]{padding:4px 8px}.file-count[data-v-eef21a24]{font-size:12px}.gallery-container[data-v-eef21a24]{padding:6px}.waterfall-column[data-v-eef21a24],.waterfall[data-v-eef21a24]{gap:6px}.image-wrapper[data-v-eef21a24]{border-radius:6px;min-height:120px}.folders-section[data-v-eef21a24]{margin-bottom:12px}.folders-grid[data-v-eef21a24]{grid-template-columns:repeat(2,1fr);gap:8px}.folder-card[data-v-eef21a24]{padding:16px 12px;border-radius:8px}.folder-icon[data-v-eef21a24]{width:36px;height:36px;margin-bottom:8px}.folder-name[data-v-eef21a24]{font-size:12px}.load-trigger[data-v-eef21a24]{padding:24px;min-height:60px}}.copy-toast{position:fixed;bottom:80px;left:50%;transform:translateX(-50%) translateY(20px);background:rgba(0,0,0,.8);color:#fff;padding:10px 24px;border-radius:20px;font-size:14px;opacity:0;transition:all .3s ease;z-index:9999;pointer-events:none}.copy-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.public-browse.light-mode[data-v-eef21a24]{background:#f5f5f5;color:#333}.light-mode .header[data-v-eef21a24]{background:hsla(0,0%,100%,.95);border-bottom-color:#e0e0e0}.light-mode .logo[data-v-eef21a24]{color:#333}.light-mode .breadcrumb-item[data-v-eef21a24]{color:#666}.light-mode .breadcrumb-item[data-v-eef21a24]:hover{background:#e8e8e8;color:#333}.light-mode .breadcrumb-sep[data-v-eef21a24]{color:#ccc}.light-mode .error-container[data-v-eef21a24],.light-mode .file-count[data-v-eef21a24],.light-mode .loading-container[data-v-eef21a24]{color:#999}.light-mode .loading-spinner-small[data-v-eef21a24],.light-mode .loading-spinner[data-v-eef21a24]{border-color:#ddd;border-top-color:#3b82f6}.light-mode .folder-card[data-v-eef21a24]{background:#fff;border-color:#e0e0e0}.light-mode .folder-card[data-v-eef21a24]:hover{background:#fafafa;border-color:#ccc}.light-mode .folder-icon[data-v-eef21a24]{color:#999}.light-mode .folder-name[data-v-eef21a24]{color:#666}.light-mode .image-wrapper[data-v-eef21a24]{background:#fff;border-color:#e0e0e0}.light-mode .image-wrapper[data-v-eef21a24]:before{background:linear-gradient(90deg,#f5f5f5 25%,#fff 50%,#f5f5f5 75%)}.light-mode .image-wrapper[data-v-eef21a24]:hover{border-color:#ccc}.light-mode .file-placeholder[data-v-eef21a24]{color:#ccc;background:#f5f5f5;color:#999}.light-mode .file-name[data-v-eef21a24]{color:rgba(0,0,0,.6)}.light-mode .audio-placeholder[data-v-eef21a24]{background:linear-gradient(135deg,#e8f4f8,#d4e5f7)}.light-mode .audio-icon[data-v-eef21a24]{color:rgba(0,0,0,.4)}.light-mode .audio-name[data-v-eef21a24]{color:rgba(0,0,0,.6)}.light-mode .no-more[data-v-eef21a24]{color:#bbb}.light-mode .credit-link[data-v-eef21a24]{color:#aaa}.light-mode .credit-link[data-v-eef21a24]:hover{color:#666}.light-mode .loading-more[data-v-eef21a24]{color:#999} \ No newline at end of file diff --git a/css/741.c3045c83.css.gz b/css/181.9efa21e6.css.gz similarity index 71% rename from css/741.c3045c83.css.gz rename to css/181.9efa21e6.css.gz index 9e0b0e3..6b50ddd 100644 Binary files a/css/741.c3045c83.css.gz and b/css/181.9efa21e6.css.gz differ diff --git a/index.html b/index.html index a455c45..a035521 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Sanyue ImgHub
\ No newline at end of file +Sanyue ImgHub
\ No newline at end of file diff --git a/index.html.gz b/index.html.gz index e3dc267..0ec5209 100644 Binary files a/index.html.gz and b/index.html.gz differ diff --git a/js/741.08e44c91.js b/js/181.d064b96f.js similarity index 86% rename from js/741.08e44c91.js rename to js/181.d064b96f.js index 58d9e5b..bf830ea 100644 --- a/js/741.08e44c91.js +++ b/js/181.d064b96f.js @@ -1,2 +1,2 @@ -(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[741],{1114:function(e,t,i){"use strict";function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function n(e,t){if("object"!=s(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function a(e){var t=n(e,"string");return"symbol"==s(t)?t:t+""}function r(e,t,i){return(t=a(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}i.d(t,{A:function(){return r}})},1583:function(e,t,i){var s,n,a;i(4114),function(i,r){n=[],s=r,a="function"===typeof s?s.apply(t,n):s,void 0===a||(e.exports=a)}(0,function(){var e=function(){},t={},i={},s={};function n(e,t){e=e.push?e:[e];var n,a,r,o,l=[],c=e.length,h=c;n=function(e,i){i.length&&l.push(e),h--,h||t(l)};while(c--)a=e[c],r=i[a],r?n(a,r):(o=s[a]=s[a]||[],o.push(n))}function a(e,t){if(e){var n=s[e];if(i[e]=t,n)while(n.length)n[0](e,t),n.splice(0,1)}}function r(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,s,n){var a,r,l,c=document,h=s.async,u=(s.numRetries||0)+1,d=s.before||e,p=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img|module|nomodule)!/,"");if(n=n||0,/(^css!|\.css$)/.test(p))l=c.createElement("link"),l.rel="stylesheet",l.href=m,a="hideFocus"in l,a&&l.relList&&(a=0,l.rel="preload",l.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(p))l=c.createElement("img"),l.src=m;else if(l=c.createElement("script"),l.src=m,l.async=void 0===h||h,r="noModule"in l,/^module!/.test(p)){if(!r)return i(t,"l");l.type="module"}else if(/^nomodule!/.test(p)&&r)return i(t,"l");l.onload=l.onerror=l.onbeforeload=function(e){var r=e.type[0];if(a)try{l.sheet.cssText.length||(r="e")}catch(c){18!=c.code&&(r="e")}if("e"==r){if(n+=1,nw.onPointerDown&&w.onPointerDown(...e)),onPointermove:t[4]||(t[4]=(...e)=>w.onPointerMove&&w.onPointerMove(...e)),onPointerup:t[5]||(t[5]=(...e)=>w.onPointerUp&&w.onPointerUp(...e)),onPointercancel:t[6]||(t[6]=(...e)=>w.onPointerUp&&w.onPointerUp(...e)),onDblclick:t[7]||(t[7]=(0,n.D$)((...e)=>w.onDblClick&&w.onDblClick(...e),["prevent"]))},[i.isImage?((0,s.uX)(),(0,s.CE)("img",{key:0,class:"tm-media",src:i.src,draggable:"false",style:(0,a.Tr)(w.mediaStyle),onLoad:t[0]||(t[0]=(...e)=>w.onLoad&&w.onLoad(...e))},null,44,r)):i.isVideo&&i.isActive?((0,s.uX)(),(0,s.CE)("div",{key:1,class:"tm-video-wrap",onPointerdown:t[1]||(t[1]=(0,n.D$)(()=>{},["stop"]))},[(0,s.Lk)("video",{ref:"videoEl",class:"plyr-video",src:i.src,playsinline:""},null,8,o)],32)):i.isVideo?((0,s.uX)(),(0,s.CE)("div",l,[...t[8]||(t[8]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M8 5v14l11-7z"})],-1)])])):i.isAudio&&i.isActive?((0,s.uX)(),(0,s.CE)("div",{key:3,class:"tm-audio-wrap",onPointerdown:t[2]||(t[2]=(0,n.D$)(()=>{},["stop"]))},[(0,s.Lk)("div",c,[v.audioCover?((0,s.uX)(),(0,s.CE)("img",{key:0,src:v.audioCover,class:"cover-img"},null,8,h)):((0,s.uX)(),(0,s.CE)("svg",u,[...t[9]||(t[9]=[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"},null,-1)])]))]),(0,s.Lk)("div",d,[(0,s.Lk)("div",p,(0,a.v_)(v.audioTitle),1),v.audioArtist?((0,s.uX)(),(0,s.CE)("div",m,(0,a.v_)(v.audioArtist),1)):(0,s.Q3)("",!0)]),(0,s.Lk)("audio",{ref:"audioEl",class:"plyr-audio",src:i.src},null,8,g)],32)):i.isAudio?((0,s.uX)(),(0,s.CE)("div",f,[t[10]||(t[10]=(0,s.Lk)("svg",{class:"audio-icon-large",viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"})],-1)),(0,s.Lk)("span",y,(0,a.v_)(v.audioTitle),1)])):(0,s.Q3)("",!0)],544)}i(6573),i(8100),i(7936),i(9577),i(1549),i(9797),i(9631),i(5623),i(4603),i(7566),i(8721);var v=i(1114),w=(i(8111),i(2489),i(1701),i(8335),i(1148),i(116),i(7588),i(4114),i(3579),i(3975));const k=e=>null!==e&&"undefined"!==typeof e?e.constructor:null,T=(e,t)=>Boolean(e&&t&&e instanceof t),C=e=>null===e||"undefined"===typeof e,A=e=>k(e)===Object,S=e=>k(e)===Number&&!Number.isNaN(e),P=e=>k(e)===String,E=e=>k(e)===Boolean,M=e=>"function"===typeof e,x=e=>Array.isArray(e),L=e=>T(e,WeakMap),I=e=>T(e,NodeList),N=e=>k(e)===Text,$=e=>T(e,Event),F=e=>T(e,KeyboardEvent),D=e=>T(e,window.TextTrackCue)||T(e,window.VTTCue),_=e=>T(e,TextTrack)||!C(e)&&P(e.kind),R=e=>T(e,Promise)&&M(e.then);function O(e){return null!==e&&"object"===typeof e&&1===e.nodeType&&"object"===typeof e.style&&"object"===typeof e.ownerDocument}function V(e){return C(e)||(P(e)||x(e)||I(e))&&!e.length||A(e)&&!Object.keys(e).length}function H(e){if(T(e,window.URL))return!0;if(!P(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!V(new URL(t).hostname)}catch{return!1}}var j={nullOrUndefined:C,object:A,number:S,string:P,boolean:E,function:M,array:x,weakMap:L,nodeList:I,element:O,textNode:N,event:$,keyboardEvent:F,cue:D,track:_,promise:R,url:H,empty:V};const U=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find(t=>void 0!==e.style[t]);return!!j.string(i)&&t[i]})();function B(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}i(8237),i(3110);function q(e){return JSON.parse(JSON.stringify(e))}function X(e,t){return t.split(".").reduce((e,t)=>e&&e[t],e)}function z(e={},...t){if(!t.length)return e;const i=t.shift();return j.object(i)?(Object.keys(i).forEach(t=>{j.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),z(e[t],i[t])):Object.assign(e,{[t]:i[t]})}),z(e,...t)):e}function W(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)})}function K(e,t){j.element(e)&&!j.empty(t)&&Object.entries(t).filter(([,e])=>!j.nullOrUndefined(e)).forEach(([t,i])=>e.setAttribute(t,i))}function Y(e,t,i){const s=document.createElement(e);return j.object(t)&&K(s,t),j.string(i)&&(s.textContent=i),s}function Q(e,t){j.element(e)&&j.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)}function J(e,t,i,s){j.element(t)&&t.appendChild(Y(e,i,s))}function G(e){j.nodeList(e)||j.array(e)?Array.from(e).forEach(G):j.element(e)&&j.element(e.parentNode)&&e.parentNode.removeChild(e)}function Z(e){if(!j.element(e))return;let{length:t}=e.childNodes;while(t>0)e.removeChild(e.lastChild),t-=1}function ee(e,t){return j.element(t)&&j.element(t.parentNode)&&j.element(e)?(t.parentNode.replaceChild(e,t),e):null}function te(e,t){if(!j.string(e)||j.empty(e))return{};const i={},s=z({},t);return e.split(",").forEach(e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,""),r=a.split("="),[o]=r,l=r.length>1?r[1].replace(/["']/g,""):"",c=t.charAt(0);switch(c){case".":j.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[o]=l;break;default:break}}),z(s,i)}function ie(e,t){if(!j.element(e))return;let i=t;j.boolean(i)||(i=!e.hidden),e.hidden=i}function se(e,t,i){if(j.nodeList(e))return Array.from(e).map(e=>se(e,t,i));if(j.element(e)){let s="toggle";return"undefined"!==typeof i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function ne(e,t){return j.element(e)&&e.classList.contains(t)}function ae(e,t){const{prototype:i}=Element;function s(){return Array.from(document.querySelectorAll(t)).includes(this)}const n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||s;return n.call(e,t)}function re(e,t){const{prototype:i}=Element;function s(){let e=this;do{if(ae.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}const n=i.closest||s;return n.call(e,t)}function oe(e){return this.elements.container.querySelectorAll(e)}function le(e){return this.elements.container.querySelector(e)}function ce(e=null,t=!1){j.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const he={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ue={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=ue[e]||"html5"!==t,s=i&&ue.rangeInput;return{api:i,ui:s}},pip:(()=>document.pictureInPictureEnabled&&!Y("video").disablePictureInPicture)(),airplay:j.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(j.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(he).includes(i)&&(i+=`; codecs="${he[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==U,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches};var de=ue;const pe=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function me(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||j.empty(t)||!j.function(i))return;const r=t.split(" ");let o=a;pe&&(o={passive:n,capture:a}),r.forEach(t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)})}function ge(e,t="",i,s=!0,n=!1){me.call(this,e,t,i,!0,s,n)}function fe(e,t="",i,s=!0,n=!1){me.call(this,e,t,i,!1,s,n)}function ye(e,t="",i,s=!0,n=!1){const a=(...r)=>{fe(e,t,a,s,n),i.apply(this,r)};me.call(this,e,t,a,!0,s,n)}function be(e,t="",i=!1,s={}){if(!j.element(e)||j.empty(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function ve(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)}),this.eventListeners=[])}function we(){return new Promise(e=>this.ready?setTimeout(e,0):ge.call(this,this.elements.container,"ready",e)).then(()=>{})}function ke(e){j.promise(e)&&e.then(null,()=>{})}function Te(e){return j.array(e)?e.filter((t,i)=>e.indexOf(t)===i):e}function Ce(e,t){return j.array(e)&&e.length?e.reduce((e,i)=>Math.abs(i-t)({...e,[t/i]:[t,i]}),{});function Pe(e){if(!j.array(e)&&(!j.string(e)||!e.includes(":")))return!1;const t=j.array(e)?e:e.split(":");return t.map(Number).every(j.number)}function Ee(e){if(!j.array(e)||!e.every(j.number))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function Me(e){const t=e=>Pe(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!j.empty(this.embed)&&j.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return Ee(i)}function xe(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Me.call(this,e);if(!j.array(i))return{};const[s,n]=Ee(i),a=Ae(`aspect-ratio: ${s}/${n}`),r=100/s*n;if(a?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-r)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:r,ratio:i}}function Le(e,t,i=.05){const s=e/t,n=Ce(Object.keys(Se),s);return Math.abs(n-s)<=i?Se[n]:[e,t]}function Ie(){const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);return[e,t]}const Ne={getSources(){if(!this.isHTML5)return[];const e=Array.from(this.media.querySelectorAll("source"));return e.filter(e=>{const t=e.getAttribute("type");return!!j.empty(t)||de.mime.call(this,t)})},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ne.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,j.empty(this.config.ratio)||xe.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Ne.getSources.call(e),i=t.find(t=>t.getAttribute("src")===e.source);return i&&Number(i.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&j.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Ne.getSources.call(e),s=i.find(e=>Number(e.getAttribute("size"))===t);if(!s)return;const{currentTime:n,paused:a,preload:r,readyState:o,playbackRate:l}=e.media;e.media.src=s.getAttribute("src"),("none"!==r||o)&&(e.once("loadedmetadata",()=>{e.speed=l,e.currentTime=n,a||ke(e.play())}),e.media.load())}be.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(G(Ne.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};var $e=Ne;const Fe=Boolean(window.document.documentMode),De=/Edge/.test(navigator.userAgent),_e="WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),Re=/iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1,Oe="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,Ve=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var He={isIE:Fe,isEdge:De,isWebKit:_e,isIPhone:Re,isIPadOS:Oe,isIos:Ve};function je(e){return`${e}-${Math.floor(1e4*Math.random())}`}function Ue(e,...t){return j.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(e,i)=>t[i].toString())}function Be(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}function qe(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function Xe(e=""){return e.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function ze(e=""){let t=e.toString();return t=qe(t,"-"," "),t=qe(t,"_"," "),t=Xe(t),qe(t," ","")}function We(e=""){let t=e.toString();return t=ze(t),t.charAt(0).toLowerCase()+t.slice(1)}function Ke(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}function Ye(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Qe={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Je={get(e="",t={}){if(j.empty(e)||j.empty(t))return"";let i=X(t.i18n,e);if(j.empty(i))return Object.keys(Qe).includes(e)?Qe[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach(([e,t])=>{i=qe(i,e,t)}),i}};var Ge=Je;class Ze{constructor(e){(0,v.A)(this,"get",e=>{if(!Ze.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(j.empty(t))return null;const i=JSON.parse(t);return j.string(e)&&e.length?i[e]:i}),(0,v.A)(this,"set",e=>{if(!Ze.supported||!this.enabled)return;if(!j.object(e))return;let t=this.get();j.empty(t)&&(t={}),z(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch{}}),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}var et=Ze;function tt(e,t="text",i=!1){return new Promise((s,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;i&&(n.withCredentials=!0),n.addEventListener("load",()=>{if("text"===t)try{s(JSON.parse(n.responseText))}catch{s(n.responseText)}else s(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",e,!0),n.responseType=t,n.send()}catch(a){n(a)}})}function it(e,t){if(!j.string(e))return;const i="cache",s=j.string(t);let n=!1;const a=()=>null!==document.getElementById(t),r=(e,t)=>{e.innerHTML=t,s&&a()||document.body.insertAdjacentElement("afterbegin",e)};if(!s||!a()){const a=et.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),s&&o.setAttribute("id",t),a){const e=window.localStorage.getItem(`${i}-${t}`);if(n=null!==e,n){const t=JSON.parse(e);r(o,t.content)}}tt(e).then(e=>{if(!j.empty(e)){if(a)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch{}r(o,e)}}).catch(()=>{})}}const st=e=>Math.trunc(e/60/60%60,10),nt=e=>Math.trunc(e/60%60,10),at=e=>Math.trunc(e%60,10);function rt(e=0,t=!1,i=!1){if(!j.number(e))return rt(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=st(e);const a=nt(e),r=at(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(r)}`}const ot={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||He.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=le.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:oe.call(this,this.config.selectors.buttons.play),pause:le.call(this,this.config.selectors.buttons.pause),restart:le.call(this,this.config.selectors.buttons.restart),rewind:le.call(this,this.config.selectors.buttons.rewind),fastForward:le.call(this,this.config.selectors.buttons.fastForward),mute:le.call(this,this.config.selectors.buttons.mute),pip:le.call(this,this.config.selectors.buttons.pip),airplay:le.call(this,this.config.selectors.buttons.airplay),settings:le.call(this,this.config.selectors.buttons.settings),captions:le.call(this,this.config.selectors.buttons.captions),fullscreen:le.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=le.call(this,this.config.selectors.progress),this.elements.inputs={seek:le.call(this,this.config.selectors.inputs.seek),volume:le.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:le.call(this,this.config.selectors.display.buffer),currentTime:le.call(this,this.config.selectors.display.currentTime),duration:le.call(this,this.config.selectors.display.duration)},j.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",s=ot.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");K(a,z(t,{"aria-hidden":"true",focusable:"false"}));const r=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in r&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",o),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(r),a},createLabel(e,t={}){const i=Ge.get(e,this.config),s={...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")};return Y("span",s,i)},createBadge(e){if(j.empty(e))return null;const t=Y("span",{class:this.config.classNames.menu.value});return t.appendChild(Y("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=z({},t);let s=We(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])}),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||z(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:j.empty(n.label)&&(n.label=s),j.empty(n.icon)&&(n.icon=e)}const a=Y(n.element);return n.toggle?(a.appendChild(ot.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(ot.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(ot.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(ot.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(ot.createIcon.call(this,n.icon)),a.appendChild(ot.createLabel.call(this,n.label))),z(i,te(this.config.selectors.buttons[s],i)),K(a,i),"play"===s?(j.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=Y("input",z(te(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Ge.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,ot.updateRangeFill.call(this,i),w.setup(i),i},createProgress(e,t){const i=Y("progress",z(te(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(Y("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?Ge.get(t,this.config):"";i.textContent=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=te(this.config.selectors.display[e],t),s=Y("div",z(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Ge.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){ge.call(this,e,"keydown keyup",i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=ae(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(i.key))ot.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,j.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,j.element(t)||(t=e.parentNode.lastElementChild)),ce.call(this,t,!0))}},!1),ge.call(this,e,"keyup",e=>{"Return"===e.key&&ot.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const r=te(this.config.selectors.inputs[i]),o=Y("button",z(r,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${r.class?r.class:""}`.trim(),"aria-checked":a,value:e})),l=Y("span");l.innerHTML=s,j.element(n)&&l.appendChild(n),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get(){return"true"===o.getAttribute("aria-checked")},set(e){e&&Array.from(o.parentNode.children).filter(e=>ae(e,'[role="menuitemradio"]')).forEach(e=>e.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",t=>{if(!j.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e);break;default:break}ot.showMenuPanel.call(this,"home",j.keyboardEvent(t))}},i,!1),ot.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!j.number(e))return e;const i=st(this.duration)>0;return rt(e,i,t)},updateTimeDisplay(e=null,t=0,i=!1){j.element(e)&&j.number(t)&&(e.textContent=ot.formatTime(t,i))},updateVolume(){this.supported.ui&&(j.element(this.elements.inputs.volume)&&ot.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),j.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){j.element(e)&&(e.value=t,ot.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!j.event(e))return;let t=0;const i=(e,t)=>{const i=j.number(t)?t:0,s=j.element(e)?e:this.elements.display.buffer;if(j.element(s)){s.value=i;const e=s.getElementsByTagName("span")[0];j.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":t=Be(this.currentTime,this.duration),"timeupdate"===e.type&&ot.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered);break;default:break}},updateRangeFill(e){const t=j.event(e)?e.target:e;if(j.element(t)&&"range"===t.getAttribute("type")){if(ae(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=ot.formatTime(this.currentTime),i=ot.formatTime(this.duration),s=Ge.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(ae(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(He.isWebKit||He.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){if(!this.config.tooltips.seek||!j.element(this.elements.inputs.seek)||!j.element(this.elements.display.seekTooltip)||0===this.duration)return;const t=this.elements.display.seekTooltip,i=`${this.config.classNames.tooltip}--visible`,s=e=>se(t,i,e);if(this.touch)return void s(!1);let n=0;const a=this.elements.progress.getBoundingClientRect();if(j.event(e)){const t=e.pageX-e.clientX;n=100/a.width*(e.pageX-a.left-t)}else{if(!ne(t,i))return;n=Number.parseFloat(t.style.left,10)}n<0?n=0:n>100&&(n=100);const r=this.duration/100*n;t.textContent=ot.formatTime(r);const o=this.config.markers?.points?.find(({time:e})=>e===Math.round(r));o&&t.insertAdjacentHTML("afterbegin",`${o.label}
`),t.style.left=`${n}%`,j.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&s("mouseenter"===e.type)},timeUpdate(e){const t=!j.element(this.elements.display.duration)&&this.config.invertTime;ot.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||ot.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ie(this.elements.display.currentTime,!0),void ie(this.elements.progress,!0);j.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=j.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&ot.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&ot.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&ot.setMarkers.call(this),ot.updateSeekTooltip.call(this)},toggleMenuButton(e,t){ie(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=j.empty(i)?this[e]:i,j.empty(n)&&(n=this.config[e].default),!j.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(j.element(a)||(a=s&&s.querySelector('[role="menu"]')),!j.element(a))return;const r=this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`);r.innerHTML=ot.getLabel.call(this,e,n);const o=a&&a.querySelector(`[value="${n}"]`);j.element(o)&&(o.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Ge.get("normal",this.config):`${t}×`;case"quality":if(j.number(t)){const e=Ge.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return Xe(t);case"captions":return dt.getLabel.call(this);default:return null}},setQualityMenu(e){if(!j.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');j.array(e)&&(this.options.quality=Te(e).filter(e=>this.config.quality.options.includes(e)));const s=!j.empty(this.options.quality)&&this.options.quality.length>1;if(ot.toggleMenuButton.call(this,t,s),Z(i),ot.checkMenu.call(this),!s)return;const n=e=>{const t=Ge.get(`qualityBadge.${e}`,this.config);return t.length?ot.createBadge.call(this,t):null};this.options.quality.sort((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1}).forEach(e=>{ot.createMenuItem.call(this,{value:e,list:i,type:t,title:ot.getLabel.call(this,"quality",e),badge:n(e)})}),ot.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!j.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=dt.getTracks.call(this),s=Boolean(i.length);if(ot.toggleMenuButton.call(this,e,s),Z(t),ot.checkMenu.call(this),!s)return;const n=i.map((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:dt.getLabel.call(this,e),badge:e.language&&ot.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:Ge.get("disabled",this.config),list:t,type:"language"}),n.forEach(ot.createMenuItem.bind(this)),ot.updateSetting.call(this,e,t)},setSpeedMenu(){if(!j.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(e=>e>=this.minimumSpeed&&e<=this.maximumSpeed);const i=!j.empty(this.options.speed)&&this.options.speed.length>1;ot.toggleMenuButton.call(this,e,i),Z(t),ot.checkMenu.call(this),i&&(this.options.speed.forEach(i=>{ot.createMenuItem.call(this,{value:i,list:t,type:e,title:ot.getLabel.call(this,"speed",i)})}),ot.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!j.empty(e)&&Object.values(e).some(e=>!e.hidden);ie(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;j.element(i)||(i=Object.values(this.elements.settings.panels).find(e=>!e.hidden));const s=i.querySelector('[role^="menuitem"]');ce.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!j.element(t)||!j.element(i))return;const{hidden:s}=t;let n=s;if(j.boolean(e))n=e;else if(j.keyboardEvent(e)&&"Escape"===e.key)n=!1;else if(j.event(e)){const s=j.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),ie(t,!n),se(this.elements.container,this.config.classNames.menu.open,n),n&&j.keyboardEvent(e)?ot.focusFirstMenuItem.call(this,null,!0):n||s||ce.call(this,i,j.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,s=t.scrollHeight;return G(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!j.element(i))return;const s=i.parentNode,n=Array.from(s.children).find(e=>!e.hidden);if(de.transitions&&!de.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=ot.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",fe.call(this,s,U,t))};ge.call(this,s,U,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}ie(n,!0),ie(i,!1),ot.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;j.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:r,setSpeedMenu:o,showMenuPanel:l}=ot;this.elements.controls=null,j.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=Y("div",te(this.config.selectors.controls.wrapper));this.elements.controls=c;const h={class:"plyr__controls__item"};return Te(j.array(this.config.controls)?this.config.controls:[]).forEach(r=>{if("restart"===r&&c.appendChild(i.call(this,"restart",h)),"rewind"===r&&c.appendChild(i.call(this,"rewind",h)),"play"===r&&c.appendChild(i.call(this,"play",h)),"fast-forward"===r&&c.appendChild(i.call(this,"fast-forward",h)),"progress"===r){const t=Y("div",{class:`${h.class} plyr__progress__container`}),i=Y("div",te(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=Y("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===r&&c.appendChild(a.call(this,"currentTime",h)),"duration"===r&&c.appendChild(a.call(this,"duration",h)),"mute"===r||"volume"===r){let{volume:t}=this.elements;if(j.element(t)&&c.contains(t)||(t=Y("div",z({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===r&&t.appendChild(i.call(this,"mute")),"volume"===r&&!He.isIos&&!He.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",z(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===r&&c.appendChild(i.call(this,"captions",h)),"settings"===r&&!j.empty(this.config.settings)){const s=Y("div",z({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=Y("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=Y("div"),r=Y("div",{id:`plyr-settings-${e.id}-home`}),o=Y("div",{role:"menu"});r.appendChild(o),a.appendChild(r),this.elements.settings.panels.home=r,this.config.settings.forEach(i=>{const s=Y("button",z(te(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,s,i),ge.call(this,s,"click",()=>{l.call(this,i,!1)});const n=Y("span",null,Ge.get(i,this.config)),r=Y("span",{class:this.config.classNames.menu.value});r.innerHTML=e[i],n.appendChild(r),s.appendChild(n),o.appendChild(s);const c=Y("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),h=Y("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});h.appendChild(Y("span",{"aria-hidden":!0},Ge.get(i,this.config))),h.appendChild(Y("span",{class:this.config.classNames.hidden},Ge.get("menuBack",this.config))),ge.call(this,c,"keydown",e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))},!1),ge.call(this,h,"click",()=>{l.call(this,"home",!1)}),c.appendChild(h),c.appendChild(Y("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c}),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===r&&de.pip&&c.appendChild(i.call(this,"pip",h)),"airplay"===r&&de.airplay&&c.appendChild(i.call(this,"airplay",h)),"download"===r){const e=z({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!j.url(t)&&this.isEmbed&&z(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===r&&c.appendChild(i.call(this,"fullscreen",h))}),this.isHTML5&&r.call(this,$e.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=ot.getIconUrl.call(this);e.cors&&it(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;j.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),j.element(this.config.controls)||j.string(this.config.controls)?e=this.config.controls:(e=ot.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:dt.getLabel.call(this)}),i=!1);const s=e=>{let i=e;return Object.entries(t).forEach(([e,t])=>{i=qe(i,`{${e}}`,t)}),i};let n;i&&j.string(this.config.controls)&&(e=s(e)),j.string(this.config.selectors.controls.container)&&(n=document.querySelector(this.config.selectors.controls.container)),j.element(n)||(n=this.elements.container);const a=j.element(e)?"insertAdjacentElement":"insertAdjacentHTML";if(n[a]("afterbegin",e),j.element(this.elements.controls)||ot.findElements.call(this),!j.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get(){return ne(e,t)},set(i=!1){se(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(t=>{j.array(t)||j.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)})}if(He.isEdge&&B(n),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=oe.call(this,i);Array.from(s).forEach(e=>{se(e,this.config.classNames.hidden,!1),se(e,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){if(!this.duration||this.elements.markers)return;const e=this.config.markers?.points?.filter(({time:e})=>e>0&&ese(s,n,e);e.forEach(e=>{const t=Y("span",{class:this.config.classNames.marker},""),n=e.time/this.duration*100+"%";s&&(t.addEventListener("mouseenter",()=>{e.label||(s.style.left=n,s.innerHTML=e.label,a(!0))}),t.addEventListener("mouseleave",()=>{a(!1)})),t.addEventListener("click",()=>{this.currentTime=e.time}),t.style.left=n,i.appendChild(t)}),t.appendChild(i),this.config.tooltips.seek||(s=Y("span",{class:this.config.classNames.tooltip},""),t.appendChild(s)),this.elements.markers={points:i,tip:s},this.elements.progress.appendChild(t)}};var lt=ot;function ct(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch{return null}}function ht(e){const t=new URLSearchParams;return j.object(e)&&Object.entries(e).forEach(([e,i])=>{t.set(e,i)}),t}const ut={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!de.textTracks)return void(j.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&<.setCaptionsMenu.call(this));if(j.element(this.elements.captions)||(this.elements.captions=Y("div",te(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Q(this.elements.captions,this.elements.wrapper)),He.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach(e=>{const t=e.getAttribute("src"),i=ct(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&tt(t,"blob").then(t=>{e.setAttribute("src",window.URL.createObjectURL(t))}).catch(()=>{G(e)})})}const e=navigator.languages||[navigator.language||navigator.userLanguage||"en"],t=Te(e.map(e=>e.split("-")[0]));let i=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();"auto"===i&&([i]=t);let s=this.storage.get("captions")||this.captions.active;if(j.boolean(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:i,languages:t}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";ge.call(this,this.media.textTracks,e,ut.update.bind(this))}setTimeout(ut.update.bind(this),0)},update(){const e=ut.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find(e=>e.language===i));this.isHTML5&&this.isVideo&&e.filter(e=>!s.get(e)).forEach(e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),ge.call(this,e,"cuechange",()=>ut.updateCues.call(this))}),(a&&this.language!==i||!e.includes(n))&&(ut.setLanguage.call(this,i),ut.toggle.call(this,t&&a)),this.elements&&se(this.elements.container,this.config.classNames.captions.enabled,!j.empty(e)),j.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&<.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=j.nullOrUndefined(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=ut.getTracks.call(this),t=ut.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void ut.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),se(this.elements.container,s,n),this.captions.toggled=n,lt.updateSetting.call(this,"captions"),be.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const i=ut.getTracks.call(this);if(-1!==e)if(j.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,lt.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),be.call(this,this.media,"languagechange")}ut.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&ut.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else ut.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!j.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=ut.getTracks.call(this),n=ut.findTrack.call(this,[i]);ut.set.call(this,s.indexOf(n),t)},getTracks(e=!1){const t=Array.from((this.media||{}).textTracks||[]);return t.filter(t=>!this.isHTML5||e||this.captions.meta.has(t)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(e,t=!1){const i=ut.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort((e,t)=>s(t)-s(e));let a;return e.every(e=>(a=n.find(t=>t.language===e),!a)),a||(t?n[0]:void 0)},getCurrentTrack(){return ut.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!j.track(t)&&de.textTracks&&this.captions.toggled&&(t=ut.getCurrentTrack.call(this)),j.track(t)?j.empty(t.label)?j.empty(t.language)?Ge.get("enabled",this.config):e.language.toUpperCase():t.label:Ge.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!j.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!j.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=ut.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map(e=>e.getCueAsHTML()).map(Ye)}const i=t.map(e=>e.trim()).join("\n"),s=i!==this.elements.captions.innerHTML;if(s){Z(this.elements.captions);const e=Y("span",te(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),be.call(this,this.media,"cuechange")}}};var dt=ut;const pt={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.8.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}};var mt=pt;const gt={active:"picture-in-picture",inactive:"inline"};const ft={html5:"html5",youtube:"youtube",vimeo:"vimeo"},yt={audio:"audio",video:"video"};function bt(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?ft.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?ft.vimeo:null}function vt(){}class wt{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):vt}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):vt}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):vt}}class kt{constructor(e){(0,v.A)(this,"onChange",()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;j.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;be.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)}),(0,v.A)(this,"toggleFallback",(e=!1)=>{if(e?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",se(this.target,this.player.config.classNames.fullscreen.fallback,e),He.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=j.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter(e=>e.trim()!==i).join(","))}this.onChange()}),(0,v.A)(this,"trapFocus",e=>{if(He.isIos||He.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=oe.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())}),(0,v.A)(this,"update",()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":kt.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");se(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),(0,v.A)(this,"enter",()=>{this.supported&&(He.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!kt.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?j.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),(0,v.A)(this,"exit",()=>{if(this.supported)if(He.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),ke(this.player.play());else if(!kt.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!j.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),(0,v.A)(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=e,this.prefix=kt.prefix,this.property=kt.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===e.config.fullscreen.fallback,this.player.elements.fullscreen=e.config.fullscreen.container&&re(this.player.elements.container,e.config.fullscreen.container),ge.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),ge.call(this.player,this.player.elements.container,"dblclick",e=>{j.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")}),ge.call(this,this.player.elements.container,"keydown",e=>this.trapFocus(e)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return kt.nativeSupported&&!this.forceFallback}static get prefix(){if(j.function(document.exitFullscreen))return"";let e="";const t=["webkit","moz","ms"];return t.some(t=>!(!j.function(document[`${t}ExitFullscreen`])&&!j.function(document[`${t}CancelFullScreen`]))&&(e=t,!0)),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,kt.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||kt.nativeSupported||!He.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!kt.nativeSupported||this.forceFallback)return ne(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return He.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}var Tt=kt;function Ct(e,t=1){return new Promise((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})})}const At={addStyleHook(){se(this.elements.container,this.config.selectors.container.replace(".",""),!0),se(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void At.toggleNativeControls.call(this,!0);j.element(this.elements.controls)||(lt.inject.call(this),this.listeners.controls()),At.toggleNativeControls.call(this),this.isHTML5&&dt.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,lt.updateVolume.call(this),lt.timeUpdate.call(this),lt.durationUpdate.call(this),At.checkPlaying.call(this),se(this.elements.container,this.config.classNames.pip.supported,de.pip&&this.isHTML5&&this.isVideo),se(this.elements.container,this.config.classNames.airplay.supported,de.airplay&&this.isHTML5),se(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{be.call(this,this.media,"ready")},0),At.setTitle.call(this),this.poster&&At.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&<.durationUpdate.call(this),this.config.mediaMetadata&<.setMediaMetadata.call(this)},setTitle(){let e=Ge.get("play",this.config);if(j.string(this.config.title)&&!j.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const e=le.call(this,"iframe");if(!j.element(e))return;const t=j.empty(this.config.title)?"video":this.config.title,i=Ge.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){se(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),we.call(this).then(()=>Ct(e)).catch(t=>{throw e===this.poster&&At.togglePoster.call(this,!1),t}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),At.togglePoster.call(this,!0),e)))},checkPlaying(e){se(this.elements.container,this.config.classNames.playing,this.playing),se(this.elements.container,this.config.classNames.paused,this.paused),se(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Ge.get(this.playing?"pause":"play",this.config))}),j.event(e)&&"timeupdate"===e.type||At.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{se(this.elements.container,this.config.classNames.loading,this.loading),At.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!j.empty(e)&&j.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),j.empty(this.media.style)&&this.media.removeAttribute("style")}};var St=At;class Pt{constructor(e){(0,v.A)(this,"firstTouch",()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,se(t.container,e.config.classNames.isTouch,!0)}),(0,v.A)(this,"global",(e=!0)=>{const{player:t}=this;t.config.keyboard.global&&me.call(t,window,"keydown keyup",this.handleKey,e,!1),me.call(t,document.body,"click",this.toggleMenu,e),ye.call(t,document.body,"touchstart",this.firstTouch)}),(0,v.A)(this,"container",()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&ge.call(e,i.container,"keydown keyup",this.handleKey,!1),ge.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);const a=["touchstart","touchmove","mousemove"].includes(t.type);let r=0;a&&(St.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout(()=>St.toggleControls.call(e,!1),r)});const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=Me.call(e),r=Ae(`aspect-ratio: ${n} / ${a}`);if(!s)return void(r?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=Ie(),c=o/l>n/a;r?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};ge.call(e,i.container,"enterfullscreen exitfullscreen",t=>{const{target:s}=e.fullscreen;if(s!==i.container)return;if(!e.isEmbed&&j.empty(e.config.ratio))return;n();const r="enterfullscreen"===t.type?ge:fe;r.call(e,window,"resize",a)})}),(0,v.A)(this,"media",()=>{const{player:e}=this,{elements:t}=e;if(ge.call(e,e.media,"timeupdate seeking seeked",t=>lt.timeUpdate.call(e,t)),ge.call(e,e.media,"durationchange loadeddata loadedmetadata",t=>lt.durationUpdate.call(e,t)),ge.call(e,e.media,"ended",()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())}),ge.call(e,e.media,"progress playing seeking seeked",t=>lt.updateProgress.call(e,t)),ge.call(e,e.media,"volumechange",t=>lt.updateVolume.call(e,t)),ge.call(e,e.media,"playing play pause ended emptied timeupdate",t=>St.checkPlaying.call(e,t)),ge.call(e,e.media,"waiting canplay seeked playing",t=>St.checkLoading.call(e,t)),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=le.call(e,`.${e.config.classNames.video}`);if(!j.element(i))return;ge.call(e,t.container,"click",s=>{const n=[t.container,i];(n.includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,()=>{ke(e.play())},"play")):this.proxy(s,()=>{ke(e.togglePlay())},"play")))})}e.supported.ui&&e.config.disableContextMenu&&ge.call(e,t.wrapper,"contextmenu",e=>{e.preventDefault()},!1),ge.call(e,e.media,"volumechange",()=>{e.storage.set({volume:e.volume,muted:e.muted})}),ge.call(e,e.media,"ratechange",()=>{lt.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),ge.call(e,e.media,"qualitychange",t=>{lt.updateSetting.call(e,"quality",null,t.detail.quality)}),ge.call(e,e.media,"ready qualitychange",()=>{lt.setDownloadUrl.call(e)});const i=e.config.events.concat(["keyup","keydown"]).join(" ");ge.call(e,e.media,i,i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),be.call(e,t.container,i.type,!0,s)})}),(0,v.A)(this,"proxy",(e,t,i)=>{const{player:s}=this,n=s.config.listeners[i],a=j.function(n);let r=!0;a&&(r=n.call(s,e)),!1!==r&&j.function(t)&&t.call(s,e)}),(0,v.A)(this,"bind",(e,t,i,s,n=!0)=>{const{player:a}=this,r=a.config.listeners[s],o=j.function(r);ge.call(a,e,t,e=>this.proxy(e,i,s),n&&!o)}),(0,v.A)(this,"controls",()=>{const{player:e}=this,{elements:t}=e,i=He.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach(t=>{this.bind(t,"click",()=>{ke(e.togglePlay())},"play")}),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",()=>{e.lastSeekTime=Date.now(),e.rewind()},"rewind"),this.bind(t.buttons.fastForward,"click",()=>{e.lastSeekTime=Date.now(),e.forward()},"fastForward"),this.bind(t.buttons.mute,"click",()=>{e.muted=!e.muted},"mute"),this.bind(t.buttons.captions,"click",()=>e.toggleCaptions()),this.bind(t.buttons.download,"click",()=>{be.call(e,e.media,"download")},"download"),this.bind(t.buttons.fullscreen,"click",()=>{e.fullscreen.toggle()},"fullscreen"),this.bind(t.buttons.pip,"click",()=>{e.pip="toggle"},"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",t=>{t.stopPropagation(),t.preventDefault(),lt.toggleMenu.call(e,t)},null,!1),this.bind(t.buttons.settings,"keyup",t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),lt.toggleMenu.call(e,t)):lt.focusFirstMenuItem.call(e,null,!0))},null,!1),this.bind(t.settings.menu,"keydown",t=>{"Escape"===t.key&<.toggleMenu.call(e,t)}),this.bind(t.inputs.seek,"mousedown mousemove",e=>{const i=t.progress.getBoundingClientRect(),s=e.pageX-e.clientX,n=100/i.width*(e.pageX-i.left-s);e.currentTarget.setAttribute("seek-value",n)}),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",t=>{const i=t.currentTarget,s="play-on-seeked";if(j.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),ke(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())}),He.isIos){const t=oe.call(e,'input[type="range"]');Array.from(t).forEach(e=>this.bind(e,i,e=>B(e.target)))}this.bind(t.inputs.seek,i,t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");j.empty(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration},"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",t=>lt.updateSeekTooltip.call(e,t)),this.bind(t.progress,"mousemove touchmove",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)}),this.bind(t.progress,"mouseleave touchend click",()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)}),this.bind(t.progress,"mousedown touchstart",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)}),this.bind(t.progress,"mouseup touchend",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)}),He.isWebKit&&Array.from(oe.call(e,'input[type="range"]')).forEach(t=>{this.bind(t,"input",t=>lt.updateRangeFill.call(e,t.target))}),e.config.toggleInvert&&!j.element(t.display.duration)&&this.bind(t.display.currentTime,"click",()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,lt.timeUpdate.call(e))}),this.bind(t.inputs.volume,i,t=>{e.volume=t.target.value},"volume"),this.bind(t.controls,"mouseenter mouseleave",i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type}),t.fullscreen&&Array.from(t.fullscreen.children).filter(e=>!e.contains(t.container)).forEach(i=>{this.bind(i,"mouseenter mouseleave",i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)})}),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(t.controls,"focusin",()=>{const{config:i,timers:s}=e;se(t.controls,i.classNames.noTransition,!0),St.toggleControls.call(e,!0),setTimeout(()=>{se(t.controls,i.classNames.noTransition,!1)},0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout(()=>St.toggleControls.call(e,!1),n)}),this.bind(t.inputs.volume,"wheel",t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map(e=>i?-e:e),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:r}=e.media;(1===a&&r<1||-1===a&&r>0)&&t.preventDefault()},"volume",!1)}),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:r,metaKey:o,shiftKey:l}=e,c="keydown"===n,h=c&&s===this.lastKey;if(a||r||o||l)return;if(!s)return;const u=e=>{t.currentTime=t.duration/10*e};if(c){const n=document.activeElement;if(j.element(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&ae(n,s))return;if(" "===e.key&&ae(n,'button, [role^="menuitem"]'))return}const a=[" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"];switch(a.includes(s)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":h||u(Number.parseInt(s,10));break;case" ":case"k":h||ke(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":h||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":h||t.toggleCaptions();break;case"l":t.loop=!t.loop;break;default:break}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null}toggleMenu(e){lt.toggleMenu.call(this.player,e)}}var Et=Pt,Mt=i(1583);function xt(e){return new Promise((t,i)=>{Mt(e,{success:t,error:i})})}function Lt(e){if(j.empty(e))return null;if(j.number(Number(e)))return e;const t=/^.*(vimeo.com\/|video\/)(\d+).*/,i=e.match(t);return i?i[2]:e}function It(e){const t=/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/,i=e.match(t);return i&&5===i.length?i[4]:null}function Nt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,be.call(this,this.media,e?"play":"pause"))}const $t={setup(){const e=this;se(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,xe.call(e),j.object(window.Vimeo)?$t.ready.call(e):xt(e.config.urls.vimeo.sdk).then(()=>{$t.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:s,...n}=t;let a=e.media.getAttribute("src"),r="";j.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),r=e.media.getAttribute(e.config.attributes.embed.hash)):r=It(a);const o=r?{h:r}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const l=ht({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...n}),c=Lt(a),h=Y("iframe"),u=Ue(e.config.urls.vimeo.iframe,c,l);if(h.setAttribute("src",u),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),j.empty(s)||h.setAttribute("referrerPolicy",s),i||!t.customControls)h.setAttribute("data-poster",e.poster),e.media=ee(h,e.media);else{const t=Y("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(h),e.media=ee(t,e.media)}t.customControls||tt(Ue(e.config.urls.vimeo.api,u)).then(t=>{!j.empty(t)&&t.thumbnail_url&&St.setPoster.call(e,t.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(h,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Nt.call(e,!0),e.embed.play()),e.media.pause=()=>(Nt.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:d}=e.media;Object.defineProperty(e.media,"currentTime",{get(){return d},set(t){const{embed:i,media:s,paused:n,volume:a}=e,r=n&&!i.hasPlayed;s.seeking=!0,be.call(e,s,"seeking"),Promise.resolve(r&&i.setVolume(0)).then(()=>i.setCurrentTime(t)).then(()=>r&&i.pause()).then(()=>r&&i.setVolume(a)).catch(()=>{})}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get(){return p},set(t){e.embed.setPlaybackRate(t).then(()=>{p=t,be.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get(){return m},set(t){e.embed.setVolume(t).then(()=>{m=t,be.call(e,e.media,"volumechange")})}});let{muted:g}=e.config;Object.defineProperty(e.media,"muted",{get(){return g},set(t){const i=!!j.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then(()=>{g=i,be.call(e,e.media,"volumechange")})}});let f,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get(){return y},set(t){const i=j.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then(()=>{y=i})}}),e.embed.getVideoUrl().then(t=>{f=t,lt.setDownloadUrl.call(e)}).catch(e=>{this.debug.warn(e)}),Object.defineProperty(e.media,"currentSrc",{get(){return f}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(t=>{const[i,s]=t;e.embed.ratio=Le(i,s),xe.call(this)}),e.embed.setAutopause(e.config.autopause).then(t=>{e.config.autopause=t}),e.embed.getVideoTitle().then(t=>{e.config.title=t,St.setTitle.call(this)}),e.embed.getCurrentTime().then(t=>{d=t,be.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(t=>{e.media.duration=t,be.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(t=>{e.media.textTracks=t,dt.setup.call(e)}),e.embed.on("cuechange",({cues:t=[]})=>{const i=t.map(e=>Ke(e.text));dt.updateCues.call(e,i)}),e.embed.on("loaded",()=>{if(e.embed.getPaused().then(t=>{Nt.call(e,!t),t||be.call(e,e.media,"playing")}),j.element(e.embed.element)&&e.supported.ui){const t=e.embed.element;t.setAttribute("tabindex",-1)}}),e.embed.on("bufferstart",()=>{be.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{be.call(e,e.media,"playing")}),e.embed.on("play",()=>{Nt.call(e,!0),be.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Nt.call(e,!1)}),e.embed.on("timeupdate",t=>{e.media.seeking=!1,d=t.seconds,be.call(e,e.media,"timeupdate")}),e.embed.on("progress",t=>{e.media.buffered=t.percent,be.call(e,e.media,"progress"),1===Number.parseInt(t.percent,10)&&be.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(t=>{t!==e.media.duration&&(e.media.duration=t,be.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,be.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,be.call(e,e.media,"ended")}),e.embed.on("error",t=>{e.media.error=t,be.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>St.build.call(e),0)}};var Ft=$t;function Dt(e){if(j.empty(e))return null;const t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,i=e.match(t);return i&&i[2]?i[2]:e}function _t(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,be.call(this,this.media,e?"play":"pause"))}function Rt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const Ot={setup(){if(se(this.elements.wrapper,this.config.classNames.embed,!0),j.object(window.YT)&&j.function(window.YT.Player))Ot.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{j.function(e)&&e(),Ot.ready.call(this)},xt(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(e){const t=Ue(this.config.urls.youtube.api,e);tt(t).then(e=>{if(j.object(e)){const{title:t,height:i,width:s}=e;this.config.title=t,St.setTitle.call(this),this.embed.ratio=Le(s,i)}xe.call(this)}).catch(()=>{xe.call(this)})},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!j.empty(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");j.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=Dt(s),a=je(e.provider),r=Y("div",{id:a,"data-poster":t.customControls?e.poster:void 0});if(e.media=ee(r,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Ct(t("maxres"),121).catch(()=>Ct(t("sd"),121)).catch(()=>Ct(t("hq"))).then(t=>St.setPoster.call(e,t.src)).then(t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:n,host:Rt(t),playerVars:z({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,s={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occurred";e.media.error={code:i,message:s},be.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),be.call(e,e.media,"ratechange")},onReady(i){if(j.function(e.media.play))return;const s=i.target;Ot.getTitle.call(e,n),e.media.play=()=>{_t.call(e,!0),s.playVideo()},e.media.pause=()=>{_t.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get(){return Number(s.getCurrentTime())},set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,be.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get(){return s.getPlaybackRate()},set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get(){return a},set(t){a=t,s.setVolume(100*a),be.call(e,e.media,"volumechange")}});let{muted:r}=e.config;Object.defineProperty(e.media,"muted",{get(){return r},set(t){const i=j.boolean(t)?t:r;r=i,s[i?"mute":"unMute"](),s.setVolume(100*a),be.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get(){return s.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter(t=>e.config.speed.options.includes(t)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),be.call(e,e.media,"timeupdate"),be.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBufferedSt.build.call(e),50)},onStateChange(i){const s=i.target;clearInterval(e.timers.playing);const n=e.media.seeking&&[1,2].includes(i.data);switch(n&&(e.media.seeking=!1,be.call(e,e.media,"seeked")),i.data){case-1:be.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),be.call(e,e.media,"progress");break;case 0:_t.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):be.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(_t.call(e,!0),be.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{be.call(e,e.media,"timeupdate")},50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),be.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),_t.call(e,!1);break;case 3:be.call(e,e.media,"waiting");break;default:break}be.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}};var Vt=Ot;const Ht={setup(){this.media?(se(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),se(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&se(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Y("div",{class:this.config.classNames.video}),W(this.media,this.elements.wrapper),this.elements.poster=Y("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?$e.setup.call(this):this.isYouTube?Vt.setup.call(this):this.isVimeo&&Ft.setup.call(this)):this.debug.warn("No media element found!")}};var jt=Ht;function Ut(e){e.manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()}class Bt{constructor(e){(0,v.A)(this,"load",()=>{this.enabled&&(j.object(window.google)&&j.object(window.google.ima)?this.ready():xt(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),(0,v.A)(this,"ready",()=>{this.enabled||Ut(this),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),(0,v.A)(this,"setupIMA",()=>{this.elements.container=Y("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>this.onAdsManagerLoaded(e),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e),!1),this.requestAds()}),(0,v.A)(this,"requestAds",()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(t){this.onAdError(t)}}),(0,v.A)(this,"pollCountdown",(e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");const t=()=>{const e=rt(Math.max(this.manager.getRemainingTime(),0)),t=`${Ge.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)};this.countdownTimer=setInterval(t,100)}),(0,v.A)(this,"onAdsManagerLoaded",e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e)),Object.keys(google.ima.AdEvent.Type).forEach(e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],e=>this.onAdEvent(e))}),this.trigger("loaded")}),(0,v.A)(this,"addCuePoints",()=>{j.empty(this.cuePoints)||this.cuePoints.forEach(e=>{if(0!==e&&-1!==e&&e{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData(),n=e=>{be.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)};switch(n(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`);break;default:break}}),(0,v.A)(this,"onAdError",e=>{this.cancel(),this.player.debug.warn("Ads error",e)}),(0,v.A)(this,"listeners",()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{t=this.player.currentTime}),this.player.on("seeked",()=>{const e=this.player.currentTime;j.empty(this.cuePoints)||this.cuePoints.forEach((i,s)=>{t{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)})}),(0,v.A)(this,"play",()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(t){this.onAdError(t)}}).catch(()=>{})}),(0,v.A)(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,ke(this.player.media.play())}),(0,v.A)(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),(0,v.A)(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),(0,v.A)(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(e=>{this.on("loaded",e),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),(0,v.A)(this,"trigger",(e,...t)=>{const i=this.events[e];j.array(i)&&i.forEach(e=>{j.function(e)&&e.apply(this,t)})}),(0,v.A)(this,"on",(e,t)=>(j.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this)),(0,v.A)(this,"startSafetyTimer",(e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},e)}),(0,v.A)(this,"clearSafetyTimer",e=>{j.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((e,t)=>{this.on("loaded",e),this.on("error",t)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!j.empty(e.publisherId)||j.url(e.tagUrl))}get tagUrl(){const{config:e}=this;if(j.url(e.tagUrl))return e.tagUrl;const t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId},i="https://go.aniview.com/api/adserver6/vast/";return`${i}?${ht(t)}`}}var qt=Bt;function Xt(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function zt(e){const t=[],i=e.split(/\r\n\r\n|\n\n|\r\r/);return i.forEach(e=>{const i={},s=e.split(/\r\n|\n|\r/);s.forEach(e=>{if(j.number(i.startTime)){if(!j.empty(e.trim())&&j.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}}),i.text&&t.push(i)}),t}function Wt(e,t){const i=t.width/t.height,s={};return e>i?(s.width=t.width,s.height=1/e*t.width):(s.height=t.height,s.width=e*t.height),s}class Kt{constructor(e){(0,v.A)(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),(0,v.A)(this,"getThumbnails",()=>new Promise(e=>{const{src:t}=this.player.config.previewThumbnails;if(j.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort((e,t)=>e.height-t.height),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(j.function(t))t(e=>{this.thumbnails=e,i()});else{const e=j.string(t)?[t]:t,s=e.map(e=>this.getThumbnail(e));Promise.all(s).then(i)}})),(0,v.A)(this,"getThumbnail",e=>new Promise(t=>{tt(e,void 0,this.player.config.previewThumbnails.withCredentials).then(i=>{const s={frames:zt(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text})})),(0,v.A)(this,"startMove",e=>{if(this.loaded&&j.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{const t=this.player.elements.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(i/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.textContent=rt(this.seekTime);const s=this.player.config.markers?.points?.find(({time:e})=>e===Math.round(this.seekTime));s&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${s.label}
`)}this.showImageAtCurrentTime()}}),(0,v.A)(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),(0,v.A)(this,"startScrubbing",e=>{(j.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),(0,v.A)(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ye.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),(0,v.A)(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),(0,v.A)(this,"render",()=>{this.elements.thumb.container=Y("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Y("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=Y("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Y("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),j.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Y("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),(0,v.A)(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),(0,v.A)(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex(e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)}),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))}),(0,v.A)(this,"loadImage",(e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,r=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=r,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${r}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}}),(0,v.A)(this,"showImage",(e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))}),(0,v.A)(this,"removeOldImages",e=>{Array.from(this.currentImageContainer.children).forEach(t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout(()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)},i)}})}),(0,v.A)(this,"preloadNearby",(e,t=!0)=>new Promise(i=>{setTimeout(()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach(e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}}),a||i()}},300)})),(0,v.A)(this,"getHigherQuality",(e,t,i,s)=>{if(e{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))},300)}}),(0,v.A)(this,"toggleThumbContainer",(e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}),(0,v.A)(this,"toggleScrubbingContainer",(e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}),(0,v.A)(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),(0,v.A)(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()}),(0,v.A)(this,"setThumbContainerPos",()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,r=Xt(a,s,n);i.style.left=`${r}px`,i.style.setProperty("--preview-arrow-offset",a-r+"px")}),(0,v.A)(this,"setScrubbingContainerSize",()=>{const{width:e,height:t}=Wt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`}),(0,v.A)(this,"setImageSizeAndOffset",(e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`}),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=Wt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}var Yt=Kt;const Qt={insertElements(e,t){j.string(t)?J(e,this.media,{src:t}):j.array(t)&&t.forEach(t=>{J(e,this.media,t)})},change(e){X(e,"sources.length")?($e.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],G(this.media),this.media=null,j.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=ft.html5,src:n}]=t,a="html5"===s?i:"div",r="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:de.check(i,s,this.config.playsinline),media:Y(a,r)}),this.elements.container.appendChild(this.media),j.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),j.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),St.addStyleHook.call(this),this.isHTML5&&Qt.insertElements.call(this,"source",t),this.config.title=e.title,jt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Qt.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&St.build.call(this),this.isHTML5&&this.media.load(),j.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Yt(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};var Jt=Qt;class Gt{constructor(e,t){if((0,v.A)(this,"play",()=>j.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>ke(this.media.play())),this.media.play()):null),(0,v.A)(this,"pause",()=>this.playing&&j.function(this.media.pause)?this.media.pause():null),(0,v.A)(this,"togglePlay",e=>{const t=j.boolean(e)?e:!this.playing;return t?this.play():this.pause()}),(0,v.A)(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):j.function(this.media.stop)&&this.media.stop()}),(0,v.A)(this,"restart",()=>{this.currentTime=0}),(0,v.A)(this,"rewind",e=>{this.currentTime-=j.number(e)?e:this.config.seekTime}),(0,v.A)(this,"forward",e=>{this.currentTime+=j.number(e)?e:this.config.seekTime}),(0,v.A)(this,"increaseVolume",e=>{const t=this.media.muted?0:this.volume;this.volume=t+(j.number(e)?e:0)}),(0,v.A)(this,"decreaseVolume",e=>{this.increaseVolume(-e)}),(0,v.A)(this,"airplay",()=>{de.airplay&&this.media.webkitShowPlaybackTargetPicker()}),(0,v.A)(this,"toggleControls",e=>{if(this.supported.ui&&!this.isAudio){const t=ne(this.elements.container,this.config.classNames.hideControls),i="undefined"===typeof e?void 0:!e,s=se(this.elements.container,this.config.classNames.hideControls,i);if(s&&j.array(this.config.controls)&&this.config.controls.includes("settings")&&!j.empty(this.config.settings)&<.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";be.call(this,this.media,e)}return!s}return!1}),(0,v.A)(this,"on",(e,t)=>{ge.call(this,this.elements.container,e,t)}),(0,v.A)(this,"once",(e,t)=>{ye.call(this,this.elements.container,e,t)}),(0,v.A)(this,"off",(e,t)=>{fe(this.elements.container,e,t)}),(0,v.A)(this,"destroy",(e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(G(this.elements.buttons.play),G(this.elements.captions),G(this.elements.controls),G(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),j.function(e)&&e()):(ve.call(this),$e.cancelRequests.call(this),ee(this.elements.original,this.elements.container),be.call(this,this.elements.original,"destroyed",!0),j.function(e)&&e.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(St.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&j.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}),(0,v.A)(this,"supports",e=>de.mime.call(this,e)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=de.touch,this.media=e,j.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||j.nodeList(this.media)||j.array(this.media))&&(this.media=this.media[0]),this.config=z({},mt,Gt.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new wt(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",de),j.nullOrUndefined(this.media)||!j.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!de.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const s=this.media.tagName.toLowerCase();let n=null,a=null;switch(s){case"div":if(n=this.media.querySelector("iframe"),j.element(n)){if(a=ct(n.getAttribute("src")),this.provider=bt(a.toString()),this.elements.container=this.media,this.media=n,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(j.empty(this.provider)||!Object.values(ft).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=yt.video;break;case"video":case"audio":this.type=s,this.provider=ft.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=de.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Et(this),this.storage=new et(this),this.media.plyr=this,j.element(this.elements.container)||(this.elements.container=Y("div"),W(this.media,this.elements.container)),St.migrateStyles.call(this),St.addStyleHook.call(this),jt.setup.call(this),this.config.debug&&ge.call(this,this.elements.container,this.config.events.join(" "),e=>{this.debug.log(`event: ${e.type}`)}),this.fullscreen=new Tt(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&St.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new qt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>ke(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Yt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===ft.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===ft.youtube}get isVimeo(){return this.provider===ft.vimeo}get isVideo(){return this.type===yt.video}get isAudio(){return this.type===yt.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=j.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return j.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,i=j.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;const i=1,s=0;j.string(t)&&(t=Number(t)),j.number(t)||(t=this.storage.get("volume")),j.number(t)||({volume:t}=this.config),t>i&&(t=i),t0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;j.boolean(t)||(t=this.storage.get("muted")),j.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;j.number(e)&&(t=e),j.number(t)||(t=this.storage.get("speed")),j.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=Xt(t,i,s),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!j.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(j.number),n=!0;if(!i.includes(s)){const e=Ce(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=j.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){Jt.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return j.url(e)?e:this.source}set download(e){j.url(e)&&(this.config.urls.download=e,lt.setDownloadUrl.call(this))}set poster(e){this.isVideo?St.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Ee(Me.call(this));return j.array(e)?e.join(":"):e}set ratio(e){this.isVideo?j.string(e)&&Pe(e)?(this.config.ratio=Ee(e),xe.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=j.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){dt.toggle.call(this,e,!1)}set currentTrack(e){dt.set.call(this,e,!1),dt.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){dt.setLanguage.call(this,e,!1)}get language(){return(dt.getCurrentTrack.call(this)||{}).language}set pip(e){if(!de.pip)return;const t=j.boolean(e)?e:!this.pip;j.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?gt.active:gt.inactive),j.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return de.pip?j.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===gt.active:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Yt(this))}static supported(e,t){return de.check(e,t)}static loadSprite(e,t){return it(e,t)}static setup(e,t={}){let i=null;return j.string(e)?i=Array.from(document.querySelectorAll(e)):j.nodeList(e)?i=Array.from(e):j.array(e)&&(i=e.filter(j.element)),j.empty(i)?null:i.map(e=>new Gt(e,t))}}Gt.defaults=q(mt);var Zt=Gt,ei={name:"TransformMedia",props:{file:{type:Object,required:!0},src:{type:String,required:!0},isImage:{type:Boolean,default:!0},isVideo:{type:Boolean,default:!1},isAudio:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1}},data(){return{pointers:new Map,scale:1,rotation:0,rotatePreview:0,tx:0,ty:0,naturalWidth:0,naturalHeight:0,startScale:1,startRotation:0,startTx:0,startTy:0,startCenter:null,startDist:0,startAngle:0,dragging:!1,dragStart:null,viewportRect:null,minScale:1,maxScale:4,gestureMode:null,edgeOverflow:0,edgeDir:0,player:null,audioCover:null,audioTitle:"",audioArtist:""}},computed:{isActiveTransform(){return this.scale>1.001||this.pointers.size>=2||this.dragging},displayRotation(){return this.rotation+this.rotatePreview},rotateShrink(){const e=Math.min(1,Math.abs(this.rotatePreview)/90),t=Math.sin(Math.PI*e);return 1-.12*t},mediaStyle(){const e=this.scale*this.rotateShrink,t=this.pointers.size>0;return{transform:`translate3d(${this.tx}px, ${this.ty}px, 0) scale(${e}) rotate(${this.displayRotation}deg)`,transition:t?"none":"transform 0.25s ease",transformOrigin:"center center"}}},watch:{isActiveTransform(e){this.$emit(e?"lock":"unlock")},isActive(e){e?this.$nextTick(()=>this.initPlayer()):this.destroyPlayer()}},mounted(){this.isAudio&&this.initAudioInfo(),this.isActive&&this.$nextTick(()=>this.initPlayer())},beforeUnmount(){this.destroyPlayer(),this.audioCover&&(URL.revokeObjectURL(this.audioCover),this.audioCover=null)},methods:{initPlayer(){if(this.player)return;const e=this.$refs.videoEl||this.$refs.audioEl;e&&(this.player=new Zt(e,{controls:["play","progress","current-time","mute","volume","fullscreen"],autoplay:this.isVideo,resetOnEnd:!0}))},destroyPlayer(){const e=this.$refs.videoEl||this.$refs.audioEl;if(this.player){try{this.player.pause(),this.player.destroy()}catch(t){}this.player=null}if(e)try{e.pause(),e.currentTime=0,e.src="",e.load()}catch(t){}},stopAndCleanMedia(){this.destroyPlayer()},initAudioInfo(){const e=this.file?.name||this.src,t=e.split("/").pop().replace(/\.[^.]+$/,"");this.audioTitle=t,this.audioArtist="",this.audioCover=null,this.isActive&&this.tryReadMetadata()},async tryReadMetadata(){try{const e=await fetch(this.src),t=await e.blob(),i=await t.slice(0,131072).arrayBuffer(),s=new DataView(i);73===s.getUint8(0)&&68===s.getUint8(1)&&51===s.getUint8(2)&&this.parseID3v2(s,i)}catch(e){}},parseID3v2(e,t){const i=(127&e.getUint8(6))<<21|(127&e.getUint8(7))<<14|(127&e.getUint8(8))<<7|127&e.getUint8(9);let s=10;while(st.byteLength)break;const a=new Uint8Array(t,s+10,Math.min(n,t.byteLength-s-10));"TIT2"===i?this.audioTitle=this.decodeText(a)||this.audioTitle:"TPE1"===i?this.audioArtist=this.decodeText(a):"APIC"===i&&this.extractCover(a),s+=10+n}},decodeText(e){if(e.length<2)return"";const t=e[0],i=e.slice(1);try{if(0===t)return new TextDecoder("iso-8859-1").decode(i).replace(/\0/g,"");if(1===t)return new TextDecoder("utf-16").decode(i).replace(/\0/g,"");if(3===t)return new TextDecoder("utf-8").decode(i).replace(/\0/g,"")}catch(s){}return""},extractCover(e){try{let t=1;while(tt?t+this.rubberBand(e-t,i,.55):e<-t?-t-this.rubberBand(-t-e,i,.55):e},calcTwoPointer(){const e=Array.from(this.pointers.entries()).sort((e,t)=>e[0]-t[0]),t=e[0][1],i=e[1][1],s=i.x-t.x,n=i.y-t.y,a=Math.hypot(s,n),r=Math.atan2(n,s)*(180/Math.PI),o={x:(t.x+i.x)/2,y:(t.y+i.y)/2};return{dist:a,angle:r,center:o}},normalizeAngle(e){return e=(e%360+360)%360,e>180?e-360:e},onPointerDown(e){if(this.isImage){if(e.currentTarget.setPointerCapture?.(e.pointerId),this.viewportRect=this.getViewportRect(),this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===this.pointers.size){const{dist:e,angle:t,center:i}=this.calcTwoPointer();return this.startDist=e,this.startAngle=t,this.startCenter=i,this.startScale=this.scale,this.startRotation=this.rotation,this.startTx=this.tx,this.startTy=this.ty,this.dragging=!1,this.gestureMode=null,void(this.rotatePreview=0)}this.scale>1.001&&(this.dragging=!0,this.dragStart={x:e.clientX,y:e.clientY},this.startTx=this.tx,this.startTy=this.ty)}},onPointerMove(e){if(this.isImage&&this.pointers.has(e.pointerId)){if(this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===this.pointers.size){e.preventDefault();const{dist:t,angle:i,center:s}=this.calcTwoPointer(),n=t/(this.startDist||t),a=Math.abs(n-1),r=this.normalizeAngle(i-this.startAngle),o=Math.abs(r);if(!this.gestureMode)if(o>=8)this.gestureMode="rotate";else{if(!(a>=.08))return;this.gestureMode="pinch"}if("rotate"===this.gestureMode)return this.scale=this.startScale,void(this.rotatePreview=this.clamp(r,-90,90));if("pinch"===this.gestureMode&&(this.scale=this.clamp(this.startScale*n,this.minScale,this.maxScale),this.rotatePreview=0),this.startCenter&&this.viewportRect){const e=this.startCenter.x-this.viewportRect.left-this.viewportRect.width/2,t=this.startCenter.y-this.viewportRect.top-this.viewportRect.height/2,i=s.x-this.viewportRect.left-this.viewportRect.width/2,n=s.y-this.viewportRect.top-this.viewportRect.height/2;this.tx=this.startTx+(i-e),this.ty=this.startTy+(n-t)}return}if(this.dragging&&this.scale>1.001){e.preventDefault();const t=e.clientX-this.dragStart.x,i=e.clientY-this.dragStart.y,s=this.startTx+t,n=this.startTy+i,{maxX:a,maxY:r,vw:o,vh:l}=this.getPanBounds();let c=0,h=0;s>a?(c=s-a,h=-1):s<-a&&(c=-a-s,h=1),this.edgeOverflow=c,this.edgeDir=h,this.tx=this.applyBoundWithRubber(s,a,o),this.ty=this.applyBoundWithRubber(n,r,l)}}},onPointerUp(e){if(this.isImage&&(this.pointers.has(e.pointerId)&&this.pointers.delete(e.pointerId),this.pointers.size<2&&"rotate"===this.gestureMode&&(this.finishRotate(),this.gestureMode=null),this.pointers.size<2&&(this.startCenter=null,this.startDist=0,this.startAngle=0,this.gestureMode=null),0===this.pointers.size)){if(this.dragging=!1,this.edgeOverflow>60&&0!==this.edgeDir){const e=this.edgeDir;return this.reset(),void this.$emit("edge-swipe",e)}if(this.edgeOverflow=0,this.edgeDir=0,this.scale<=1.001)this.scale=1,this.tx=0,this.ty=0;else{const{maxX:e,maxY:t}=this.getPanBounds();this.tx=Math.max(-e,Math.min(e,this.tx)),this.ty=Math.max(-t,Math.min(t,this.ty))}}},finishRotate(){const e=this.rotatePreview;let t=0;Math.abs(e)>=30&&(t=e>0?90:-90);const i=((this.rotation+t)%360+360)%360;this.rotation=i,this.rotatePreview=0,this.updateFillScale()},updateFillScale(){const e=this.rotation%360,t=90===e||270===e;t?(this.scale=2,this.tx=0,this.ty=0):(this.scale=1,this.tx=0,this.ty=0)},onDblClick(){this.isImage&&(this.scale>1.001?(this.scale=1,this.tx=0,this.ty=0):this.scale=2)}}},ti=i(1241);const ii=(0,ti.A)(ei,[["render",b],["__scopeId","data-v-40a605de"]]);var si=ii;const ni={class:"header"},ai={class:"header-left"},ri={class:"header-center"},oi={class:"breadcrumb"},li=["onClick"],ci={class:"header-right"},hi={class:"file-count"},ui={key:0,class:"loading-container"},di={key:1,class:"error-container"},pi={key:2,class:"gallery-container",ref:"galleryContainer"},mi={key:0,class:"folders-section"},gi={class:"folders-grid"},fi=["onClick"],yi={class:"folder-name"},bi={class:"waterfall",ref:"waterfall"},vi=["onClick"],wi=["src","alt","onLoad"],ki=["src","onLoadedmetadata"],Ti={key:2,class:"audio-placeholder"},Ci={class:"audio-name"},Ai={key:3,class:"file-placeholder"},Si={class:"file-name"},Pi={class:"overlay"},Ei={class:"overlay-actions"},Mi=["onClick"],xi=["onClick"],Li={ref:"loadTrigger",class:"load-trigger"},Ii={key:0,class:"loading-more"},Ni={key:1,class:"no-more"},$i={key:2,class:"credit-link",href:"https://github.com/axibayuit-a11y",target:"_blank",rel:"noopener"},Fi=["src"],Di=["src"],_i=["src"],Ri={class:"audio-name-simple"},Oi=["src"],Vi={key:2,class:"other-file-preview"},Hi={class:"file-name"},ji={class:"page-indicator"};function Ui(e,t,i,r,o,l){const c=si;return(0,s.uX)(),(0,s.CE)("div",{class:(0,a.C4)(["public-browse",{"light-mode":o.isLightMode}])},[(0,s.Lk)("header",ni,[(0,s.Lk)("div",ai,[(0,s.Lk)("span",{class:"logo",onClick:t[0]||(t[0]=(...e)=>l.toggleTheme&&l.toggleTheme(...e)),title:"切换日夜模式"},(0,a.v_)(l.siteName),1)]),(0,s.Lk)("div",ri,[(0,s.Lk)("div",oi,[(0,s.Lk)("span",{class:"breadcrumb-item",onClick:t[1]||(t[1]=(...e)=>l.goToRoot&&l.goToRoot(...e))},(0,a.v_)(l.rootDirName),1),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.pathParts,(e,i)=>((0,s.uX)(),(0,s.CE)(s.FK,{key:i},[t[25]||(t[25]=(0,s.Lk)("span",{class:"breadcrumb-sep"},"/",-1)),(0,s.Lk)("span",{class:"breadcrumb-item",onClick:e=>l.goToPath(i)},(0,a.v_)(e),9,li)],64))),128))])]),(0,s.Lk)("div",ci,[(0,s.Lk)("span",hi,(0,a.v_)(o.totalCount)+" 个文件",1)])]),o.loading&&0===o.files.length?((0,s.uX)(),(0,s.CE)("div",ui,[...t[26]||(t[26]=[(0,s.Lk)("div",{class:"loading-spinner"},null,-1),(0,s.Lk)("p",null,"加载中...",-1)])])):o.error?((0,s.uX)(),(0,s.CE)("div",di,[(0,s.Lk)("p",null,(0,a.v_)(o.error),1),o.canRetry?((0,s.uX)(),(0,s.CE)("button",{key:0,onClick:t[2]||(t[2]=(...e)=>l.loadFiles&&l.loadFiles(...e)),class:"retry-btn"},"重试")):(0,s.Q3)("",!0)])):((0,s.uX)(),(0,s.CE)("div",pi,[l.folders.length>0?((0,s.uX)(),(0,s.CE)("div",mi,[(0,s.Lk)("div",gi,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.folders,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.name,class:"folder-card",onClick:t=>l.enterFolder(e.name)},[t[27]||(t[27]=(0,s.Lk)("div",{class:"folder-icon"},[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})])],-1)),(0,s.Lk)("span",yi,(0,a.v_)(l.getFolderName(e.name)),1)],8,fi))),128))])])):(0,s.Q3)("",!0),(0,s.Lk)("div",bi,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.columns,(e,i)=>((0,s.uX)(),(0,s.CE)("div",{key:i,class:"waterfall-column"},[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(e,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.name,class:"waterfall-item",onClick:t=>l.openPreview(e)},[(0,s.Lk)("div",{class:(0,a.C4)(["image-wrapper",{loaded:e.loaded}])},[l.isImage(e)?((0,s.uX)(),(0,s.CE)("img",{key:0,src:l.getFileUrl(e.name),alt:e.name,loading:"lazy",onLoad:t=>l.onImageLoad(t,e),onError:t[3]||(t[3]=(...e)=>l.handleImageError&&l.handleImageError(...e))},null,40,wi)):l.isVideo(e)?((0,s.uX)(),(0,s.CE)("video",{key:1,src:l.getFileUrl(e.name),muted:"",loop:"",preload:"metadata",onLoadedmetadata:t=>l.onVideoLoad(t,e),onPointerenter:t[4]||(t[4]=e=>"mouse"===e.pointerType&&e.target.play()),onPointerleave:t[5]||(t[5]=e=>"mouse"===e.pointerType&&e.target.pause())},null,40,ki)):l.isAudio(e)?((0,s.uX)(),(0,s.CE)("div",Ti,[t[28]||(t[28]=(0,s.Lk)("svg",{class:"audio-icon",viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"})],-1)),(0,s.Lk)("span",Ci,(0,a.v_)(l.getFileName(e.name)),1)])):((0,s.uX)(),(0,s.CE)("div",Ai,[t[29]||(t[29]=(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"})],-1)),(0,s.Lk)("span",Si,(0,a.v_)(l.getFileName(e.name)),1)])),(0,s.Lk)("div",Pi,[(0,s.Lk)("div",Ei,[(0,s.Lk)("button",{class:"action-btn",onClick:(0,n.D$)(t=>l.copyLink(e.name),["stop"]),title:"复制链接"},[...t[30]||(t[30]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})],-1)])],8,Mi),(0,s.Lk)("button",{class:"action-btn",onClick:(0,n.D$)(t=>l.downloadFile(e.name),["stop"]),title:"下载"},[...t[31]||(t[31]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})],-1)])],8,xi)])])],2)],8,vi))),128))]))),128))],512),(0,s.Lk)("div",Li,[o.loading&&o.files.length>0?((0,s.uX)(),(0,s.CE)("div",Ii,[...t[32]||(t[32]=[(0,s.Lk)("div",{class:"loading-spinner-small"},null,-1),(0,s.Lk)("span",null,"加载中...",-1)])])):!o.hasMore&&l.mediaFiles.length>0?((0,s.uX)(),(0,s.CE)("div",Ni," 已加载全部 ")):(0,s.Q3)("",!0),!o.hasMore&&l.mediaFiles.length>0?((0,s.uX)(),(0,s.CE)("a",$i," 林酱贡献 ")):(0,s.Q3)("",!0)],512)],512)),o.previewVisible?((0,s.uX)(),(0,s.CE)("div",{key:3,class:"preview-modal",onClick:t[24]||(t[24]=(0,n.D$)((...e)=>l.closePreview&&l.closePreview(...e),["self"]))},[(0,s.Lk)("button",{class:"preview-close",onClick:t[6]||(t[6]=(0,n.D$)((...e)=>l.closePreview&&l.closePreview(...e),["stop"]))},[...t[33]||(t[33]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])]),o.isMobile?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",{key:0,class:"preview-content",onClick:t[8]||(t[8]=(0,n.D$)(()=>{},["stop"]))},[l.currentPreviewFile&&l.isImage(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("img",{key:"img-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),class:"preview-image",style:(0,a.Tr)(l.desktopImageStyle),draggable:"false"},null,12,Fi)):l.currentPreviewFile&&l.isVideo(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("video",{ref:"desktopVideo",key:"video-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),controls:"",class:"preview-video",style:(0,a.Tr)(l.desktopImageStyle),onPlay:t[7]||(t[7]=(...e)=>l.onDesktopVideoPlay&&l.onDesktopVideoPlay(...e))},null,44,Di)):l.currentPreviewFile&&l.isAudio(l.currentPreviewFile)?((0,s.uX)(),(0,s.Wv)(c,{ref:"desktopAudio",key:"audio-"+l.currentPreviewFile.name,file:l.currentPreviewFile,src:l.getFileUrl(l.currentPreviewFile.name),"is-image":!1,"is-video":!1,"is-audio":!0,"is-active":!0},null,8,["file","src"])):(0,s.Q3)("",!0)])),o.isMobile?((0,s.uX)(),(0,s.CE)("div",{key:1,class:"preview-content preview-content-mobile",onClick:t[20]||(t[20]=(0,n.D$)(()=>{},["stop"]))},[l.currentPreviewFile&&l.isVideo(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("video",{ref:"mobileVideo",key:"m-video-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),controls:"",playsinline:"","webkit-playsinline":"","x5-video-player-type":"h5","x5-video-player-fullscreen":"true",class:"mobile-video-native",onPlay:t[9]||(t[9]=(...e)=>l.onMobileMediaPlay&&l.onMobileMediaPlay(...e))},null,40,_i)):l.currentPreviewFile&&l.isAudio(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("div",{key:1,class:"mobile-audio-native",onTouchstart:t[11]||(t[11]=(...e)=>l.onAudioSwipeStart&&l.onAudioSwipeStart(...e)),onTouchmove:t[12]||(t[12]=(...e)=>l.onAudioSwipeMove&&l.onAudioSwipeMove(...e)),onTouchend:t[13]||(t[13]=(...e)=>l.onAudioSwipeEnd&&l.onAudioSwipeEnd(...e))},[t[34]||(t[34]=(0,s.Lk)("div",{class:"audio-cover-simple"},[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"})])],-1)),(0,s.Lk)("div",Ri,(0,a.v_)(l.getFileName(l.currentPreviewFile.name)),1),((0,s.uX)(),(0,s.CE)("audio",{ref:"mobileAudio",key:"m-audio-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),controls:"",class:"mobile-audio-player",onPlay:t[10]||(t[10]=(...e)=>l.onMobileMediaPlay&&l.onMobileMediaPlay(...e))},null,40,Oi)),t[35]||(t[35]=(0,s.Lk)("div",{class:"swipe-hint"},"← 滑动切换 →",-1))],32)):l.currentPreviewFile&&!l.isImage(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("div",Vi,[t[36]||(t[36]=(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"})],-1)),(0,s.Lk)("span",Hi,(0,a.v_)(l.getFileName(l.currentPreviewFile.name)),1)])):((0,s.uX)(),(0,s.CE)("div",{key:3,class:"swipe-viewport",ref:"mobileViewport",onTouchstart:t[17]||(t[17]=(...e)=>l.onSwipeStart&&l.onSwipeStart(...e)),onTouchmove:t[18]||(t[18]=(...e)=>l.onSwipeMove&&l.onSwipeMove(...e)),onTouchend:t[19]||(t[19]=(...e)=>l.onSwipeEnd&&l.onSwipeEnd(...e))},[(0,s.Lk)("div",{class:"swipe-track",style:(0,a.Tr)(l.swipeTrackStyle),onTransitionend:t[16]||(t[16]=(...e)=>l.onSwipeTransitionEnd&&l.onSwipeTransitionEnd(...e))},[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.swipeWindow,(e,i)=>((0,s.uX)(),(0,s.CE)("div",{class:"swipe-slide",key:l.getSlideKey(e,i)},[e?((0,s.uX)(),(0,s.Wv)(c,{key:0,file:e,src:l.getFileUrl(e.name),"is-image":l.isImage(e),"is-video":!1,"is-audio":!1,"is-active":1===i,onLock:t[14]||(t[14]=e=>o.gestureLocked=!0),onUnlock:t[15]||(t[15]=e=>o.gestureLocked=!1),onEdgeSwipe:l.onEdgeSwipe},null,8,["file","src","is-image","is-active","onEdgeSwipe"])):(0,s.Q3)("",!0)]))),128))],36)],544))])):(0,s.Q3)("",!0),!o.isMobile&&o.previewIndex>0?((0,s.uX)(),(0,s.CE)("button",{key:2,class:"preview-prev",onClick:t[21]||(t[21]=(0,n.D$)((...e)=>l.prevImage&&l.prevImage(...e),["stop"]))},[...t[37]||(t[37]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})],-1)])])):(0,s.Q3)("",!0),!o.isMobile&&o.previewIndexl.nextImage&&l.nextImage(...e),["stop"]))},[...t[38]||(t[38]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})],-1)])])):(0,s.Q3)("",!0),o.isMobile?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("button",{key:4,class:"rotate-btn",onClick:t[23]||(t[23]=(0,n.D$)((...e)=>l.rotateImage&&l.rotateImage(...e),["stop"])),title:"旋转90°"},[...t[39]||(t[39]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"})],-1)])])),(0,s.Lk)("div",ji,(0,a.v_)(o.previewIndex+1)+" / "+(0,a.v_)(l.mediaFiles.length),1)])):(0,s.Q3)("",!0)],2)}var Bi=i(4373),qi=i(8401);i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);const Xi=new Set;let zi=null;function Wi(e){return e&&("AUDIO"===e.tagName||"VIDEO"===e.tagName)}function Ki(e){if(Wi(e)){try{e.pause()}catch(t){}try{e.currentTime=0}catch(t){}try{e.removeAttribute("src")}catch(t){}try{e.load?.()}catch(t){}}}function Yi(e=null){for(const t of Xi)e&&t===e||Ki(t);zi=e||null}let Qi=!1;function Ji(){Qi||(Qi=!0,document.addEventListener("visibilitychange",()=>{document.hidden&&Yi(null)}),window.addEventListener("pagehide",()=>Yi(null)))}var Gi={name:"PublicBrowse",components:{TransformMedia:si},data(){return{files:[],allowedDirs:[],rootDir:"",currentPath:"",totalCount:0,loading:!1,error:null,canRetry:!0,hasMore:!0,previewVisible:!1,previewIndex:0,observer:null,pageSize:24,columnCount:4,columnHeights:[0,0,0,0],imageRotation:0,swipeX:0,swipeStartX:0,swipeStartY:0,swipeStartT:0,swipeActive:!1,swipeAnimating:!1,swipeDir:0,viewportW:0,gestureLocked:!1,isLightMode:!1,audioSwipeStartX:0,audioSwipeStartT:0,audioSwipeActive:!1,isMobile:!1}},computed:{...(0,qi.L8)(["userConfig"]),siteName(){return this.userConfig?.siteTitle||"公开相册"},rootDirName(){return this.rootDir.split("/").filter(Boolean).pop()||"根目录"},pathParts(){if(!this.currentPath||!this.rootDir)return[];const e=this.currentPath.replace(this.rootDir,"").replace(/^\/+/,"");return e.split("/").filter(Boolean)},folders(){return this.files.filter(e=>e.isFolder)},mediaFiles(){return this.files.filter(e=>!e.isFolder)},columns(){const e=Array.from({length:this.columnCount},()=>[]);for(const t of this.mediaFiles){const i=t.columnIndex??0;i0?this.mediaFiles[this.previewIndex-1]:null},nextPreviewFile(){return this.previewIndex=10&&e<18}},toggleTheme(){this.isLightMode=!this.isLightMode,localStorage.setItem("publicBrowseTheme",this.isLightMode?"light":"dark")},getSlideKey(e,t){return e?1===t?`${e.name}-${this.previewIndex}`:e.name:`empty-${t}`},updateColumnCount(){const e=window.innerWidth;let t;t=e<600?2:e<900?3:4,t!==this.columnCount&&(this.columnCount=t,this.columnHeights=new Array(this.columnCount).fill(0),this.mediaFiles.forEach(e=>{e.columnIndex=void 0,this.assignToColumn(e)}))},getShortestColumn(){let e=0,t=this.columnHeights[0];for(let i=1;i{const t=e[0];t.isIntersecting&&this.hasMore&&!this.loading&&this.loadMore()},{rootMargin:"200px"})},observeLoadTrigger(){this.$nextTick(()=>{this.$refs.loadTrigger&&this.observer&&this.observer.observe(this.$refs.loadTrigger)})},async initFromRoute(){const e=this.$route.params.dir||"",t=Array.isArray(e)?e.join("/"):e;if(!t)return this.error="请指定要浏览的目录,例如: /browse/landscape",void(this.canRetry=!1);const i=t.split("/").filter(Boolean);this.rootDir=i[0],this.currentPath=t,this.files=[],this.hasMore=!0,this.columnHeights=new Array(this.columnCount).fill(0),await this.loadFiles(),this.observeLoadTrigger()},async loadFiles(){this.loading=!0,this.error=null,this.canRetry=!0;try{const e=await Bi.A.get(`/api/public/list?dir=${encodeURIComponent(this.currentPath)}&count=${this.pageSize}`);e.data.allowedDirs&&(this.allowedDirs=e.data.allowedDirs);const t=(e.data.directories||[]).map(e=>({name:e,isFolder:!0})),i=(e.data.files||[]).map(e=>({name:e.name,isFolder:!1,metadata:e.metadata,columnIndex:void 0}));i.forEach(e=>this.assignToColumn(e)),this.files=[...t,...i],this.totalCount=e.data.totalCount||this.files.length,this.hasMore=this.mediaFiles.length({name:e.name,isFolder:!1,metadata:e.metadata,columnIndex:void 0}));i.forEach(e=>this.assignToColumn(e)),this.files.push(...i),this.hasMore=this.mediaFiles.length{this.showToast("已复制")}).catch(()=>{const e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.showToast("已复制")})},showToast(e){const t=document.querySelector(".copy-toast");t&&t.remove();const i=document.createElement("div");i.className="copy-toast",i.textContent=e,document.body.appendChild(i),setTimeout(()=>i.classList.add("show"),10),setTimeout(()=>{i.classList.remove("show"),setTimeout(()=>i.remove(),300)},1500)},downloadFile(e){const t=document.createElement("a");t.href=this.getFileUrl(e),t.download=e.split("/").pop(),t.click()},openPreview(e){if(e.isFolder)return;Yi(null);const t=this.mediaFiles.findIndex(t=>t.name===e.name);t>=0&&(this.previewIndex=t,this.previewVisible=!0,this.imageRotation=0,this.gestureLocked=!1,document.body.style.overflow="hidden",this.$nextTick(()=>{this.viewportW=this.$refs.mobileViewport?.getBoundingClientRect().width||window.innerWidth}))},closePreview(){Yi(null),this.previewVisible=!1,this.imageRotation=0,this.gestureLocked=!1,document.body.style.overflow=""},prevImage(){Yi(null),this.previewIndex>0&&(this.previewIndex--,this.imageRotation=0)},nextImage(){Yi(null),this.previewIndex=360&&setTimeout(()=>{const e=this.$el.querySelector(".preview-image, .preview-video");e?(e.style.transition="none",this.imageRotation=0,e.offsetHeight,e.style.transition=""):this.imageRotation=0},300)},onSwipeStart(e){if(this.gestureLocked)return;if(this.swipeAnimating)return;const t=e.touches[0];this.swipeStartX=t.clientX,this.swipeStartY=t.clientY,this.swipeStartT=performance.now(),this.swipeX=0,this.swipeActive=!1,this.viewportW=this.$refs.mobileViewport?.getBoundingClientRect().width||window.innerWidth},onSwipeMove(e){if(this.gestureLocked)return;if(this.swipeAnimating)return;const t=e.touches[0],i=t.clientX-this.swipeStartX,s=t.clientY-this.swipeStartY;if(!this.swipeActive){if(Math.abs(i)<8)return;if(Math.abs(i)<=Math.abs(s))return;this.swipeActive=!0}e.preventDefault();let n=i;0===this.previewIndex&&n>0?n=this.rubberBand(n,this.viewportW,.55):this.previewIndex===this.mediaFiles.length-1&&n<0&&(n=-this.rubberBand(-n,this.viewportW,.55)),this.swipeX=n},onSwipeEnd(){if(this.gestureLocked)return;if(this.swipeAnimating)return;if(!this.swipeActive)return void(this.swipeX=0);const e=Math.max(1,performance.now()-this.swipeStartT),t=this.swipeX/e,i=.2*this.viewportW;let s=0;(this.swipeX<=-i||t<=-.8)&&(s=1),(this.swipeX>=i||t>=.8)&&(s=-1),(-1===s&&0===this.previewIndex||1===s&&this.previewIndex===this.mediaFiles.length-1)&&(s=0),this.swipeDir=s,this.swipeAnimating=!0,this.swipeX=1===s?-this.viewportW:-1===s?+this.viewportW:0},onSwipeTransitionEnd(){this.swipeAnimating&&(1===this.swipeDir&&this.previewIndex++,-1===this.swipeDir&&this.previewIndex--,this.swipeAnimating=!1,this.swipeDir=0,this.swipeX=0)},rubberBand(e,t,i=.55){return e*t*i/(t+i*e)},onEdgeSwipe(e){-1===e&&0===this.previewIndex||1===e&&this.previewIndex===this.mediaFiles.length-1||(this.swipeDir=e,this.swipeAnimating=!0,1===e?this.swipeX=-this.viewportW:-1===e&&(this.swipeX=+this.viewportW))},onAudioSwipeStart(e){const t=e.touches[0];this.audioSwipeStartX=t.clientX,this.audioSwipeStartT=performance.now(),this.audioSwipeActive=!1},onAudioSwipeMove(e){if(!this.audioSwipeStartX)return;const t=e.touches[0],i=t.clientX-this.audioSwipeStartX;Math.abs(i)>30&&(this.audioSwipeActive=!0)},onAudioSwipeEnd(e){if(!this.audioSwipeActive)return void(this.audioSwipeStartX=0);const t=e.changedTouches[0],i=t.clientX-this.audioSwipeStartX,s=Math.max(1,performance.now()-this.audioSwipeStartT),n=i/s,a=80;i>a||n>.5?this.prevImage():(i<-a||n<-.5)&&this.nextImage(),this.audioSwipeStartX=0,this.audioSwipeActive=!1},onDesktopVideoPlay(e){Yi(e.target)},onMobileMediaPlay(e){Yi(e.target)}}};const Zi=(0,ti.A)(Gi,[["render",Ui],["__scopeId","data-v-22855501"]]);var es=Zi},3975:function(e,t,i){i(4114),i(8111),i(2489),i(7588),i(1701),function(t,i){e.exports=i()}(0,function(){"use strict";function e(e,t){for(var i=0;it){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}return function(){function t(e,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),f(e)?this.element=e:p(e)&&(this.element=document.querySelector(e)),f(this.element)&&b(this.element.rangeTouch)&&(this.config=s({},n,{},i),this.init())}return i=t,o=[{key:"setup",value:function(e){var i=1(i=100/l.width*(n.clientX-l.left))?i=0:100i?i-=(100-2*i)*c:50w.onPointerDown&&w.onPointerDown(...e)),onPointermove:t[4]||(t[4]=(...e)=>w.onPointerMove&&w.onPointerMove(...e)),onPointerup:t[5]||(t[5]=(...e)=>w.onPointerUp&&w.onPointerUp(...e)),onPointercancel:t[6]||(t[6]=(...e)=>w.onPointerUp&&w.onPointerUp(...e)),onDblclick:t[7]||(t[7]=(0,n.D$)((...e)=>w.onDblClick&&w.onDblClick(...e),["prevent"]))},[i.isImage?((0,s.uX)(),(0,s.CE)("img",{key:0,class:"tm-media",src:i.src,draggable:"false",style:(0,a.Tr)(w.mediaStyle),onLoad:t[0]||(t[0]=(...e)=>w.onLoad&&w.onLoad(...e))},null,44,r)):i.isVideo&&i.isActive?((0,s.uX)(),(0,s.CE)("div",{key:1,class:"tm-video-wrap",onPointerdown:t[1]||(t[1]=(0,n.D$)(()=>{},["stop"]))},[(0,s.Lk)("video",{ref:"videoEl",class:"plyr-video",src:i.src,playsinline:""},null,8,o)],32)):i.isVideo?((0,s.uX)(),(0,s.CE)("div",l,[...t[8]||(t[8]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M8 5v14l11-7z"})],-1)])])):i.isAudio&&i.isActive?((0,s.uX)(),(0,s.CE)("div",{key:3,class:"tm-audio-wrap",onPointerdown:t[2]||(t[2]=(0,n.D$)(()=>{},["stop"]))},[(0,s.Lk)("div",c,[v.audioCover?((0,s.uX)(),(0,s.CE)("img",{key:0,src:v.audioCover,class:"cover-img"},null,8,h)):((0,s.uX)(),(0,s.CE)("svg",u,[...t[9]||(t[9]=[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"},null,-1)])]))]),(0,s.Lk)("div",d,[(0,s.Lk)("div",p,(0,a.v_)(v.audioTitle),1),v.audioArtist?((0,s.uX)(),(0,s.CE)("div",m,(0,a.v_)(v.audioArtist),1)):(0,s.Q3)("",!0)]),(0,s.Lk)("audio",{ref:"audioEl",class:"plyr-audio",src:i.src},null,8,g)],32)):i.isAudio?((0,s.uX)(),(0,s.CE)("div",f,[t[10]||(t[10]=(0,s.Lk)("svg",{class:"audio-icon-large",viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"})],-1)),(0,s.Lk)("span",y,(0,a.v_)(v.audioTitle),1)])):(0,s.Q3)("",!0)],544)}i(6573),i(8100),i(7936),i(9577),i(1549),i(9797),i(9631),i(5623),i(4603),i(7566),i(8721);var v=i(1114),w=(i(8111),i(2489),i(1701),i(8335),i(1148),i(116),i(7588),i(4114),i(3579),i(3975));const k=e=>null!==e&&"undefined"!==typeof e?e.constructor:null,T=(e,t)=>Boolean(e&&t&&e instanceof t),C=e=>null===e||"undefined"===typeof e,A=e=>k(e)===Object,S=e=>k(e)===Number&&!Number.isNaN(e),P=e=>k(e)===String,E=e=>k(e)===Boolean,M=e=>"function"===typeof e,x=e=>Array.isArray(e),L=e=>T(e,WeakMap),I=e=>T(e,NodeList),N=e=>k(e)===Text,$=e=>T(e,Event),F=e=>T(e,KeyboardEvent),D=e=>T(e,window.TextTrackCue)||T(e,window.VTTCue),_=e=>T(e,TextTrack)||!C(e)&&P(e.kind),R=e=>T(e,Promise)&&M(e.then);function O(e){return null!==e&&"object"===typeof e&&1===e.nodeType&&"object"===typeof e.style&&"object"===typeof e.ownerDocument}function V(e){return C(e)||(P(e)||x(e)||I(e))&&!e.length||A(e)&&!Object.keys(e).length}function H(e){if(T(e,window.URL))return!0;if(!P(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!V(new URL(t).hostname)}catch{return!1}}var j={nullOrUndefined:C,object:A,number:S,string:P,boolean:E,function:M,array:x,weakMap:L,nodeList:I,element:O,textNode:N,event:$,keyboardEvent:F,cue:D,track:_,promise:R,url:H,empty:V};const U=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find(t=>void 0!==e.style[t]);return!!j.string(i)&&t[i]})();function B(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}i(8237),i(3110);function q(e){return JSON.parse(JSON.stringify(e))}function X(e,t){return t.split(".").reduce((e,t)=>e&&e[t],e)}function z(e={},...t){if(!t.length)return e;const i=t.shift();return j.object(i)?(Object.keys(i).forEach(t=>{j.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),z(e[t],i[t])):Object.assign(e,{[t]:i[t]})}),z(e,...t)):e}function W(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)})}function K(e,t){j.element(e)&&!j.empty(t)&&Object.entries(t).filter(([,e])=>!j.nullOrUndefined(e)).forEach(([t,i])=>e.setAttribute(t,i))}function Y(e,t,i){const s=document.createElement(e);return j.object(t)&&K(s,t),j.string(i)&&(s.textContent=i),s}function Q(e,t){j.element(e)&&j.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)}function J(e,t,i,s){j.element(t)&&t.appendChild(Y(e,i,s))}function G(e){j.nodeList(e)||j.array(e)?Array.from(e).forEach(G):j.element(e)&&j.element(e.parentNode)&&e.parentNode.removeChild(e)}function Z(e){if(!j.element(e))return;let{length:t}=e.childNodes;while(t>0)e.removeChild(e.lastChild),t-=1}function ee(e,t){return j.element(t)&&j.element(t.parentNode)&&j.element(e)?(t.parentNode.replaceChild(e,t),e):null}function te(e,t){if(!j.string(e)||j.empty(e))return{};const i={},s=z({},t);return e.split(",").forEach(e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,""),r=a.split("="),[o]=r,l=r.length>1?r[1].replace(/["']/g,""):"",c=t.charAt(0);switch(c){case".":j.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[o]=l;break;default:break}}),z(s,i)}function ie(e,t){if(!j.element(e))return;let i=t;j.boolean(i)||(i=!e.hidden),e.hidden=i}function se(e,t,i){if(j.nodeList(e))return Array.from(e).map(e=>se(e,t,i));if(j.element(e)){let s="toggle";return"undefined"!==typeof i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function ne(e,t){return j.element(e)&&e.classList.contains(t)}function ae(e,t){const{prototype:i}=Element;function s(){return Array.from(document.querySelectorAll(t)).includes(this)}const n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||s;return n.call(e,t)}function re(e,t){const{prototype:i}=Element;function s(){let e=this;do{if(ae.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}const n=i.closest||s;return n.call(e,t)}function oe(e){return this.elements.container.querySelectorAll(e)}function le(e){return this.elements.container.querySelector(e)}function ce(e=null,t=!1){j.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const he={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ue={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=ue[e]||"html5"!==t,s=i&&ue.rangeInput;return{api:i,ui:s}},pip:(()=>document.pictureInPictureEnabled&&!Y("video").disablePictureInPicture)(),airplay:j.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(j.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(he).includes(i)&&(i+=`; codecs="${he[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==U,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches};var de=ue;const pe=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function me(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||j.empty(t)||!j.function(i))return;const r=t.split(" ");let o=a;pe&&(o={passive:n,capture:a}),r.forEach(t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)})}function ge(e,t="",i,s=!0,n=!1){me.call(this,e,t,i,!0,s,n)}function fe(e,t="",i,s=!0,n=!1){me.call(this,e,t,i,!1,s,n)}function ye(e,t="",i,s=!0,n=!1){const a=(...r)=>{fe(e,t,a,s,n),i.apply(this,r)};me.call(this,e,t,a,!0,s,n)}function be(e,t="",i=!1,s={}){if(!j.element(e)||j.empty(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function ve(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)}),this.eventListeners=[])}function we(){return new Promise(e=>this.ready?setTimeout(e,0):ge.call(this,this.elements.container,"ready",e)).then(()=>{})}function ke(e){j.promise(e)&&e.then(null,()=>{})}function Te(e){return j.array(e)?e.filter((t,i)=>e.indexOf(t)===i):e}function Ce(e,t){return j.array(e)&&e.length?e.reduce((e,i)=>Math.abs(i-t)({...e,[t/i]:[t,i]}),{});function Pe(e){if(!j.array(e)&&(!j.string(e)||!e.includes(":")))return!1;const t=j.array(e)?e:e.split(":");return t.map(Number).every(j.number)}function Ee(e){if(!j.array(e)||!e.every(j.number))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function Me(e){const t=e=>Pe(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!j.empty(this.embed)&&j.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return Ee(i)}function xe(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Me.call(this,e);if(!j.array(i))return{};const[s,n]=Ee(i),a=Ae(`aspect-ratio: ${s}/${n}`),r=100/s*n;if(a?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-r)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:r,ratio:i}}function Le(e,t,i=.05){const s=e/t,n=Ce(Object.keys(Se),s);return Math.abs(n-s)<=i?Se[n]:[e,t]}function Ie(){const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);return[e,t]}const Ne={getSources(){if(!this.isHTML5)return[];const e=Array.from(this.media.querySelectorAll("source"));return e.filter(e=>{const t=e.getAttribute("type");return!!j.empty(t)||de.mime.call(this,t)})},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ne.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,j.empty(this.config.ratio)||xe.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Ne.getSources.call(e),i=t.find(t=>t.getAttribute("src")===e.source);return i&&Number(i.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&j.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Ne.getSources.call(e),s=i.find(e=>Number(e.getAttribute("size"))===t);if(!s)return;const{currentTime:n,paused:a,preload:r,readyState:o,playbackRate:l}=e.media;e.media.src=s.getAttribute("src"),("none"!==r||o)&&(e.once("loadedmetadata",()=>{e.speed=l,e.currentTime=n,a||ke(e.play())}),e.media.load())}be.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(G(Ne.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};var $e=Ne;const Fe=Boolean(window.document.documentMode),De=/Edge/.test(navigator.userAgent),_e="WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),Re=/iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1,Oe="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,Ve=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var He={isIE:Fe,isEdge:De,isWebKit:_e,isIPhone:Re,isIPadOS:Oe,isIos:Ve};function je(e){return`${e}-${Math.floor(1e4*Math.random())}`}function Ue(e,...t){return j.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(e,i)=>t[i].toString())}function Be(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}function qe(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function Xe(e=""){return e.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function ze(e=""){let t=e.toString();return t=qe(t,"-"," "),t=qe(t,"_"," "),t=Xe(t),qe(t," ","")}function We(e=""){let t=e.toString();return t=ze(t),t.charAt(0).toLowerCase()+t.slice(1)}function Ke(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}function Ye(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Qe={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Je={get(e="",t={}){if(j.empty(e)||j.empty(t))return"";let i=X(t.i18n,e);if(j.empty(i))return Object.keys(Qe).includes(e)?Qe[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach(([e,t])=>{i=qe(i,e,t)}),i}};var Ge=Je;class Ze{constructor(e){(0,v.A)(this,"get",e=>{if(!Ze.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(j.empty(t))return null;const i=JSON.parse(t);return j.string(e)&&e.length?i[e]:i}),(0,v.A)(this,"set",e=>{if(!Ze.supported||!this.enabled)return;if(!j.object(e))return;let t=this.get();j.empty(t)&&(t={}),z(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch{}}),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}var et=Ze;function tt(e,t="text",i=!1){return new Promise((s,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;i&&(n.withCredentials=!0),n.addEventListener("load",()=>{if("text"===t)try{s(JSON.parse(n.responseText))}catch{s(n.responseText)}else s(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",e,!0),n.responseType=t,n.send()}catch(a){n(a)}})}function it(e,t){if(!j.string(e))return;const i="cache",s=j.string(t);let n=!1;const a=()=>null!==document.getElementById(t),r=(e,t)=>{e.innerHTML=t,s&&a()||document.body.insertAdjacentElement("afterbegin",e)};if(!s||!a()){const a=et.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),s&&o.setAttribute("id",t),a){const e=window.localStorage.getItem(`${i}-${t}`);if(n=null!==e,n){const t=JSON.parse(e);r(o,t.content)}}tt(e).then(e=>{if(!j.empty(e)){if(a)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch{}r(o,e)}}).catch(()=>{})}}const st=e=>Math.trunc(e/60/60%60,10),nt=e=>Math.trunc(e/60%60,10),at=e=>Math.trunc(e%60,10);function rt(e=0,t=!1,i=!1){if(!j.number(e))return rt(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=st(e);const a=nt(e),r=at(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(r)}`}const ot={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||He.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=le.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:oe.call(this,this.config.selectors.buttons.play),pause:le.call(this,this.config.selectors.buttons.pause),restart:le.call(this,this.config.selectors.buttons.restart),rewind:le.call(this,this.config.selectors.buttons.rewind),fastForward:le.call(this,this.config.selectors.buttons.fastForward),mute:le.call(this,this.config.selectors.buttons.mute),pip:le.call(this,this.config.selectors.buttons.pip),airplay:le.call(this,this.config.selectors.buttons.airplay),settings:le.call(this,this.config.selectors.buttons.settings),captions:le.call(this,this.config.selectors.buttons.captions),fullscreen:le.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=le.call(this,this.config.selectors.progress),this.elements.inputs={seek:le.call(this,this.config.selectors.inputs.seek),volume:le.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:le.call(this,this.config.selectors.display.buffer),currentTime:le.call(this,this.config.selectors.display.currentTime),duration:le.call(this,this.config.selectors.display.duration)},j.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",s=ot.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");K(a,z(t,{"aria-hidden":"true",focusable:"false"}));const r=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in r&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",o),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(r),a},createLabel(e,t={}){const i=Ge.get(e,this.config),s={...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")};return Y("span",s,i)},createBadge(e){if(j.empty(e))return null;const t=Y("span",{class:this.config.classNames.menu.value});return t.appendChild(Y("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=z({},t);let s=We(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])}),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||z(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:j.empty(n.label)&&(n.label=s),j.empty(n.icon)&&(n.icon=e)}const a=Y(n.element);return n.toggle?(a.appendChild(ot.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(ot.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(ot.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(ot.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(ot.createIcon.call(this,n.icon)),a.appendChild(ot.createLabel.call(this,n.label))),z(i,te(this.config.selectors.buttons[s],i)),K(a,i),"play"===s?(j.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=Y("input",z(te(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Ge.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,ot.updateRangeFill.call(this,i),w.setup(i),i},createProgress(e,t){const i=Y("progress",z(te(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(Y("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?Ge.get(t,this.config):"";i.textContent=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=te(this.config.selectors.display[e],t),s=Y("div",z(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Ge.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){ge.call(this,e,"keydown keyup",i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=ae(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(i.key))ot.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,j.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,j.element(t)||(t=e.parentNode.lastElementChild)),ce.call(this,t,!0))}},!1),ge.call(this,e,"keyup",e=>{"Return"===e.key&&ot.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const r=te(this.config.selectors.inputs[i]),o=Y("button",z(r,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${r.class?r.class:""}`.trim(),"aria-checked":a,value:e})),l=Y("span");l.innerHTML=s,j.element(n)&&l.appendChild(n),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get(){return"true"===o.getAttribute("aria-checked")},set(e){e&&Array.from(o.parentNode.children).filter(e=>ae(e,'[role="menuitemradio"]')).forEach(e=>e.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",t=>{if(!j.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e);break;default:break}ot.showMenuPanel.call(this,"home",j.keyboardEvent(t))}},i,!1),ot.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!j.number(e))return e;const i=st(this.duration)>0;return rt(e,i,t)},updateTimeDisplay(e=null,t=0,i=!1){j.element(e)&&j.number(t)&&(e.textContent=ot.formatTime(t,i))},updateVolume(){this.supported.ui&&(j.element(this.elements.inputs.volume)&&ot.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),j.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){j.element(e)&&(e.value=t,ot.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!j.event(e))return;let t=0;const i=(e,t)=>{const i=j.number(t)?t:0,s=j.element(e)?e:this.elements.display.buffer;if(j.element(s)){s.value=i;const e=s.getElementsByTagName("span")[0];j.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":t=Be(this.currentTime,this.duration),"timeupdate"===e.type&&ot.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered);break;default:break}},updateRangeFill(e){const t=j.event(e)?e.target:e;if(j.element(t)&&"range"===t.getAttribute("type")){if(ae(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=ot.formatTime(this.currentTime),i=ot.formatTime(this.duration),s=Ge.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(ae(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(He.isWebKit||He.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){if(!this.config.tooltips.seek||!j.element(this.elements.inputs.seek)||!j.element(this.elements.display.seekTooltip)||0===this.duration)return;const t=this.elements.display.seekTooltip,i=`${this.config.classNames.tooltip}--visible`,s=e=>se(t,i,e);if(this.touch)return void s(!1);let n=0;const a=this.elements.progress.getBoundingClientRect();if(j.event(e)){const t=e.pageX-e.clientX;n=100/a.width*(e.pageX-a.left-t)}else{if(!ne(t,i))return;n=Number.parseFloat(t.style.left,10)}n<0?n=0:n>100&&(n=100);const r=this.duration/100*n;t.textContent=ot.formatTime(r);const o=this.config.markers?.points?.find(({time:e})=>e===Math.round(r));o&&t.insertAdjacentHTML("afterbegin",`${o.label}
`),t.style.left=`${n}%`,j.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&s("mouseenter"===e.type)},timeUpdate(e){const t=!j.element(this.elements.display.duration)&&this.config.invertTime;ot.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||ot.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ie(this.elements.display.currentTime,!0),void ie(this.elements.progress,!0);j.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=j.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&ot.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&ot.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&ot.setMarkers.call(this),ot.updateSeekTooltip.call(this)},toggleMenuButton(e,t){ie(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=j.empty(i)?this[e]:i,j.empty(n)&&(n=this.config[e].default),!j.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(j.element(a)||(a=s&&s.querySelector('[role="menu"]')),!j.element(a))return;const r=this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`);r.innerHTML=ot.getLabel.call(this,e,n);const o=a&&a.querySelector(`[value="${n}"]`);j.element(o)&&(o.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Ge.get("normal",this.config):`${t}×`;case"quality":if(j.number(t)){const e=Ge.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return Xe(t);case"captions":return dt.getLabel.call(this);default:return null}},setQualityMenu(e){if(!j.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');j.array(e)&&(this.options.quality=Te(e).filter(e=>this.config.quality.options.includes(e)));const s=!j.empty(this.options.quality)&&this.options.quality.length>1;if(ot.toggleMenuButton.call(this,t,s),Z(i),ot.checkMenu.call(this),!s)return;const n=e=>{const t=Ge.get(`qualityBadge.${e}`,this.config);return t.length?ot.createBadge.call(this,t):null};this.options.quality.sort((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1}).forEach(e=>{ot.createMenuItem.call(this,{value:e,list:i,type:t,title:ot.getLabel.call(this,"quality",e),badge:n(e)})}),ot.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!j.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=dt.getTracks.call(this),s=Boolean(i.length);if(ot.toggleMenuButton.call(this,e,s),Z(t),ot.checkMenu.call(this),!s)return;const n=i.map((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:dt.getLabel.call(this,e),badge:e.language&&ot.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:Ge.get("disabled",this.config),list:t,type:"language"}),n.forEach(ot.createMenuItem.bind(this)),ot.updateSetting.call(this,e,t)},setSpeedMenu(){if(!j.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(e=>e>=this.minimumSpeed&&e<=this.maximumSpeed);const i=!j.empty(this.options.speed)&&this.options.speed.length>1;ot.toggleMenuButton.call(this,e,i),Z(t),ot.checkMenu.call(this),i&&(this.options.speed.forEach(i=>{ot.createMenuItem.call(this,{value:i,list:t,type:e,title:ot.getLabel.call(this,"speed",i)})}),ot.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!j.empty(e)&&Object.values(e).some(e=>!e.hidden);ie(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;j.element(i)||(i=Object.values(this.elements.settings.panels).find(e=>!e.hidden));const s=i.querySelector('[role^="menuitem"]');ce.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!j.element(t)||!j.element(i))return;const{hidden:s}=t;let n=s;if(j.boolean(e))n=e;else if(j.keyboardEvent(e)&&"Escape"===e.key)n=!1;else if(j.event(e)){const s=j.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),ie(t,!n),se(this.elements.container,this.config.classNames.menu.open,n),n&&j.keyboardEvent(e)?ot.focusFirstMenuItem.call(this,null,!0):n||s||ce.call(this,i,j.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,s=t.scrollHeight;return G(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!j.element(i))return;const s=i.parentNode,n=Array.from(s.children).find(e=>!e.hidden);if(de.transitions&&!de.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=ot.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",fe.call(this,s,U,t))};ge.call(this,s,U,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}ie(n,!0),ie(i,!1),ot.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;j.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:r,setSpeedMenu:o,showMenuPanel:l}=ot;this.elements.controls=null,j.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=Y("div",te(this.config.selectors.controls.wrapper));this.elements.controls=c;const h={class:"plyr__controls__item"};return Te(j.array(this.config.controls)?this.config.controls:[]).forEach(r=>{if("restart"===r&&c.appendChild(i.call(this,"restart",h)),"rewind"===r&&c.appendChild(i.call(this,"rewind",h)),"play"===r&&c.appendChild(i.call(this,"play",h)),"fast-forward"===r&&c.appendChild(i.call(this,"fast-forward",h)),"progress"===r){const t=Y("div",{class:`${h.class} plyr__progress__container`}),i=Y("div",te(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=Y("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===r&&c.appendChild(a.call(this,"currentTime",h)),"duration"===r&&c.appendChild(a.call(this,"duration",h)),"mute"===r||"volume"===r){let{volume:t}=this.elements;if(j.element(t)&&c.contains(t)||(t=Y("div",z({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===r&&t.appendChild(i.call(this,"mute")),"volume"===r&&!He.isIos&&!He.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",z(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===r&&c.appendChild(i.call(this,"captions",h)),"settings"===r&&!j.empty(this.config.settings)){const s=Y("div",z({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=Y("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=Y("div"),r=Y("div",{id:`plyr-settings-${e.id}-home`}),o=Y("div",{role:"menu"});r.appendChild(o),a.appendChild(r),this.elements.settings.panels.home=r,this.config.settings.forEach(i=>{const s=Y("button",z(te(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,s,i),ge.call(this,s,"click",()=>{l.call(this,i,!1)});const n=Y("span",null,Ge.get(i,this.config)),r=Y("span",{class:this.config.classNames.menu.value});r.innerHTML=e[i],n.appendChild(r),s.appendChild(n),o.appendChild(s);const c=Y("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),h=Y("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});h.appendChild(Y("span",{"aria-hidden":!0},Ge.get(i,this.config))),h.appendChild(Y("span",{class:this.config.classNames.hidden},Ge.get("menuBack",this.config))),ge.call(this,c,"keydown",e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))},!1),ge.call(this,h,"click",()=>{l.call(this,"home",!1)}),c.appendChild(h),c.appendChild(Y("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c}),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===r&&de.pip&&c.appendChild(i.call(this,"pip",h)),"airplay"===r&&de.airplay&&c.appendChild(i.call(this,"airplay",h)),"download"===r){const e=z({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!j.url(t)&&this.isEmbed&&z(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===r&&c.appendChild(i.call(this,"fullscreen",h))}),this.isHTML5&&r.call(this,$e.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=ot.getIconUrl.call(this);e.cors&&it(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;j.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),j.element(this.config.controls)||j.string(this.config.controls)?e=this.config.controls:(e=ot.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:dt.getLabel.call(this)}),i=!1);const s=e=>{let i=e;return Object.entries(t).forEach(([e,t])=>{i=qe(i,`{${e}}`,t)}),i};let n;i&&j.string(this.config.controls)&&(e=s(e)),j.string(this.config.selectors.controls.container)&&(n=document.querySelector(this.config.selectors.controls.container)),j.element(n)||(n=this.elements.container);const a=j.element(e)?"insertAdjacentElement":"insertAdjacentHTML";if(n[a]("afterbegin",e),j.element(this.elements.controls)||ot.findElements.call(this),!j.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get(){return ne(e,t)},set(i=!1){se(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(t=>{j.array(t)||j.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)})}if(He.isEdge&&B(n),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=oe.call(this,i);Array.from(s).forEach(e=>{se(e,this.config.classNames.hidden,!1),se(e,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){if(!this.duration||this.elements.markers)return;const e=this.config.markers?.points?.filter(({time:e})=>e>0&&ese(s,n,e);e.forEach(e=>{const t=Y("span",{class:this.config.classNames.marker},""),n=e.time/this.duration*100+"%";s&&(t.addEventListener("mouseenter",()=>{e.label||(s.style.left=n,s.innerHTML=e.label,a(!0))}),t.addEventListener("mouseleave",()=>{a(!1)})),t.addEventListener("click",()=>{this.currentTime=e.time}),t.style.left=n,i.appendChild(t)}),t.appendChild(i),this.config.tooltips.seek||(s=Y("span",{class:this.config.classNames.tooltip},""),t.appendChild(s)),this.elements.markers={points:i,tip:s},this.elements.progress.appendChild(t)}};var lt=ot;function ct(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch{return null}}function ht(e){const t=new URLSearchParams;return j.object(e)&&Object.entries(e).forEach(([e,i])=>{t.set(e,i)}),t}const ut={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!de.textTracks)return void(j.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&<.setCaptionsMenu.call(this));if(j.element(this.elements.captions)||(this.elements.captions=Y("div",te(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Q(this.elements.captions,this.elements.wrapper)),He.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach(e=>{const t=e.getAttribute("src"),i=ct(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&tt(t,"blob").then(t=>{e.setAttribute("src",window.URL.createObjectURL(t))}).catch(()=>{G(e)})})}const e=navigator.languages||[navigator.language||navigator.userLanguage||"en"],t=Te(e.map(e=>e.split("-")[0]));let i=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();"auto"===i&&([i]=t);let s=this.storage.get("captions")||this.captions.active;if(j.boolean(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:i,languages:t}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";ge.call(this,this.media.textTracks,e,ut.update.bind(this))}setTimeout(ut.update.bind(this),0)},update(){const e=ut.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find(e=>e.language===i));this.isHTML5&&this.isVideo&&e.filter(e=>!s.get(e)).forEach(e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),ge.call(this,e,"cuechange",()=>ut.updateCues.call(this))}),(a&&this.language!==i||!e.includes(n))&&(ut.setLanguage.call(this,i),ut.toggle.call(this,t&&a)),this.elements&&se(this.elements.container,this.config.classNames.captions.enabled,!j.empty(e)),j.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&<.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=j.nullOrUndefined(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=ut.getTracks.call(this),t=ut.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void ut.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),se(this.elements.container,s,n),this.captions.toggled=n,lt.updateSetting.call(this,"captions"),be.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const i=ut.getTracks.call(this);if(-1!==e)if(j.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,lt.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),be.call(this,this.media,"languagechange")}ut.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&ut.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else ut.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!j.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=ut.getTracks.call(this),n=ut.findTrack.call(this,[i]);ut.set.call(this,s.indexOf(n),t)},getTracks(e=!1){const t=Array.from((this.media||{}).textTracks||[]);return t.filter(t=>!this.isHTML5||e||this.captions.meta.has(t)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(e,t=!1){const i=ut.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort((e,t)=>s(t)-s(e));let a;return e.every(e=>(a=n.find(t=>t.language===e),!a)),a||(t?n[0]:void 0)},getCurrentTrack(){return ut.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!j.track(t)&&de.textTracks&&this.captions.toggled&&(t=ut.getCurrentTrack.call(this)),j.track(t)?j.empty(t.label)?j.empty(t.language)?Ge.get("enabled",this.config):e.language.toUpperCase():t.label:Ge.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!j.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!j.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=ut.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map(e=>e.getCueAsHTML()).map(Ye)}const i=t.map(e=>e.trim()).join("\n"),s=i!==this.elements.captions.innerHTML;if(s){Z(this.elements.captions);const e=Y("span",te(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),be.call(this,this.media,"cuechange")}}};var dt=ut;const pt={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.8.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}};var mt=pt;const gt={active:"picture-in-picture",inactive:"inline"};const ft={html5:"html5",youtube:"youtube",vimeo:"vimeo"},yt={audio:"audio",video:"video"};function bt(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?ft.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?ft.vimeo:null}function vt(){}class wt{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):vt}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):vt}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):vt}}class kt{constructor(e){(0,v.A)(this,"onChange",()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;j.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;be.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)}),(0,v.A)(this,"toggleFallback",(e=!1)=>{if(e?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",se(this.target,this.player.config.classNames.fullscreen.fallback,e),He.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=j.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter(e=>e.trim()!==i).join(","))}this.onChange()}),(0,v.A)(this,"trapFocus",e=>{if(He.isIos||He.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=oe.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())}),(0,v.A)(this,"update",()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":kt.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");se(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),(0,v.A)(this,"enter",()=>{this.supported&&(He.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!kt.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?j.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),(0,v.A)(this,"exit",()=>{if(this.supported)if(He.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),ke(this.player.play());else if(!kt.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!j.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),(0,v.A)(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=e,this.prefix=kt.prefix,this.property=kt.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===e.config.fullscreen.fallback,this.player.elements.fullscreen=e.config.fullscreen.container&&re(this.player.elements.container,e.config.fullscreen.container),ge.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),ge.call(this.player,this.player.elements.container,"dblclick",e=>{j.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")}),ge.call(this,this.player.elements.container,"keydown",e=>this.trapFocus(e)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return kt.nativeSupported&&!this.forceFallback}static get prefix(){if(j.function(document.exitFullscreen))return"";let e="";const t=["webkit","moz","ms"];return t.some(t=>!(!j.function(document[`${t}ExitFullscreen`])&&!j.function(document[`${t}CancelFullScreen`]))&&(e=t,!0)),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,kt.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||kt.nativeSupported||!He.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!kt.nativeSupported||this.forceFallback)return ne(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return He.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}var Tt=kt;function Ct(e,t=1){return new Promise((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})})}const At={addStyleHook(){se(this.elements.container,this.config.selectors.container.replace(".",""),!0),se(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void At.toggleNativeControls.call(this,!0);j.element(this.elements.controls)||(lt.inject.call(this),this.listeners.controls()),At.toggleNativeControls.call(this),this.isHTML5&&dt.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,lt.updateVolume.call(this),lt.timeUpdate.call(this),lt.durationUpdate.call(this),At.checkPlaying.call(this),se(this.elements.container,this.config.classNames.pip.supported,de.pip&&this.isHTML5&&this.isVideo),se(this.elements.container,this.config.classNames.airplay.supported,de.airplay&&this.isHTML5),se(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{be.call(this,this.media,"ready")},0),At.setTitle.call(this),this.poster&&At.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&<.durationUpdate.call(this),this.config.mediaMetadata&<.setMediaMetadata.call(this)},setTitle(){let e=Ge.get("play",this.config);if(j.string(this.config.title)&&!j.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const e=le.call(this,"iframe");if(!j.element(e))return;const t=j.empty(this.config.title)?"video":this.config.title,i=Ge.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){se(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),we.call(this).then(()=>Ct(e)).catch(t=>{throw e===this.poster&&At.togglePoster.call(this,!1),t}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),At.togglePoster.call(this,!0),e)))},checkPlaying(e){se(this.elements.container,this.config.classNames.playing,this.playing),se(this.elements.container,this.config.classNames.paused,this.paused),se(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Ge.get(this.playing?"pause":"play",this.config))}),j.event(e)&&"timeupdate"===e.type||At.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{se(this.elements.container,this.config.classNames.loading,this.loading),At.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!j.empty(e)&&j.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),j.empty(this.media.style)&&this.media.removeAttribute("style")}};var St=At;class Pt{constructor(e){(0,v.A)(this,"firstTouch",()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,se(t.container,e.config.classNames.isTouch,!0)}),(0,v.A)(this,"global",(e=!0)=>{const{player:t}=this;t.config.keyboard.global&&me.call(t,window,"keydown keyup",this.handleKey,e,!1),me.call(t,document.body,"click",this.toggleMenu,e),ye.call(t,document.body,"touchstart",this.firstTouch)}),(0,v.A)(this,"container",()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&ge.call(e,i.container,"keydown keyup",this.handleKey,!1),ge.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);const a=["touchstart","touchmove","mousemove"].includes(t.type);let r=0;a&&(St.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout(()=>St.toggleControls.call(e,!1),r)});const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=Me.call(e),r=Ae(`aspect-ratio: ${n} / ${a}`);if(!s)return void(r?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=Ie(),c=o/l>n/a;r?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};ge.call(e,i.container,"enterfullscreen exitfullscreen",t=>{const{target:s}=e.fullscreen;if(s!==i.container)return;if(!e.isEmbed&&j.empty(e.config.ratio))return;n();const r="enterfullscreen"===t.type?ge:fe;r.call(e,window,"resize",a)})}),(0,v.A)(this,"media",()=>{const{player:e}=this,{elements:t}=e;if(ge.call(e,e.media,"timeupdate seeking seeked",t=>lt.timeUpdate.call(e,t)),ge.call(e,e.media,"durationchange loadeddata loadedmetadata",t=>lt.durationUpdate.call(e,t)),ge.call(e,e.media,"ended",()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())}),ge.call(e,e.media,"progress playing seeking seeked",t=>lt.updateProgress.call(e,t)),ge.call(e,e.media,"volumechange",t=>lt.updateVolume.call(e,t)),ge.call(e,e.media,"playing play pause ended emptied timeupdate",t=>St.checkPlaying.call(e,t)),ge.call(e,e.media,"waiting canplay seeked playing",t=>St.checkLoading.call(e,t)),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=le.call(e,`.${e.config.classNames.video}`);if(!j.element(i))return;ge.call(e,t.container,"click",s=>{const n=[t.container,i];(n.includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,()=>{ke(e.play())},"play")):this.proxy(s,()=>{ke(e.togglePlay())},"play")))})}e.supported.ui&&e.config.disableContextMenu&&ge.call(e,t.wrapper,"contextmenu",e=>{e.preventDefault()},!1),ge.call(e,e.media,"volumechange",()=>{e.storage.set({volume:e.volume,muted:e.muted})}),ge.call(e,e.media,"ratechange",()=>{lt.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),ge.call(e,e.media,"qualitychange",t=>{lt.updateSetting.call(e,"quality",null,t.detail.quality)}),ge.call(e,e.media,"ready qualitychange",()=>{lt.setDownloadUrl.call(e)});const i=e.config.events.concat(["keyup","keydown"]).join(" ");ge.call(e,e.media,i,i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),be.call(e,t.container,i.type,!0,s)})}),(0,v.A)(this,"proxy",(e,t,i)=>{const{player:s}=this,n=s.config.listeners[i],a=j.function(n);let r=!0;a&&(r=n.call(s,e)),!1!==r&&j.function(t)&&t.call(s,e)}),(0,v.A)(this,"bind",(e,t,i,s,n=!0)=>{const{player:a}=this,r=a.config.listeners[s],o=j.function(r);ge.call(a,e,t,e=>this.proxy(e,i,s),n&&!o)}),(0,v.A)(this,"controls",()=>{const{player:e}=this,{elements:t}=e,i=He.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach(t=>{this.bind(t,"click",()=>{ke(e.togglePlay())},"play")}),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",()=>{e.lastSeekTime=Date.now(),e.rewind()},"rewind"),this.bind(t.buttons.fastForward,"click",()=>{e.lastSeekTime=Date.now(),e.forward()},"fastForward"),this.bind(t.buttons.mute,"click",()=>{e.muted=!e.muted},"mute"),this.bind(t.buttons.captions,"click",()=>e.toggleCaptions()),this.bind(t.buttons.download,"click",()=>{be.call(e,e.media,"download")},"download"),this.bind(t.buttons.fullscreen,"click",()=>{e.fullscreen.toggle()},"fullscreen"),this.bind(t.buttons.pip,"click",()=>{e.pip="toggle"},"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",t=>{t.stopPropagation(),t.preventDefault(),lt.toggleMenu.call(e,t)},null,!1),this.bind(t.buttons.settings,"keyup",t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),lt.toggleMenu.call(e,t)):lt.focusFirstMenuItem.call(e,null,!0))},null,!1),this.bind(t.settings.menu,"keydown",t=>{"Escape"===t.key&<.toggleMenu.call(e,t)}),this.bind(t.inputs.seek,"mousedown mousemove",e=>{const i=t.progress.getBoundingClientRect(),s=e.pageX-e.clientX,n=100/i.width*(e.pageX-i.left-s);e.currentTarget.setAttribute("seek-value",n)}),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",t=>{const i=t.currentTarget,s="play-on-seeked";if(j.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),ke(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())}),He.isIos){const t=oe.call(e,'input[type="range"]');Array.from(t).forEach(e=>this.bind(e,i,e=>B(e.target)))}this.bind(t.inputs.seek,i,t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");j.empty(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration},"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",t=>lt.updateSeekTooltip.call(e,t)),this.bind(t.progress,"mousemove touchmove",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)}),this.bind(t.progress,"mouseleave touchend click",()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)}),this.bind(t.progress,"mousedown touchstart",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)}),this.bind(t.progress,"mouseup touchend",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)}),He.isWebKit&&Array.from(oe.call(e,'input[type="range"]')).forEach(t=>{this.bind(t,"input",t=>lt.updateRangeFill.call(e,t.target))}),e.config.toggleInvert&&!j.element(t.display.duration)&&this.bind(t.display.currentTime,"click",()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,lt.timeUpdate.call(e))}),this.bind(t.inputs.volume,i,t=>{e.volume=t.target.value},"volume"),this.bind(t.controls,"mouseenter mouseleave",i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type}),t.fullscreen&&Array.from(t.fullscreen.children).filter(e=>!e.contains(t.container)).forEach(i=>{this.bind(i,"mouseenter mouseleave",i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)})}),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(t.controls,"focusin",()=>{const{config:i,timers:s}=e;se(t.controls,i.classNames.noTransition,!0),St.toggleControls.call(e,!0),setTimeout(()=>{se(t.controls,i.classNames.noTransition,!1)},0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout(()=>St.toggleControls.call(e,!1),n)}),this.bind(t.inputs.volume,"wheel",t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map(e=>i?-e:e),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:r}=e.media;(1===a&&r<1||-1===a&&r>0)&&t.preventDefault()},"volume",!1)}),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:r,metaKey:o,shiftKey:l}=e,c="keydown"===n,h=c&&s===this.lastKey;if(a||r||o||l)return;if(!s)return;const u=e=>{t.currentTime=t.duration/10*e};if(c){const n=document.activeElement;if(j.element(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&ae(n,s))return;if(" "===e.key&&ae(n,'button, [role^="menuitem"]'))return}const a=[" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"];switch(a.includes(s)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":h||u(Number.parseInt(s,10));break;case" ":case"k":h||ke(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":h||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":h||t.toggleCaptions();break;case"l":t.loop=!t.loop;break;default:break}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null}toggleMenu(e){lt.toggleMenu.call(this.player,e)}}var Et=Pt,Mt=i(1583);function xt(e){return new Promise((t,i)=>{Mt(e,{success:t,error:i})})}function Lt(e){if(j.empty(e))return null;if(j.number(Number(e)))return e;const t=/^.*(vimeo.com\/|video\/)(\d+).*/,i=e.match(t);return i?i[2]:e}function It(e){const t=/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/,i=e.match(t);return i&&5===i.length?i[4]:null}function Nt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,be.call(this,this.media,e?"play":"pause"))}const $t={setup(){const e=this;se(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,xe.call(e),j.object(window.Vimeo)?$t.ready.call(e):xt(e.config.urls.vimeo.sdk).then(()=>{$t.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:s,...n}=t;let a=e.media.getAttribute("src"),r="";j.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),r=e.media.getAttribute(e.config.attributes.embed.hash)):r=It(a);const o=r?{h:r}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const l=ht({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...n}),c=Lt(a),h=Y("iframe"),u=Ue(e.config.urls.vimeo.iframe,c,l);if(h.setAttribute("src",u),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),j.empty(s)||h.setAttribute("referrerPolicy",s),i||!t.customControls)h.setAttribute("data-poster",e.poster),e.media=ee(h,e.media);else{const t=Y("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(h),e.media=ee(t,e.media)}t.customControls||tt(Ue(e.config.urls.vimeo.api,u)).then(t=>{!j.empty(t)&&t.thumbnail_url&&St.setPoster.call(e,t.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(h,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Nt.call(e,!0),e.embed.play()),e.media.pause=()=>(Nt.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:d}=e.media;Object.defineProperty(e.media,"currentTime",{get(){return d},set(t){const{embed:i,media:s,paused:n,volume:a}=e,r=n&&!i.hasPlayed;s.seeking=!0,be.call(e,s,"seeking"),Promise.resolve(r&&i.setVolume(0)).then(()=>i.setCurrentTime(t)).then(()=>r&&i.pause()).then(()=>r&&i.setVolume(a)).catch(()=>{})}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get(){return p},set(t){e.embed.setPlaybackRate(t).then(()=>{p=t,be.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get(){return m},set(t){e.embed.setVolume(t).then(()=>{m=t,be.call(e,e.media,"volumechange")})}});let{muted:g}=e.config;Object.defineProperty(e.media,"muted",{get(){return g},set(t){const i=!!j.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then(()=>{g=i,be.call(e,e.media,"volumechange")})}});let f,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get(){return y},set(t){const i=j.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then(()=>{y=i})}}),e.embed.getVideoUrl().then(t=>{f=t,lt.setDownloadUrl.call(e)}).catch(e=>{this.debug.warn(e)}),Object.defineProperty(e.media,"currentSrc",{get(){return f}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(t=>{const[i,s]=t;e.embed.ratio=Le(i,s),xe.call(this)}),e.embed.setAutopause(e.config.autopause).then(t=>{e.config.autopause=t}),e.embed.getVideoTitle().then(t=>{e.config.title=t,St.setTitle.call(this)}),e.embed.getCurrentTime().then(t=>{d=t,be.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(t=>{e.media.duration=t,be.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(t=>{e.media.textTracks=t,dt.setup.call(e)}),e.embed.on("cuechange",({cues:t=[]})=>{const i=t.map(e=>Ke(e.text));dt.updateCues.call(e,i)}),e.embed.on("loaded",()=>{if(e.embed.getPaused().then(t=>{Nt.call(e,!t),t||be.call(e,e.media,"playing")}),j.element(e.embed.element)&&e.supported.ui){const t=e.embed.element;t.setAttribute("tabindex",-1)}}),e.embed.on("bufferstart",()=>{be.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{be.call(e,e.media,"playing")}),e.embed.on("play",()=>{Nt.call(e,!0),be.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Nt.call(e,!1)}),e.embed.on("timeupdate",t=>{e.media.seeking=!1,d=t.seconds,be.call(e,e.media,"timeupdate")}),e.embed.on("progress",t=>{e.media.buffered=t.percent,be.call(e,e.media,"progress"),1===Number.parseInt(t.percent,10)&&be.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(t=>{t!==e.media.duration&&(e.media.duration=t,be.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,be.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,be.call(e,e.media,"ended")}),e.embed.on("error",t=>{e.media.error=t,be.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>St.build.call(e),0)}};var Ft=$t;function Dt(e){if(j.empty(e))return null;const t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,i=e.match(t);return i&&i[2]?i[2]:e}function _t(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,be.call(this,this.media,e?"play":"pause"))}function Rt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const Ot={setup(){if(se(this.elements.wrapper,this.config.classNames.embed,!0),j.object(window.YT)&&j.function(window.YT.Player))Ot.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{j.function(e)&&e(),Ot.ready.call(this)},xt(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(e){const t=Ue(this.config.urls.youtube.api,e);tt(t).then(e=>{if(j.object(e)){const{title:t,height:i,width:s}=e;this.config.title=t,St.setTitle.call(this),this.embed.ratio=Le(s,i)}xe.call(this)}).catch(()=>{xe.call(this)})},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!j.empty(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");j.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=Dt(s),a=je(e.provider),r=Y("div",{id:a,"data-poster":t.customControls?e.poster:void 0});if(e.media=ee(r,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Ct(t("maxres"),121).catch(()=>Ct(t("sd"),121)).catch(()=>Ct(t("hq"))).then(t=>St.setPoster.call(e,t.src)).then(t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:n,host:Rt(t),playerVars:z({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,s={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occurred";e.media.error={code:i,message:s},be.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),be.call(e,e.media,"ratechange")},onReady(i){if(j.function(e.media.play))return;const s=i.target;Ot.getTitle.call(e,n),e.media.play=()=>{_t.call(e,!0),s.playVideo()},e.media.pause=()=>{_t.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get(){return Number(s.getCurrentTime())},set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,be.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get(){return s.getPlaybackRate()},set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get(){return a},set(t){a=t,s.setVolume(100*a),be.call(e,e.media,"volumechange")}});let{muted:r}=e.config;Object.defineProperty(e.media,"muted",{get(){return r},set(t){const i=j.boolean(t)?t:r;r=i,s[i?"mute":"unMute"](),s.setVolume(100*a),be.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get(){return s.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter(t=>e.config.speed.options.includes(t)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),be.call(e,e.media,"timeupdate"),be.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBufferedSt.build.call(e),50)},onStateChange(i){const s=i.target;clearInterval(e.timers.playing);const n=e.media.seeking&&[1,2].includes(i.data);switch(n&&(e.media.seeking=!1,be.call(e,e.media,"seeked")),i.data){case-1:be.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),be.call(e,e.media,"progress");break;case 0:_t.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):be.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(_t.call(e,!0),be.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{be.call(e,e.media,"timeupdate")},50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),be.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),_t.call(e,!1);break;case 3:be.call(e,e.media,"waiting");break;default:break}be.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}};var Vt=Ot;const Ht={setup(){this.media?(se(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),se(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&se(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Y("div",{class:this.config.classNames.video}),W(this.media,this.elements.wrapper),this.elements.poster=Y("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?$e.setup.call(this):this.isYouTube?Vt.setup.call(this):this.isVimeo&&Ft.setup.call(this)):this.debug.warn("No media element found!")}};var jt=Ht;function Ut(e){e.manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()}class Bt{constructor(e){(0,v.A)(this,"load",()=>{this.enabled&&(j.object(window.google)&&j.object(window.google.ima)?this.ready():xt(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),(0,v.A)(this,"ready",()=>{this.enabled||Ut(this),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),(0,v.A)(this,"setupIMA",()=>{this.elements.container=Y("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>this.onAdsManagerLoaded(e),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e),!1),this.requestAds()}),(0,v.A)(this,"requestAds",()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(t){this.onAdError(t)}}),(0,v.A)(this,"pollCountdown",(e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");const t=()=>{const e=rt(Math.max(this.manager.getRemainingTime(),0)),t=`${Ge.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)};this.countdownTimer=setInterval(t,100)}),(0,v.A)(this,"onAdsManagerLoaded",e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e)),Object.keys(google.ima.AdEvent.Type).forEach(e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],e=>this.onAdEvent(e))}),this.trigger("loaded")}),(0,v.A)(this,"addCuePoints",()=>{j.empty(this.cuePoints)||this.cuePoints.forEach(e=>{if(0!==e&&-1!==e&&e{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData(),n=e=>{be.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)};switch(n(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`);break;default:break}}),(0,v.A)(this,"onAdError",e=>{this.cancel(),this.player.debug.warn("Ads error",e)}),(0,v.A)(this,"listeners",()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{t=this.player.currentTime}),this.player.on("seeked",()=>{const e=this.player.currentTime;j.empty(this.cuePoints)||this.cuePoints.forEach((i,s)=>{t{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)})}),(0,v.A)(this,"play",()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(t){this.onAdError(t)}}).catch(()=>{})}),(0,v.A)(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,ke(this.player.media.play())}),(0,v.A)(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),(0,v.A)(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),(0,v.A)(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(e=>{this.on("loaded",e),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),(0,v.A)(this,"trigger",(e,...t)=>{const i=this.events[e];j.array(i)&&i.forEach(e=>{j.function(e)&&e.apply(this,t)})}),(0,v.A)(this,"on",(e,t)=>(j.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this)),(0,v.A)(this,"startSafetyTimer",(e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},e)}),(0,v.A)(this,"clearSafetyTimer",e=>{j.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((e,t)=>{this.on("loaded",e),this.on("error",t)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!j.empty(e.publisherId)||j.url(e.tagUrl))}get tagUrl(){const{config:e}=this;if(j.url(e.tagUrl))return e.tagUrl;const t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId},i="https://go.aniview.com/api/adserver6/vast/";return`${i}?${ht(t)}`}}var qt=Bt;function Xt(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function zt(e){const t=[],i=e.split(/\r\n\r\n|\n\n|\r\r/);return i.forEach(e=>{const i={},s=e.split(/\r\n|\n|\r/);s.forEach(e=>{if(j.number(i.startTime)){if(!j.empty(e.trim())&&j.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}}),i.text&&t.push(i)}),t}function Wt(e,t){const i=t.width/t.height,s={};return e>i?(s.width=t.width,s.height=1/e*t.width):(s.height=t.height,s.width=e*t.height),s}class Kt{constructor(e){(0,v.A)(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),(0,v.A)(this,"getThumbnails",()=>new Promise(e=>{const{src:t}=this.player.config.previewThumbnails;if(j.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort((e,t)=>e.height-t.height),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(j.function(t))t(e=>{this.thumbnails=e,i()});else{const e=j.string(t)?[t]:t,s=e.map(e=>this.getThumbnail(e));Promise.all(s).then(i)}})),(0,v.A)(this,"getThumbnail",e=>new Promise(t=>{tt(e,void 0,this.player.config.previewThumbnails.withCredentials).then(i=>{const s={frames:zt(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text})})),(0,v.A)(this,"startMove",e=>{if(this.loaded&&j.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{const t=this.player.elements.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(i/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.textContent=rt(this.seekTime);const s=this.player.config.markers?.points?.find(({time:e})=>e===Math.round(this.seekTime));s&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${s.label}
`)}this.showImageAtCurrentTime()}}),(0,v.A)(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),(0,v.A)(this,"startScrubbing",e=>{(j.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),(0,v.A)(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ye.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),(0,v.A)(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),(0,v.A)(this,"render",()=>{this.elements.thumb.container=Y("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Y("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=Y("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Y("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),j.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Y("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),(0,v.A)(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),(0,v.A)(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex(e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)}),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))}),(0,v.A)(this,"loadImage",(e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,r=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=r,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${r}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}}),(0,v.A)(this,"showImage",(e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))}),(0,v.A)(this,"removeOldImages",e=>{Array.from(this.currentImageContainer.children).forEach(t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout(()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)},i)}})}),(0,v.A)(this,"preloadNearby",(e,t=!0)=>new Promise(i=>{setTimeout(()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach(e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}}),a||i()}},300)})),(0,v.A)(this,"getHigherQuality",(e,t,i,s)=>{if(e{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))},300)}}),(0,v.A)(this,"toggleThumbContainer",(e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}),(0,v.A)(this,"toggleScrubbingContainer",(e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}),(0,v.A)(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),(0,v.A)(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()}),(0,v.A)(this,"setThumbContainerPos",()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,r=Xt(a,s,n);i.style.left=`${r}px`,i.style.setProperty("--preview-arrow-offset",a-r+"px")}),(0,v.A)(this,"setScrubbingContainerSize",()=>{const{width:e,height:t}=Wt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`}),(0,v.A)(this,"setImageSizeAndOffset",(e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`}),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=Wt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}var Yt=Kt;const Qt={insertElements(e,t){j.string(t)?J(e,this.media,{src:t}):j.array(t)&&t.forEach(t=>{J(e,this.media,t)})},change(e){X(e,"sources.length")?($e.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],G(this.media),this.media=null,j.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=ft.html5,src:n}]=t,a="html5"===s?i:"div",r="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:de.check(i,s,this.config.playsinline),media:Y(a,r)}),this.elements.container.appendChild(this.media),j.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),j.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),St.addStyleHook.call(this),this.isHTML5&&Qt.insertElements.call(this,"source",t),this.config.title=e.title,jt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Qt.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&St.build.call(this),this.isHTML5&&this.media.load(),j.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Yt(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};var Jt=Qt;class Gt{constructor(e,t){if((0,v.A)(this,"play",()=>j.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>ke(this.media.play())),this.media.play()):null),(0,v.A)(this,"pause",()=>this.playing&&j.function(this.media.pause)?this.media.pause():null),(0,v.A)(this,"togglePlay",e=>{const t=j.boolean(e)?e:!this.playing;return t?this.play():this.pause()}),(0,v.A)(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):j.function(this.media.stop)&&this.media.stop()}),(0,v.A)(this,"restart",()=>{this.currentTime=0}),(0,v.A)(this,"rewind",e=>{this.currentTime-=j.number(e)?e:this.config.seekTime}),(0,v.A)(this,"forward",e=>{this.currentTime+=j.number(e)?e:this.config.seekTime}),(0,v.A)(this,"increaseVolume",e=>{const t=this.media.muted?0:this.volume;this.volume=t+(j.number(e)?e:0)}),(0,v.A)(this,"decreaseVolume",e=>{this.increaseVolume(-e)}),(0,v.A)(this,"airplay",()=>{de.airplay&&this.media.webkitShowPlaybackTargetPicker()}),(0,v.A)(this,"toggleControls",e=>{if(this.supported.ui&&!this.isAudio){const t=ne(this.elements.container,this.config.classNames.hideControls),i="undefined"===typeof e?void 0:!e,s=se(this.elements.container,this.config.classNames.hideControls,i);if(s&&j.array(this.config.controls)&&this.config.controls.includes("settings")&&!j.empty(this.config.settings)&<.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";be.call(this,this.media,e)}return!s}return!1}),(0,v.A)(this,"on",(e,t)=>{ge.call(this,this.elements.container,e,t)}),(0,v.A)(this,"once",(e,t)=>{ye.call(this,this.elements.container,e,t)}),(0,v.A)(this,"off",(e,t)=>{fe(this.elements.container,e,t)}),(0,v.A)(this,"destroy",(e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(G(this.elements.buttons.play),G(this.elements.captions),G(this.elements.controls),G(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),j.function(e)&&e()):(ve.call(this),$e.cancelRequests.call(this),ee(this.elements.original,this.elements.container),be.call(this,this.elements.original,"destroyed",!0),j.function(e)&&e.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(St.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&j.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}),(0,v.A)(this,"supports",e=>de.mime.call(this,e)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=de.touch,this.media=e,j.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||j.nodeList(this.media)||j.array(this.media))&&(this.media=this.media[0]),this.config=z({},mt,Gt.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new wt(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",de),j.nullOrUndefined(this.media)||!j.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!de.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const s=this.media.tagName.toLowerCase();let n=null,a=null;switch(s){case"div":if(n=this.media.querySelector("iframe"),j.element(n)){if(a=ct(n.getAttribute("src")),this.provider=bt(a.toString()),this.elements.container=this.media,this.media=n,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(j.empty(this.provider)||!Object.values(ft).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=yt.video;break;case"video":case"audio":this.type=s,this.provider=ft.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=de.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Et(this),this.storage=new et(this),this.media.plyr=this,j.element(this.elements.container)||(this.elements.container=Y("div"),W(this.media,this.elements.container)),St.migrateStyles.call(this),St.addStyleHook.call(this),jt.setup.call(this),this.config.debug&&ge.call(this,this.elements.container,this.config.events.join(" "),e=>{this.debug.log(`event: ${e.type}`)}),this.fullscreen=new Tt(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&St.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new qt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>ke(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Yt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===ft.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===ft.youtube}get isVimeo(){return this.provider===ft.vimeo}get isVideo(){return this.type===yt.video}get isAudio(){return this.type===yt.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=j.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return j.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,i=j.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;const i=1,s=0;j.string(t)&&(t=Number(t)),j.number(t)||(t=this.storage.get("volume")),j.number(t)||({volume:t}=this.config),t>i&&(t=i),t0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;j.boolean(t)||(t=this.storage.get("muted")),j.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;j.number(e)&&(t=e),j.number(t)||(t=this.storage.get("speed")),j.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=Xt(t,i,s),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!j.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(j.number),n=!0;if(!i.includes(s)){const e=Ce(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=j.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){Jt.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return j.url(e)?e:this.source}set download(e){j.url(e)&&(this.config.urls.download=e,lt.setDownloadUrl.call(this))}set poster(e){this.isVideo?St.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Ee(Me.call(this));return j.array(e)?e.join(":"):e}set ratio(e){this.isVideo?j.string(e)&&Pe(e)?(this.config.ratio=Ee(e),xe.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=j.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){dt.toggle.call(this,e,!1)}set currentTrack(e){dt.set.call(this,e,!1),dt.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){dt.setLanguage.call(this,e,!1)}get language(){return(dt.getCurrentTrack.call(this)||{}).language}set pip(e){if(!de.pip)return;const t=j.boolean(e)?e:!this.pip;j.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?gt.active:gt.inactive),j.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return de.pip?j.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===gt.active:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Yt(this))}static supported(e,t){return de.check(e,t)}static loadSprite(e,t){return it(e,t)}static setup(e,t={}){let i=null;return j.string(e)?i=Array.from(document.querySelectorAll(e)):j.nodeList(e)?i=Array.from(e):j.array(e)&&(i=e.filter(j.element)),j.empty(i)?null:i.map(e=>new Gt(e,t))}}Gt.defaults=q(mt);var Zt=Gt,ei={name:"TransformMedia",props:{file:{type:Object,required:!0},src:{type:String,required:!0},isImage:{type:Boolean,default:!0},isVideo:{type:Boolean,default:!1},isAudio:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1}},data(){return{pointers:new Map,scale:1,rotation:0,rotatePreview:0,tx:0,ty:0,naturalWidth:0,naturalHeight:0,startScale:1,startRotation:0,startTx:0,startTy:0,startCenter:null,startDist:0,startAngle:0,dragging:!1,dragStart:null,viewportRect:null,minScale:1,maxScale:4,gestureMode:null,edgeOverflow:0,edgeDir:0,player:null,audioCover:null,audioTitle:"",audioArtist:""}},computed:{isActiveTransform(){return this.scale>1.001||this.pointers.size>=2||this.dragging},displayRotation(){return this.rotation+this.rotatePreview},rotateShrink(){const e=Math.min(1,Math.abs(this.rotatePreview)/90),t=Math.sin(Math.PI*e);return 1-.12*t},mediaStyle(){const e=this.scale*this.rotateShrink,t=this.pointers.size>0;return{transform:`translate3d(${this.tx}px, ${this.ty}px, 0) scale(${e}) rotate(${this.displayRotation}deg)`,transition:t?"none":"transform 0.25s ease",transformOrigin:"center center"}}},watch:{isActiveTransform(e){this.$emit(e?"lock":"unlock")},isActive(e){e?this.$nextTick(()=>this.initPlayer()):this.destroyPlayer()}},mounted(){this.isAudio&&this.initAudioInfo(),this.isActive&&this.$nextTick(()=>this.initPlayer())},beforeUnmount(){this.destroyPlayer(),this.audioCover&&(URL.revokeObjectURL(this.audioCover),this.audioCover=null)},methods:{initPlayer(){if(this.player)return;const e=this.$refs.videoEl||this.$refs.audioEl;e&&(this.player=new Zt(e,{controls:["play","progress","current-time","mute","volume","fullscreen"],autoplay:this.isVideo,resetOnEnd:!0}))},destroyPlayer(){const e=this.$refs.videoEl||this.$refs.audioEl;if(this.player){try{this.player.pause(),this.player.destroy()}catch(t){}this.player=null}if(e)try{e.pause(),e.currentTime=0,e.src="",e.load()}catch(t){}},stopAndCleanMedia(){this.destroyPlayer()},initAudioInfo(){const e=this.file?.name||this.src,t=e.split("/").pop().replace(/\.[^.]+$/,"");this.audioTitle=t,this.audioArtist="",this.audioCover=null,this.isActive&&this.tryReadMetadata()},async tryReadMetadata(){try{const e=await fetch(this.src),t=await e.blob(),i=await t.slice(0,131072).arrayBuffer(),s=new DataView(i);73===s.getUint8(0)&&68===s.getUint8(1)&&51===s.getUint8(2)&&this.parseID3v2(s,i)}catch(e){}},parseID3v2(e,t){const i=(127&e.getUint8(6))<<21|(127&e.getUint8(7))<<14|(127&e.getUint8(8))<<7|127&e.getUint8(9);let s=10;while(st.byteLength)break;const a=new Uint8Array(t,s+10,Math.min(n,t.byteLength-s-10));"TIT2"===i?this.audioTitle=this.decodeText(a)||this.audioTitle:"TPE1"===i?this.audioArtist=this.decodeText(a):"APIC"===i&&this.extractCover(a),s+=10+n}},decodeText(e){if(e.length<2)return"";const t=e[0],i=e.slice(1);try{if(0===t)return new TextDecoder("iso-8859-1").decode(i).replace(/\0/g,"");if(1===t)return new TextDecoder("utf-16").decode(i).replace(/\0/g,"");if(3===t)return new TextDecoder("utf-8").decode(i).replace(/\0/g,"")}catch(s){}return""},extractCover(e){try{let t=1;while(tt?t+this.rubberBand(e-t,i,.55):e<-t?-t-this.rubberBand(-t-e,i,.55):e},calcTwoPointer(){const e=Array.from(this.pointers.entries()).sort((e,t)=>e[0]-t[0]),t=e[0][1],i=e[1][1],s=i.x-t.x,n=i.y-t.y,a=Math.hypot(s,n),r=Math.atan2(n,s)*(180/Math.PI),o={x:(t.x+i.x)/2,y:(t.y+i.y)/2};return{dist:a,angle:r,center:o}},normalizeAngle(e){return e=(e%360+360)%360,e>180?e-360:e},onPointerDown(e){if(this.isImage){if(e.currentTarget.setPointerCapture?.(e.pointerId),this.viewportRect=this.getViewportRect(),this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===this.pointers.size){const{dist:e,angle:t,center:i}=this.calcTwoPointer();return this.startDist=e,this.startAngle=t,this.startCenter=i,this.startScale=this.scale,this.startRotation=this.rotation,this.startTx=this.tx,this.startTy=this.ty,this.dragging=!1,this.gestureMode=null,void(this.rotatePreview=0)}this.scale>1.001&&(this.dragging=!0,this.dragStart={x:e.clientX,y:e.clientY},this.startTx=this.tx,this.startTy=this.ty)}},onPointerMove(e){if(this.isImage&&this.pointers.has(e.pointerId)){if(this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===this.pointers.size){e.preventDefault();const{dist:t,angle:i,center:s}=this.calcTwoPointer(),n=t/(this.startDist||t),a=Math.abs(n-1),r=this.normalizeAngle(i-this.startAngle),o=Math.abs(r);if(!this.gestureMode)if(o>=8)this.gestureMode="rotate";else{if(!(a>=.08))return;this.gestureMode="pinch"}if("rotate"===this.gestureMode)return this.scale=this.startScale,void(this.rotatePreview=this.clamp(r,-90,90));if("pinch"===this.gestureMode&&(this.scale=this.clamp(this.startScale*n,this.minScale,this.maxScale),this.rotatePreview=0),this.startCenter&&this.viewportRect){const e=this.startCenter.x-this.viewportRect.left-this.viewportRect.width/2,t=this.startCenter.y-this.viewportRect.top-this.viewportRect.height/2,i=s.x-this.viewportRect.left-this.viewportRect.width/2,n=s.y-this.viewportRect.top-this.viewportRect.height/2;this.tx=this.startTx+(i-e),this.ty=this.startTy+(n-t)}return}if(this.dragging&&this.scale>1.001){e.preventDefault();const t=e.clientX-this.dragStart.x,i=e.clientY-this.dragStart.y,s=this.startTx+t,n=this.startTy+i,{maxX:a,maxY:r,vw:o,vh:l}=this.getPanBounds();let c=0,h=0;s>a?(c=s-a,h=-1):s<-a&&(c=-a-s,h=1),this.edgeOverflow=c,this.edgeDir=h,this.tx=this.applyBoundWithRubber(s,a,o),this.ty=this.applyBoundWithRubber(n,r,l)}}},onPointerUp(e){if(this.isImage&&(this.pointers.has(e.pointerId)&&this.pointers.delete(e.pointerId),this.pointers.size<2&&"rotate"===this.gestureMode&&(this.finishRotate(),this.gestureMode=null),this.pointers.size<2&&(this.startCenter=null,this.startDist=0,this.startAngle=0,this.gestureMode=null),0===this.pointers.size)){if(this.dragging=!1,this.edgeOverflow>60&&0!==this.edgeDir){const e=this.edgeDir;return this.reset(),void this.$emit("edge-swipe",e)}if(this.edgeOverflow=0,this.edgeDir=0,this.scale<=1.001)this.scale=1,this.tx=0,this.ty=0;else{const{maxX:e,maxY:t}=this.getPanBounds();this.tx=Math.max(-e,Math.min(e,this.tx)),this.ty=Math.max(-t,Math.min(t,this.ty))}}},finishRotate(){const e=this.rotatePreview;let t=0;Math.abs(e)>=30&&(t=e>0?90:-90);const i=((this.rotation+t)%360+360)%360;this.rotation=i,this.rotatePreview=0,this.updateFillScale()},updateFillScale(){const e=this.rotation%360,t=90===e||270===e;t?(this.scale=2,this.tx=0,this.ty=0):(this.scale=1,this.tx=0,this.ty=0)},onDblClick(){this.isImage&&(this.scale>1.001?(this.scale=1,this.tx=0,this.ty=0):this.scale=2)}}},ti=i(1241);const ii=(0,ti.A)(ei,[["render",b],["__scopeId","data-v-40a605de"]]);var si=ii;const ni={class:"header"},ai={class:"header-left"},ri={class:"header-center"},oi={class:"breadcrumb"},li=["onClick"],ci={class:"header-right"},hi={class:"file-count"},ui={key:0,class:"loading-container"},di={key:1,class:"error-container"},pi={key:2,class:"gallery-container",ref:"galleryContainer"},mi={key:0,class:"folders-section"},gi={class:"folders-grid"},fi=["onClick"],yi={class:"folder-name"},bi={class:"waterfall",ref:"waterfall"},vi=["onClick"],wi=["src","alt","onLoad"],ki=["src","onLoadedmetadata"],Ti={key:2,class:"audio-placeholder"},Ci={class:"audio-name"},Ai={key:3,class:"file-placeholder"},Si={class:"file-name"},Pi={class:"overlay"},Ei={class:"overlay-actions"},Mi=["onClick"],xi=["onClick"],Li={ref:"loadTrigger",class:"load-trigger"},Ii={key:0,class:"loading-more"},Ni={key:1,class:"no-more"},$i={key:2,class:"credit-link",href:"https://github.com/axibayuit-a11y",target:"_blank",rel:"noopener"},Fi=["src"],Di=["src"],_i=["src"],Ri={class:"audio-name-simple"},Oi=["src"],Vi={key:2,class:"other-file-preview"},Hi={class:"file-name"},ji={class:"page-indicator"};function Ui(e,t,i,r,o,l){const c=si;return(0,s.uX)(),(0,s.CE)("div",{class:(0,a.C4)(["public-browse",{"light-mode":o.isLightMode}])},[(0,s.Lk)("header",ni,[(0,s.Lk)("div",ai,[(0,s.Lk)("span",{class:"logo",onClick:t[0]||(t[0]=(...e)=>l.toggleTheme&&l.toggleTheme(...e)),title:"切换日夜模式"},(0,a.v_)(l.siteName),1)]),(0,s.Lk)("div",ri,[(0,s.Lk)("div",oi,[(0,s.Lk)("span",{class:"breadcrumb-item",onClick:t[1]||(t[1]=(...e)=>l.goToRoot&&l.goToRoot(...e))},(0,a.v_)(l.rootDirName),1),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.pathParts,(e,i)=>((0,s.uX)(),(0,s.CE)(s.FK,{key:i},[t[25]||(t[25]=(0,s.Lk)("span",{class:"breadcrumb-sep"},"/",-1)),(0,s.Lk)("span",{class:"breadcrumb-item",onClick:e=>l.goToPath(i)},(0,a.v_)(e),9,li)],64))),128))])]),(0,s.Lk)("div",ci,[(0,s.Lk)("span",hi,(0,a.v_)(o.totalCount)+" 个文件",1)])]),o.loading&&0===o.files.length?((0,s.uX)(),(0,s.CE)("div",ui,[...t[26]||(t[26]=[(0,s.Lk)("div",{class:"loading-spinner"},null,-1),(0,s.Lk)("p",null,"加载中...",-1)])])):o.error?((0,s.uX)(),(0,s.CE)("div",di,[(0,s.Lk)("p",null,(0,a.v_)(o.error),1),o.canRetry?((0,s.uX)(),(0,s.CE)("button",{key:0,onClick:t[2]||(t[2]=(...e)=>l.loadFiles&&l.loadFiles(...e)),class:"retry-btn"},"重试")):(0,s.Q3)("",!0)])):((0,s.uX)(),(0,s.CE)("div",pi,[l.folders.length>0?((0,s.uX)(),(0,s.CE)("div",mi,[(0,s.Lk)("div",gi,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.folders,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.name,class:"folder-card",onClick:t=>l.enterFolder(e.name)},[t[27]||(t[27]=(0,s.Lk)("div",{class:"folder-icon"},[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})])],-1)),(0,s.Lk)("span",yi,(0,a.v_)(l.getFolderName(e.name)),1)],8,fi))),128))])])):(0,s.Q3)("",!0),(0,s.Lk)("div",bi,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.columns,(e,i)=>((0,s.uX)(),(0,s.CE)("div",{key:i,class:"waterfall-column"},[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(e,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.name,class:"waterfall-item",onClick:t=>l.openPreview(e)},[(0,s.Lk)("div",{class:(0,a.C4)(["image-wrapper",{loaded:e.loaded}])},[l.isImage(e)?((0,s.uX)(),(0,s.CE)("img",{key:0,src:l.getFileUrl(e.name),alt:e.name,loading:"lazy",onLoad:t=>l.onImageLoad(t,e),onError:t[3]||(t[3]=(...e)=>l.handleImageError&&l.handleImageError(...e))},null,40,wi)):l.isVideo(e)?((0,s.uX)(),(0,s.CE)("video",{key:1,src:l.getFileUrl(e.name),muted:"",loop:"",preload:"metadata",onLoadedmetadata:t=>l.onVideoLoad(t,e),onPointerenter:t[4]||(t[4]=e=>"mouse"===e.pointerType&&e.target.play()),onPointerleave:t[5]||(t[5]=e=>"mouse"===e.pointerType&&e.target.pause())},null,40,ki)):l.isAudio(e)?((0,s.uX)(),(0,s.CE)("div",Ti,[t[28]||(t[28]=(0,s.Lk)("svg",{class:"audio-icon",viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"})],-1)),(0,s.Lk)("span",Ci,(0,a.v_)(l.getFileName(e.name)),1)])):((0,s.uX)(),(0,s.CE)("div",Ai,[t[29]||(t[29]=(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"})],-1)),(0,s.Lk)("span",Si,(0,a.v_)(l.getFileName(e.name)),1)])),(0,s.Lk)("div",Pi,[(0,s.Lk)("div",Ei,[(0,s.Lk)("button",{class:"action-btn",onClick:(0,n.D$)(t=>l.copyLink(e.name),["stop"]),title:"复制链接"},[...t[30]||(t[30]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})],-1)])],8,Mi),(0,s.Lk)("button",{class:"action-btn",onClick:(0,n.D$)(t=>l.downloadFile(e.name),["stop"]),title:"下载"},[...t[31]||(t[31]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})],-1)])],8,xi)])])],2)],8,vi))),128))]))),128))],512),(0,s.Lk)("div",Li,[o.loading&&o.files.length>0?((0,s.uX)(),(0,s.CE)("div",Ii,[...t[32]||(t[32]=[(0,s.Lk)("div",{class:"loading-spinner-small"},null,-1),(0,s.Lk)("span",null,"加载中...",-1)])])):!o.hasMore&&l.mediaFiles.length>0?((0,s.uX)(),(0,s.CE)("div",Ni," 已加载全部 ")):(0,s.Q3)("",!0),!o.hasMore&&l.mediaFiles.length>0?((0,s.uX)(),(0,s.CE)("a",$i," 林酱贡献 ")):(0,s.Q3)("",!0)],512)],512)),o.previewVisible?((0,s.uX)(),(0,s.CE)("div",{key:3,class:"preview-modal",onClick:t[24]||(t[24]=(0,n.D$)((...e)=>l.closePreview&&l.closePreview(...e),["self"]))},[(0,s.Lk)("button",{class:"preview-close",onClick:t[6]||(t[6]=(0,n.D$)((...e)=>l.closePreview&&l.closePreview(...e),["stop"]))},[...t[33]||(t[33]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])]),o.isMobile?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",{key:0,class:"preview-content",onClick:t[8]||(t[8]=(0,n.D$)(()=>{},["stop"]))},[l.currentPreviewFile&&l.isImage(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("img",{key:"img-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),class:"preview-image",style:(0,a.Tr)(l.desktopImageStyle),draggable:"false"},null,12,Fi)):l.currentPreviewFile&&l.isVideo(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("video",{ref:"desktopVideo",key:"video-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),controls:"",class:"preview-video",style:(0,a.Tr)(l.desktopImageStyle),onPlay:t[7]||(t[7]=(...e)=>l.onDesktopVideoPlay&&l.onDesktopVideoPlay(...e))},null,44,Di)):l.currentPreviewFile&&l.isAudio(l.currentPreviewFile)?((0,s.uX)(),(0,s.Wv)(c,{ref:"desktopAudio",key:"audio-"+l.currentPreviewFile.name,file:l.currentPreviewFile,src:l.getFileUrl(l.currentPreviewFile.name),"is-image":!1,"is-video":!1,"is-audio":!0,"is-active":!0,onAudioEnded:e.onAudioEnded},null,8,["file","src","onAudioEnded"])):(0,s.Q3)("",!0)])),o.isMobile?((0,s.uX)(),(0,s.CE)("div",{key:1,class:"preview-content preview-content-mobile",onClick:t[20]||(t[20]=(0,n.D$)(()=>{},["stop"]))},[l.currentPreviewFile&&l.isVideo(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("video",{ref:"mobileVideo",key:"m-video-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),controls:"",playsinline:"","webkit-playsinline":"","x5-video-player-type":"h5","x5-video-player-fullscreen":"true",class:"mobile-video-native",onPlay:t[9]||(t[9]=(...e)=>l.onMobileMediaPlay&&l.onMobileMediaPlay(...e))},null,40,_i)):l.currentPreviewFile&&l.isAudio(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("div",{key:1,class:"mobile-audio-native",onTouchstart:t[11]||(t[11]=(...e)=>l.onAudioSwipeStart&&l.onAudioSwipeStart(...e)),onTouchmove:t[12]||(t[12]=(...e)=>l.onAudioSwipeMove&&l.onAudioSwipeMove(...e)),onTouchend:t[13]||(t[13]=(...e)=>l.onAudioSwipeEnd&&l.onAudioSwipeEnd(...e))},[t[34]||(t[34]=(0,s.Lk)("div",{class:"audio-cover-simple"},[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"})])],-1)),(0,s.Lk)("div",Ri,(0,a.v_)(l.getFileName(l.currentPreviewFile.name)),1),((0,s.uX)(),(0,s.CE)("audio",{ref:"mobileAudio",key:"m-audio-"+l.currentPreviewFile.name,src:l.getFileUrl(l.currentPreviewFile.name),controls:"",class:"mobile-audio-player",onPlay:t[10]||(t[10]=(...e)=>l.onMobileMediaPlay&&l.onMobileMediaPlay(...e))},null,40,Oi)),t[35]||(t[35]=(0,s.Lk)("div",{class:"swipe-hint"},"← 滑动切换 →",-1))],32)):l.currentPreviewFile&&!l.isImage(l.currentPreviewFile)?((0,s.uX)(),(0,s.CE)("div",Vi,[t[36]||(t[36]=(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"})],-1)),(0,s.Lk)("span",Hi,(0,a.v_)(l.getFileName(l.currentPreviewFile.name)),1)])):((0,s.uX)(),(0,s.CE)("div",{key:3,class:"swipe-viewport",ref:"mobileViewport",onTouchstart:t[17]||(t[17]=(...e)=>l.onSwipeStart&&l.onSwipeStart(...e)),onTouchmove:t[18]||(t[18]=(...e)=>l.onSwipeMove&&l.onSwipeMove(...e)),onTouchend:t[19]||(t[19]=(...e)=>l.onSwipeEnd&&l.onSwipeEnd(...e))},[(0,s.Lk)("div",{class:"swipe-track",style:(0,a.Tr)(l.swipeTrackStyle),onTransitionend:t[16]||(t[16]=(...e)=>l.onSwipeTransitionEnd&&l.onSwipeTransitionEnd(...e))},[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.swipeWindow,(e,i)=>((0,s.uX)(),(0,s.CE)("div",{class:"swipe-slide",key:l.getSlideKey(e,i)},[e?((0,s.uX)(),(0,s.Wv)(c,{key:0,file:e,src:l.getFileUrl(e.name),"is-image":l.isImage(e),"is-video":!1,"is-audio":!1,"is-active":1===i,onLock:t[14]||(t[14]=e=>o.gestureLocked=!0),onUnlock:t[15]||(t[15]=e=>o.gestureLocked=!1),onEdgeSwipe:l.onEdgeSwipe},null,8,["file","src","is-image","is-active","onEdgeSwipe"])):(0,s.Q3)("",!0)]))),128))],36)],544))])):(0,s.Q3)("",!0),!o.isMobile&&o.previewIndex>0?((0,s.uX)(),(0,s.CE)("button",{key:2,class:"preview-prev",onClick:t[21]||(t[21]=(0,n.D$)((...e)=>l.prevImage&&l.prevImage(...e),["stop"]))},[...t[37]||(t[37]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})],-1)])])):(0,s.Q3)("",!0),!o.isMobile&&o.previewIndexl.nextImage&&l.nextImage(...e),["stop"]))},[...t[38]||(t[38]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})],-1)])])):(0,s.Q3)("",!0),o.isMobile?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("button",{key:4,class:"rotate-btn",onClick:t[23]||(t[23]=(0,n.D$)((...e)=>l.rotateImage&&l.rotateImage(...e),["stop"])),title:"旋转90°"},[...t[39]||(t[39]=[(0,s.Lk)("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[(0,s.Lk)("path",{d:"M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"})],-1)])])),(0,s.Lk)("div",ji,(0,a.v_)(o.previewIndex+1)+" / "+(0,a.v_)(l.mediaFiles.length),1)])):(0,s.Q3)("",!0)],2)}var Bi=i(4373),qi=i(8401);i(7642),i(8004),i(3853),i(5876),i(2475),i(5024),i(1698);const Xi=new Set;let zi=null;function Wi(e){return e&&("AUDIO"===e.tagName||"VIDEO"===e.tagName)}function Ki(e){if(Wi(e)){try{e.pause()}catch(t){}try{e.currentTime=0}catch(t){}try{e.removeAttribute("src")}catch(t){}try{e.load?.()}catch(t){}}}function Yi(e=null){for(const t of Xi)e&&t===e||Ki(t);zi=e||null}let Qi=!1;function Ji(){Qi||(Qi=!0,document.addEventListener("visibilitychange",()=>{document.hidden&&Yi(null)}),window.addEventListener("pagehide",()=>Yi(null)))}var Gi={name:"PublicBrowse",components:{TransformMedia:si},data(){return{files:[],allowedDirs:[],rootDir:"",currentPath:"",totalCount:0,loading:!1,error:null,canRetry:!0,hasMore:!0,previewVisible:!1,previewIndex:0,observer:null,pageSize:24,columnCount:4,columnHeights:[0,0,0,0],imageRotation:0,swipeX:0,swipeStartX:0,swipeStartY:0,swipeStartT:0,swipeActive:!1,swipeAnimating:!1,swipeDir:0,viewportW:0,gestureLocked:!1,isLightMode:!1,audioSwipeStartX:0,audioSwipeStartT:0,audioSwipeActive:!1,isMobile:!1}},computed:{...(0,qi.L8)(["userConfig"]),siteName(){return this.userConfig?.siteTitle||"公开相册"},rootDirName(){return this.rootDir.split("/").filter(Boolean).pop()||"根目录"},pathParts(){if(!this.currentPath||!this.rootDir)return[];const e=this.currentPath.replace(this.rootDir,"").replace(/^\/+/,"");return e.split("/").filter(Boolean)},folders(){return this.files.filter(e=>e.isFolder)},mediaFiles(){return this.files.filter(e=>!e.isFolder)},columns(){const e=Array.from({length:this.columnCount},()=>[]);for(const t of this.mediaFiles){const i=t.columnIndex??0;i0?this.mediaFiles[this.previewIndex-1]:null},nextPreviewFile(){return this.previewIndex=10&&e<18}},toggleTheme(){this.isLightMode=!this.isLightMode,localStorage.setItem("publicBrowseTheme",this.isLightMode?"light":"dark")},getSlideKey(e,t){return e?1===t?`${e.name}-${this.previewIndex}`:e.name:`empty-${t}`},updateColumnCount(){const e=window.innerWidth;let t;t=e<600?2:e<900?3:4,t!==this.columnCount&&(this.columnCount=t,this.columnHeights=new Array(this.columnCount).fill(0),this.mediaFiles.forEach(e=>{e.columnIndex=void 0,this.assignToColumn(e)}))},getShortestColumn(){let e=0,t=this.columnHeights[0];for(let i=1;i{const t=e[0];t.isIntersecting&&this.hasMore&&!this.loading&&this.loadMore()},{rootMargin:"200px"})},observeLoadTrigger(){this.$nextTick(()=>{this.$refs.loadTrigger&&this.observer&&this.observer.observe(this.$refs.loadTrigger)})},async initFromRoute(){const e=this.$route.params.dir||"",t=Array.isArray(e)?e.join("/"):e;if(!t)return this.error="请指定要浏览的目录,例如: /browse/landscape",void(this.canRetry=!1);const i=t.split("/").filter(Boolean);this.rootDir=i[0],this.currentPath=t,this.files=[],this.hasMore=!0,this.columnHeights=new Array(this.columnCount).fill(0),await this.loadFiles(),this.observeLoadTrigger()},async loadFiles(){this.loading=!0,this.error=null,this.canRetry=!0;try{const e=await Bi.A.get(`/api/public/list?dir=${encodeURIComponent(this.currentPath)}&count=${this.pageSize}`);e.data.allowedDirs&&(this.allowedDirs=e.data.allowedDirs);const t=(e.data.directories||[]).map(e=>({name:e,isFolder:!0})),i=(e.data.files||[]).map(e=>({name:e.name,isFolder:!1,metadata:e.metadata,columnIndex:void 0}));i.forEach(e=>this.assignToColumn(e)),this.files=[...t,...i],this.totalCount=e.data.totalCount||this.files.length,this.hasMore=this.mediaFiles.length({name:e.name,isFolder:!1,metadata:e.metadata,columnIndex:void 0}));i.forEach(e=>this.assignToColumn(e)),this.files.push(...i),this.hasMore=this.mediaFiles.length{this.showToast("已复制")}).catch(()=>{const e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.showToast("已复制")})},showToast(e){const t=document.querySelector(".copy-toast");t&&t.remove();const i=document.createElement("div");i.className="copy-toast",i.textContent=e,document.body.appendChild(i),setTimeout(()=>i.classList.add("show"),10),setTimeout(()=>{i.classList.remove("show"),setTimeout(()=>i.remove(),300)},1500)},downloadFile(e){const t=document.createElement("a");t.href=this.getFileUrl(e),t.download=e.split("/").pop(),t.click()},openPreview(e){if(e.isFolder)return;Yi(null);const t=this.mediaFiles.findIndex(t=>t.name===e.name);t>=0&&(this.previewIndex=t,this.previewVisible=!0,this.imageRotation=0,this.gestureLocked=!1,document.body.style.overflow="hidden",this.$nextTick(()=>{this.viewportW=this.$refs.mobileViewport?.getBoundingClientRect().width||window.innerWidth}))},closePreview(){Yi(null),this.previewVisible=!1,this.imageRotation=0,this.gestureLocked=!1,document.body.style.overflow=""},prevImage(){Yi(null),this.previewIndex>0&&(this.previewIndex--,this.imageRotation=0)},nextImage(){Yi(null),this.previewIndex=360&&setTimeout(()=>{const e=this.$el.querySelector(".preview-image, .preview-video");e?(e.style.transition="none",this.imageRotation=0,e.offsetHeight,e.style.transition=""):this.imageRotation=0},300)},onSwipeStart(e){if(this.gestureLocked)return;if(this.swipeAnimating)return;const t=e.touches[0];this.swipeStartX=t.clientX,this.swipeStartY=t.clientY,this.swipeStartT=performance.now(),this.swipeX=0,this.swipeActive=!1,this.viewportW=this.$refs.mobileViewport?.getBoundingClientRect().width||window.innerWidth},onSwipeMove(e){if(this.gestureLocked)return;if(this.swipeAnimating)return;const t=e.touches[0],i=t.clientX-this.swipeStartX,s=t.clientY-this.swipeStartY;if(!this.swipeActive){if(Math.abs(i)<8)return;if(Math.abs(i)<=Math.abs(s))return;this.swipeActive=!0}e.preventDefault();let n=i;0===this.previewIndex&&n>0?n=this.rubberBand(n,this.viewportW,.55):this.previewIndex===this.mediaFiles.length-1&&n<0&&(n=-this.rubberBand(-n,this.viewportW,.55)),this.swipeX=n},onSwipeEnd(){if(this.gestureLocked)return;if(this.swipeAnimating)return;if(!this.swipeActive)return void(this.swipeX=0);const e=Math.max(1,performance.now()-this.swipeStartT),t=this.swipeX/e,i=.2*this.viewportW;let s=0;(this.swipeX<=-i||t<=-.8)&&(s=1),(this.swipeX>=i||t>=.8)&&(s=-1),(-1===s&&0===this.previewIndex||1===s&&this.previewIndex===this.mediaFiles.length-1)&&(s=0),this.swipeDir=s,this.swipeAnimating=!0,this.swipeX=1===s?-this.viewportW:-1===s?+this.viewportW:0},onSwipeTransitionEnd(){this.swipeAnimating&&(1===this.swipeDir&&this.previewIndex++,-1===this.swipeDir&&this.previewIndex--,this.swipeAnimating=!1,this.swipeDir=0,this.swipeX=0)},rubberBand(e,t,i=.55){return e*t*i/(t+i*e)},onEdgeSwipe(e){-1===e&&0===this.previewIndex||1===e&&this.previewIndex===this.mediaFiles.length-1||(this.swipeDir=e,this.swipeAnimating=!0,1===e?this.swipeX=-this.viewportW:-1===e&&(this.swipeX=+this.viewportW))},onAudioSwipeStart(e){const t=e.touches[0];this.audioSwipeStartX=t.clientX,this.audioSwipeStartT=performance.now(),this.audioSwipeActive=!1},onAudioSwipeMove(e){if(!this.audioSwipeStartX)return;const t=e.touches[0],i=t.clientX-this.audioSwipeStartX;Math.abs(i)>30&&(this.audioSwipeActive=!0)},onAudioSwipeEnd(e){if(!this.audioSwipeActive)return void(this.audioSwipeStartX=0);const t=e.changedTouches[0],i=t.clientX-this.audioSwipeStartX,s=Math.max(1,performance.now()-this.audioSwipeStartT),n=i/s,a=80;i>a||n>.5?this.prevImage():(i<-a||n<-.5)&&this.nextImage(),this.audioSwipeStartX=0,this.audioSwipeActive=!1},onDesktopVideoPlay(e){Yi(e.target)},onMobileMediaPlay(e){Yi(e.target)}}};const Zi=(0,ti.A)(Gi,[["render",Ui],["__scopeId","data-v-eef21a24"]]);var es=Zi},3975:function(e,t,i){i(4114),i(8111),i(2489),i(7588),i(1701),function(t,i){e.exports=i()}(0,function(){"use strict";function e(e,t){for(var i=0;it){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}return function(){function t(e,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),f(e)?this.element=e:p(e)&&(this.element=document.querySelector(e)),f(this.element)&&b(this.element.rangeTouch)&&(this.config=s({},n,{},i),this.init())}return i=t,o=[{key:"setup",value:function(e){var i=1(i=100/l.width*(n.clientX-l.left))?i=0:100i?i-=(100-2*i)*c:50 $options.onPointerDown && $options.onPointerDown(...args)),\n onPointermove: _cache[4] || (_cache[4] = (...args) => $options.onPointerMove && $options.onPointerMove(...args)),\n onPointerup: _cache[5] || (_cache[5] = (...args) => $options.onPointerUp && $options.onPointerUp(...args)),\n onPointercancel: _cache[6] || (_cache[6] = (...args) => $options.onPointerUp && $options.onPointerUp(...args)),\n onDblclick: _cache[7] || (_cache[7] = _withModifiers((...args) => $options.onDblClick && $options.onDblClick(...args), [\"prevent\"]))\n }, [$props.isImage ? (_openBlock(), _createElementBlock(\"img\", {\n key: 0,\n class: \"tm-media\",\n src: $props.src,\n draggable: \"false\",\n style: _normalizeStyle($options.mediaStyle),\n onLoad: _cache[0] || (_cache[0] = (...args) => $options.onLoad && $options.onLoad(...args))\n }, null, 44, _hoisted_1)) : $props.isVideo && $props.isActive ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"tm-video-wrap\",\n onPointerdown: _cache[1] || (_cache[1] = _withModifiers(() => {}, [\"stop\"]))\n }, [_createElementVNode(\"video\", {\n ref: \"videoEl\",\n class: \"plyr-video\",\n src: $props.src,\n playsinline: \"\"\n }, null, 8, _hoisted_2)], 32)) : $props.isVideo ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [...(_cache[8] || (_cache[8] = [_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\"\n }, [_createElementVNode(\"path\", {\n d: \"M8 5v14l11-7z\"\n })], -1)]))])) : $props.isAudio && $props.isActive ? (_openBlock(), _createElementBlock(\"div\", {\n key: 3,\n class: \"tm-audio-wrap\",\n onPointerdown: _cache[2] || (_cache[2] = _withModifiers(() => {}, [\"stop\"]))\n }, [_createElementVNode(\"div\", _hoisted_4, [$data.audioCover ? (_openBlock(), _createElementBlock(\"img\", {\n key: 0,\n src: $data.audioCover,\n class: \"cover-img\"\n }, null, 8, _hoisted_5)) : (_openBlock(), _createElementBlock(\"svg\", _hoisted_6, [...(_cache[9] || (_cache[9] = [_createElementVNode(\"path\", {\n d: \"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z\"\n }, null, -1)]))]))]), _createElementVNode(\"div\", _hoisted_7, [_createElementVNode(\"div\", _hoisted_8, _toDisplayString($data.audioTitle), 1), $data.audioArtist ? (_openBlock(), _createElementBlock(\"div\", _hoisted_9, _toDisplayString($data.audioArtist), 1)) : _createCommentVNode(\"\", true)]), _createElementVNode(\"audio\", {\n ref: \"audioEl\",\n class: \"plyr-audio\",\n src: $props.src\n }, null, 8, _hoisted_10)], 32)) : $props.isAudio ? (_openBlock(), _createElementBlock(\"div\", _hoisted_11, [_cache[10] || (_cache[10] = _createElementVNode(\"svg\", {\n class: \"audio-icon-large\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\"\n }, [_createElementVNode(\"path\", {\n d: \"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z\"\n })], -1)), _createElementVNode(\"span\", _hoisted_12, _toDisplayString($data.audioTitle), 1)])) : _createCommentVNode(\"\", true)], 544);\n}","// ==========================================================================\n// Type checking utils\n// ==========================================================================\n\nconst getConstructor = input => (input !== null && typeof input !== 'undefined' ? input.constructor : null);\nconst instanceOf = (input, constructor) => Boolean(input && constructor && input instanceof constructor);\nconst isNullOrUndefined = input => input === null || typeof input === 'undefined';\nconst isObject = input => getConstructor(input) === Object;\nconst isNumber = input => getConstructor(input) === Number && !Number.isNaN(input);\nconst isString = input => getConstructor(input) === String;\nconst isBoolean = input => getConstructor(input) === Boolean;\nconst isFunction = input => typeof input === 'function';\nconst isArray = input => Array.isArray(input);\nconst isWeakMap = input => instanceOf(input, WeakMap);\nconst isNodeList = input => instanceOf(input, NodeList);\nconst isTextNode = input => getConstructor(input) === Text;\nconst isEvent = input => instanceOf(input, Event);\nconst isKeyboardEvent = input => instanceOf(input, KeyboardEvent);\nconst isCue = input => instanceOf(input, window.TextTrackCue) || instanceOf(input, window.VTTCue);\nconst isTrack = input => instanceOf(input, TextTrack) || (!isNullOrUndefined(input) && isString(input.kind));\nconst isPromise = input => instanceOf(input, Promise) && isFunction(input.then);\n\nfunction isElement(input) {\n return input !== null\n && typeof input === 'object'\n && input.nodeType === 1\n && typeof input.style === 'object'\n && typeof input.ownerDocument === 'object';\n}\n\nfunction isEmpty(input) {\n return isNullOrUndefined(input)\n || ((isString(input) || isArray(input) || isNodeList(input)) && !input.length)\n || (isObject(input) && !Object.keys(input).length);\n}\n\nfunction isUrl(input) {\n // Accept a URL object\n if (instanceOf(input, window.URL)) {\n return true;\n }\n\n // Must be string from here\n if (!isString(input)) {\n return false;\n }\n\n // Add the protocol if required\n let string = input;\n if (!input.startsWith('http://') || !input.startsWith('https://')) {\n string = `http://${input}`;\n }\n\n try {\n return !isEmpty(new URL(string).hostname);\n }\n catch {\n return false;\n }\n}\n\nexport default {\n nullOrUndefined: isNullOrUndefined,\n object: isObject,\n number: isNumber,\n string: isString,\n boolean: isBoolean,\n function: isFunction,\n array: isArray,\n weakMap: isWeakMap,\n nodeList: isNodeList,\n element: isElement,\n textNode: isTextNode,\n event: isEvent,\n keyboardEvent: isKeyboardEvent,\n cue: isCue,\n track: isTrack,\n promise: isPromise,\n url: isUrl,\n empty: isEmpty,\n};\n","// ==========================================================================\n// Animation utils\n// ==========================================================================\n\nimport is from './is';\n\nexport const transitionEndEvent = (() => {\n const element = document.createElement('span');\n\n const events = {\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'oTransitionEnd otransitionend',\n transition: 'transitionend',\n };\n\n const type = Object.keys(events).find(event => element.style[event] !== undefined);\n\n return is.string(type) ? events[type] : false;\n})();\n\n// Force repaint of element\nexport function repaint(element, delay) {\n setTimeout(() => {\n try {\n element.hidden = true;\n // eslint-disable-next-line no-unused-expressions\n element.offsetHeight;\n element.hidden = false;\n }\n catch {}\n }, delay);\n}\n","// ==========================================================================\n// Object utils\n// ==========================================================================\n\nimport is from './is';\n\n// Clone nested objects\nexport function cloneDeep(object) {\n return JSON.parse(JSON.stringify(object));\n}\n\n// Get a nested value in an object\nexport function getDeep(object, path) {\n return path.split('.').reduce((obj, key) => obj && obj[key], object);\n}\n\n// Deep extend destination object with N more objects\nexport function extend(target = {}, ...sources) {\n if (!sources.length) {\n return target;\n }\n\n const source = sources.shift();\n\n if (!is.object(source)) {\n return target;\n }\n\n Object.keys(source).forEach((key) => {\n if (is.object(source[key])) {\n if (!Object.keys(target).includes(key)) {\n Object.assign(target, { [key]: {} });\n }\n\n extend(target[key], source[key]);\n }\n else {\n Object.assign(target, { [key]: source[key] });\n }\n });\n\n return extend(target, ...sources);\n}\n","// ==========================================================================\n// Element utils\n// ==========================================================================\n\nimport is from './is';\nimport { extend } from './objects';\n\n// Wrap an element\nexport function wrap(elements, wrapper) {\n // Convert `elements` to an array, if necessary.\n const targets = elements.length ? elements : [elements];\n\n // Loops backwards to prevent having to clone the wrapper on the\n // first element (see `child` below).\n Array.from(targets)\n .reverse()\n .forEach((element, index) => {\n const child = index > 0 ? wrapper.cloneNode(true) : wrapper;\n // Cache the current parent and sibling.\n const parent = element.parentNode;\n const sibling = element.nextSibling;\n\n // Wrap the element (is automatically removed from its current\n // parent).\n child.appendChild(element);\n\n // If the element had a sibling, insert the wrapper before\n // the sibling to maintain the HTML structure; otherwise, just\n // append it to the parent.\n if (sibling) {\n parent.insertBefore(child, sibling);\n }\n else {\n parent.appendChild(child);\n }\n });\n}\n\n// Set attributes\nexport function setAttributes(element, attributes) {\n if (!is.element(element) || is.empty(attributes)) return;\n\n // Assume null and undefined attributes should be left out,\n // Setting them would otherwise convert them to \"null\" and \"undefined\"\n Object.entries(attributes)\n .filter(([, value]) => !is.nullOrUndefined(value))\n .forEach(([key, value]) => element.setAttribute(key, value));\n}\n\n// Create a DocumentFragment\nexport function createElement(type, attributes, text) {\n // Create a new \n const element = document.createElement(type);\n\n // Set all passed attributes\n if (is.object(attributes)) {\n setAttributes(element, attributes);\n }\n\n // Add text node\n if (is.string(text)) {\n element.textContent = text;\n }\n\n // Return built element\n return element;\n}\n\n// Insert an element after another\nexport function insertAfter(element, target) {\n if (!is.element(element) || !is.element(target)) return;\n\n target.parentNode.insertBefore(element, target.nextSibling);\n}\n\n// Insert a DocumentFragment\nexport function insertElement(type, parent, attributes, text) {\n if (!is.element(parent)) return;\n\n parent.appendChild(createElement(type, attributes, text));\n}\n\n// Remove element(s)\nexport function removeElement(element) {\n if (is.nodeList(element) || is.array(element)) {\n Array.from(element).forEach(removeElement);\n return;\n }\n\n if (!is.element(element) || !is.element(element.parentNode)) {\n return;\n }\n\n element.parentNode.removeChild(element);\n}\n\n// Remove all child elements\nexport function emptyElement(element) {\n if (!is.element(element)) return;\n\n let { length } = element.childNodes;\n\n while (length > 0) {\n element.removeChild(element.lastChild);\n length -= 1;\n }\n}\n\n// Replace element\nexport function replaceElement(newChild, oldChild) {\n if (!is.element(oldChild) || !is.element(oldChild.parentNode) || !is.element(newChild)) return null;\n\n oldChild.parentNode.replaceChild(newChild, oldChild);\n\n return newChild;\n}\n\n// Get an attribute object from a string selector\nexport function getAttributesFromSelector(sel, existingAttributes) {\n // For example:\n // '.test' to { class: 'test' }\n // '#test' to { id: 'test' }\n // '[data-test=\"test\"]' to { 'data-test': 'test' }\n\n if (!is.string(sel) || is.empty(sel)) return {};\n\n const attributes = {};\n const existing = extend({}, existingAttributes);\n\n sel.split(',').forEach((s) => {\n // Remove whitespace\n const selector = s.trim();\n const className = selector.replace('.', '');\n const stripped = selector.replace(/[[\\]]/g, '');\n // Get the parts and value\n const parts = stripped.split('=');\n const [key] = parts;\n const value = parts.length > 1 ? parts[1].replace(/[\"']/g, '') : '';\n // Get the first character\n const start = selector.charAt(0);\n\n switch (start) {\n case '.':\n // Add to existing classname\n if (is.string(existing.class)) {\n attributes.class = `${existing.class} ${className}`;\n }\n else {\n attributes.class = className;\n }\n break;\n\n case '#':\n // ID selector\n attributes.id = selector.replace('#', '');\n break;\n\n case '[':\n // Attribute selector\n attributes[key] = value;\n\n break;\n\n default:\n break;\n }\n });\n\n return extend(existing, attributes);\n}\n\n// Toggle hidden\nexport function toggleHidden(element, hidden) {\n if (!is.element(element)) return;\n\n let hide = hidden;\n\n if (!is.boolean(hide)) {\n hide = !element.hidden;\n }\n\n element.hidden = hide;\n}\n\n// Mirror Element.classList.toggle, with IE compatibility for \"force\" argument\nexport function toggleClass(element, className, force) {\n if (is.nodeList(element)) {\n return Array.from(element).map(e => toggleClass(e, className, force));\n }\n\n if (is.element(element)) {\n let method = 'toggle';\n if (typeof force !== 'undefined') {\n method = force ? 'add' : 'remove';\n }\n\n element.classList[method](className);\n return element.classList.contains(className);\n }\n\n return false;\n}\n\n// Has class name\nexport function hasClass(element, className) {\n return is.element(element) && element.classList.contains(className);\n}\n\n// Element matches selector\nexport function matches(element, selector) {\n const { prototype } = Element;\n\n function match() {\n return Array.from(document.querySelectorAll(selector)).includes(this);\n }\n\n const method\n = prototype.matches\n || prototype.webkitMatchesSelector\n || prototype.mozMatchesSelector\n || prototype.msMatchesSelector\n || match;\n\n return method.call(element, selector);\n}\n\n// Closest ancestor element matching selector (also tests element itself)\nexport function closest(element, selector) {\n const { prototype } = Element;\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill\n function closestElement() {\n let el = this;\n\n do {\n if (matches.matches(el, selector)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n }\n\n const method = prototype.closest || closestElement;\n\n return method.call(element, selector);\n}\n\n// Find all elements\nexport function getElements(selector) {\n return this.elements.container.querySelectorAll(selector);\n}\n\n// Find a single element\nexport function getElement(selector) {\n return this.elements.container.querySelector(selector);\n}\n\n// Set focus and tab focus class\nexport function setFocus(element = null, focusVisible = false) {\n if (!is.element(element)) return;\n\n // Set regular focus\n element.focus({ preventScroll: true, focusVisible });\n}\n","// ==========================================================================\n// Plyr support checks\n// ==========================================================================\n\nimport { transitionEndEvent } from './utils/animation';\nimport { createElement } from './utils/elements';\nimport is from './utils/is';\n\n// Default codecs for checking mimetype support\nconst defaultCodecs = {\n 'audio/ogg': 'vorbis',\n 'audio/wav': '1',\n 'video/webm': 'vp8, vorbis',\n 'video/mp4': 'avc1.42E01E, mp4a.40.2',\n 'video/ogg': 'theora',\n};\n\n// Check for feature support\nconst support = {\n // Basic support\n audio: 'canPlayType' in document.createElement('audio'),\n video: 'canPlayType' in document.createElement('video'),\n\n // Check for support\n // Basic functionality vs full UI\n check(type, provider) {\n const api = support[type] || provider !== 'html5';\n const ui = api && support.rangeInput;\n\n return {\n api,\n ui,\n };\n },\n\n // Picture-in-picture support\n pip: (() => {\n return (document.pictureInPictureEnabled && !createElement('video').disablePictureInPicture);\n })(),\n\n // Airplay support\n // Safari only currently\n airplay: is.function(window.WebKitPlaybackTargetAvailabilityEvent),\n\n // Inline playback support\n // https://webkit.org/blog/6784/new-video-policies-for-ios/\n playsinline: 'playsInline' in document.createElement('video'),\n\n // Check for mime type support against a player instance\n // Credits: http://diveintohtml5.info/everything.html\n // Related: http://www.leanbackplayer.com/test/h5mt.html\n mime(input) {\n if (is.empty(input)) {\n return false;\n }\n\n const [mediaType] = input.split('/');\n let type = input;\n\n // Verify we're using HTML5 and there's no media type mismatch\n if (!this.isHTML5 || mediaType !== this.type) {\n return false;\n }\n\n // Add codec if required\n if (Object.keys(defaultCodecs).includes(type)) {\n type += `; codecs=\"${defaultCodecs[input]}\"`;\n }\n\n try {\n return Boolean(type && this.media.canPlayType(type).replace(/no/, ''));\n }\n catch {\n return false;\n }\n },\n\n // Check for textTracks support\n textTracks: 'textTracks' in document.createElement('video'),\n\n // Sliders\n rangeInput: (() => {\n const range = document.createElement('input');\n range.type = 'range';\n return range.type === 'range';\n })(),\n\n // Touch\n // NOTE: Remember a device can be mouse + touch enabled so we check on first touch event\n touch: 'ontouchstart' in document.documentElement,\n\n // Detect transitions support\n transitions: transitionEndEvent !== false,\n\n // Reduced motion iOS & MacOS setting\n // https://webkit.org/blog/7551/responsive-design-for-motion/\n reducedMotion: 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches,\n};\n\nexport default support;\n","// ==========================================================================\n// Event utils\n// ==========================================================================\n\nimport is from './is';\n\n// Check for passive event listener support\n// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n// https://www.youtube.com/watch?v=NPM6172J22g\nconst supportsPassiveListeners = (() => {\n // Test via a getter in the options object to see if the passive property is accessed\n let supported = false;\n try {\n const options = Object.defineProperty({}, 'passive', {\n get() {\n supported = true;\n return null;\n },\n });\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n }\n catch {}\n\n return supported;\n})();\n\n// Toggle event listener\nexport function toggleListener(element, event, callback, toggle = false, passive = true, capture = false) {\n // Bail if no element, event, or callback\n if (!element || !('addEventListener' in element) || is.empty(event) || !is.function(callback)) {\n return;\n }\n\n // Allow multiple events\n const events = event.split(' ');\n // Build options\n // Default to just the capture boolean for browsers with no passive listener support\n let options = capture;\n\n // If passive events listeners are supported\n if (supportsPassiveListeners) {\n options = {\n // Whether the listener can be passive (i.e. default never prevented)\n passive,\n // Whether the listener is a capturing listener or not\n capture,\n };\n }\n\n // If a single node is passed, bind the event listener\n events.forEach((type) => {\n if (this && this.eventListeners && toggle) {\n // Cache event listener\n this.eventListeners.push({ element, type, callback, options });\n }\n\n element[toggle ? 'addEventListener' : 'removeEventListener'](type, callback, options);\n });\n}\n\n// Bind event handler\nexport function on(element, events = '', callback, passive = true, capture = false) {\n toggleListener.call(this, element, events, callback, true, passive, capture);\n}\n\n// Unbind event handler\nexport function off(element, events = '', callback, passive = true, capture = false) {\n toggleListener.call(this, element, events, callback, false, passive, capture);\n}\n\n// Bind once-only event handler\nexport function once(element, events = '', callback, passive = true, capture = false) {\n const onceCallback = (...args) => {\n off(element, events, onceCallback, passive, capture);\n callback.apply(this, args);\n };\n\n toggleListener.call(this, element, events, onceCallback, true, passive, capture);\n}\n\n// Trigger event\nexport function triggerEvent(element, type = '', bubbles = false, detail = {}) {\n // Bail if no element\n if (!is.element(element) || is.empty(type)) {\n return;\n }\n\n // Create and dispatch the event\n const event = new CustomEvent(type, {\n bubbles,\n detail: { ...detail, plyr: this },\n });\n\n // Dispatch the event\n element.dispatchEvent(event);\n}\n\n// Unbind all cached event listeners\nexport function unbindListeners() {\n if (this && this.eventListeners) {\n this.eventListeners.forEach((item) => {\n const { element, type, callback, options } = item;\n element.removeEventListener(type, callback, options);\n });\n\n this.eventListeners = [];\n }\n}\n\n// Run method when / if player is ready\nexport function ready() {\n return new Promise(resolve =>\n this.ready ? setTimeout(resolve, 0) : on.call(this, this.elements.container, 'ready', resolve),\n ).then(() => {});\n}\n","import is from './is';\n/**\n * Silence a Promise-like object.\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n * @param {object} value An object that may or may not be `Promise`-like.\n */\nexport function silencePromise(value) {\n if (is.promise(value)) {\n value.then(null, () => {});\n }\n}\n\nexport default { silencePromise };\n","// ==========================================================================\n// Array utils\n// ==========================================================================\n\nimport is from './is';\n\n// Remove duplicates in an array\nexport function dedupe(array) {\n if (!is.array(array)) {\n return array;\n }\n\n return array.filter((item, index) => array.indexOf(item) === index);\n}\n\n// Get the closest value in an array\nexport function closest(array, value) {\n if (!is.array(array) || !array.length) {\n return null;\n }\n\n return array.reduce((prev, curr) => (Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev));\n}\n","// ==========================================================================\n// Style utils\n// ==========================================================================\n\nimport { closest } from './arrays';\nimport is from './is';\n\n// Check support for a CSS declaration\nexport function supportsCSS(declaration) {\n if (!window || !window.CSS) {\n return false;\n }\n\n return window.CSS.supports(declaration);\n}\n\n// Standard/common aspect ratios\nconst standardRatios = [\n [1, 1],\n [4, 3],\n [3, 4],\n [5, 4],\n [4, 5],\n [3, 2],\n [2, 3],\n [16, 10],\n [10, 16],\n [16, 9],\n [9, 16],\n [21, 9],\n [9, 21],\n [32, 9],\n [9, 32],\n].reduce((out, [x, y]) => ({ ...out, [x / y]: [x, y] }), {});\n\n// Validate an aspect ratio\nexport function validateAspectRatio(input) {\n if (!is.array(input) && (!is.string(input) || !input.includes(':'))) {\n return false;\n }\n\n const ratio = is.array(input) ? input : input.split(':');\n\n return ratio.map(Number).every(is.number);\n}\n\n// Reduce an aspect ratio to it's lowest form\nexport function reduceAspectRatio(ratio) {\n if (!is.array(ratio) || !ratio.every(is.number)) {\n return null;\n }\n\n const [width, height] = ratio;\n const getDivider = (w, h) => (h === 0 ? w : getDivider(h, w % h));\n const divider = getDivider(width, height);\n\n return [width / divider, height / divider];\n}\n\n// Calculate an aspect ratio\nexport function getAspectRatio(input) {\n const parse = ratio => (validateAspectRatio(ratio) ? ratio.split(':').map(Number) : null);\n // Try provided ratio\n let ratio = parse(input);\n\n // Get from config\n if (ratio === null) {\n ratio = parse(this.config.ratio);\n }\n\n // Get from embed\n if (ratio === null && !is.empty(this.embed) && is.array(this.embed.ratio)) {\n ({ ratio } = this.embed);\n }\n\n // Get from HTML5 video\n if (ratio === null && this.isHTML5) {\n const { videoWidth, videoHeight } = this.media;\n ratio = [videoWidth, videoHeight];\n }\n\n return reduceAspectRatio(ratio);\n}\n\n// Set aspect ratio for responsive container\nexport function setAspectRatio(input) {\n if (!this.isVideo) {\n return {};\n }\n\n const { wrapper } = this.elements;\n const ratio = getAspectRatio.call(this, input);\n\n if (!is.array(ratio)) {\n return {};\n }\n\n const [x, y] = reduceAspectRatio(ratio);\n const useNative = supportsCSS(`aspect-ratio: ${x}/${y}`);\n const padding = (100 / x) * y;\n\n if (useNative) {\n wrapper.style.aspectRatio = `${x}/${y}`;\n }\n else {\n wrapper.style.paddingBottom = `${padding}%`;\n }\n\n // For Vimeo we have an extra
to hide the standard controls and UI\n if (this.isVimeo && !this.config.vimeo.premium && this.supported.ui) {\n const height = (100 / this.media.offsetWidth) * Number.parseInt(window.getComputedStyle(this.media).paddingBottom, 10);\n const offset = (height - padding) / (height / 50);\n\n if (this.fullscreen.active) {\n wrapper.style.paddingBottom = null;\n }\n else {\n this.media.style.transform = `translateY(-${offset}%)`;\n }\n }\n else if (this.isHTML5) {\n wrapper.classList.add(this.config.classNames.videoFixedRatio);\n }\n\n return { padding, ratio };\n}\n\n// Round an aspect ratio to closest standard ratio\nexport function roundAspectRatio(x, y, tolerance = 0.05) {\n const ratio = x / y;\n const closestRatio = closest(Object.keys(standardRatios), ratio);\n\n // Check match is within tolerance\n if (Math.abs(closestRatio - ratio) <= tolerance) {\n return standardRatios[closestRatio];\n }\n\n // No match\n return [x, y];\n}\n\n// Get the size of the viewport\n// https://stackoverflow.com/questions/1248081/how-to-get-the-browser-viewport-dimensions\nexport function getViewportSize() {\n const width = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const height = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);\n return [width, height];\n}\n","// ==========================================================================\n// Plyr HTML5 helpers\n// ==========================================================================\n\nimport support from './support';\nimport { removeElement } from './utils/elements';\nimport { triggerEvent } from './utils/events';\nimport is from './utils/is';\nimport { silencePromise } from './utils/promise';\nimport { setAspectRatio } from './utils/style';\n\nconst html5 = {\n getSources() {\n if (!this.isHTML5) {\n return [];\n }\n\n const sources = Array.from(this.media.querySelectorAll('source'));\n\n // Filter out unsupported sources (if type is specified)\n return sources.filter((source) => {\n const type = source.getAttribute('type');\n\n if (is.empty(type)) {\n return true;\n }\n\n return support.mime.call(this, type);\n });\n },\n\n // Get quality levels\n getQualityOptions() {\n // Whether we're forcing all options (e.g. for streaming)\n if (this.config.quality.forced) {\n return this.config.quality.options;\n }\n\n // Get sizes from elements\n return html5.getSources\n .call(this)\n .map(source => Number(source.getAttribute('size')))\n .filter(Boolean);\n },\n\n setup() {\n if (!this.isHTML5) {\n return;\n }\n\n const player = this;\n\n // Set speed options from config\n player.options.speed = player.config.speed.options;\n\n // Set aspect ratio if fixed\n if (!is.empty(this.config.ratio)) {\n setAspectRatio.call(player);\n }\n\n // Quality\n Object.defineProperty(player.media, 'quality', {\n get() {\n // Get sources\n const sources = html5.getSources.call(player);\n const source = sources.find(s => s.getAttribute('src') === player.source);\n\n // Return size, if match is found\n return source && Number(source.getAttribute('size'));\n },\n set(input) {\n if (player.quality === input) {\n return;\n }\n\n // If we're using an external handler...\n if (player.config.quality.forced && is.function(player.config.quality.onChange)) {\n player.config.quality.onChange(input);\n }\n else {\n // Get sources\n const sources = html5.getSources.call(player);\n // Get first match for requested size\n const source = sources.find(s => Number(s.getAttribute('size')) === input);\n\n // No matching source found\n if (!source) {\n return;\n }\n\n // Get current state\n const { currentTime, paused, preload, readyState, playbackRate } = player.media;\n\n // Set new source\n player.media.src = source.getAttribute('src');\n\n // Prevent loading if preload=\"none\" and the current source isn't loaded (#1044)\n if (preload !== 'none' || readyState) {\n // Restore time\n player.once('loadedmetadata', () => {\n player.speed = playbackRate;\n player.currentTime = currentTime;\n\n // Resume playing\n if (!paused) {\n silencePromise(player.play());\n }\n });\n\n // Load new source\n player.media.load();\n }\n }\n\n // Trigger change event\n triggerEvent.call(player, player.media, 'qualitychange', false, {\n quality: input,\n });\n },\n });\n },\n\n // Cancel current network requests\n // See https://github.com/sampotts/plyr/issues/174\n cancelRequests() {\n if (!this.isHTML5) {\n return;\n }\n\n // Remove child sources\n removeElement(html5.getSources.call(this));\n\n // Set blank video src attribute\n // This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error\n // Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection\n this.media.setAttribute('src', this.config.blankVideo);\n\n // Load the new empty source\n // This will cancel existing requests\n // See https://github.com/sampotts/plyr/issues/174\n this.media.load();\n\n // Debugging\n this.debug.log('Cancelled network requests');\n },\n};\n\nexport default html5;\n","// ==========================================================================\n// Browser sniffing\n// Unfortunately, due to mixed support, UA sniffing is required\n// ==========================================================================\n\nconst isIE = Boolean(window.document.documentMode);\nconst isEdge = /Edge/.test(navigator.userAgent);\nconst isWebKit = 'WebkitAppearance' in document.documentElement.style && !/Edge/.test(navigator.userAgent);\nconst isIPhone = /iPhone|iPod/i.test(navigator.userAgent) && navigator.maxTouchPoints > 1;\n// navigator.platform may be deprecated but this check is still required\nconst isIPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;\nconst isIos = /iPad|iPhone|iPod/i.test(navigator.userAgent) && navigator.maxTouchPoints > 1;\n\nexport default {\n isIE,\n isEdge,\n isWebKit,\n isIPhone,\n isIPadOS,\n isIos,\n};\n","// ==========================================================================\n// String utils\n// ==========================================================================\n\nimport is from './is';\n\n// Generate a random ID\nexport function generateId(prefix) {\n return `${prefix}-${Math.floor(Math.random() * 10000)}`;\n}\n\n// Format string\nexport function format(input, ...args) {\n if (is.empty(input)) return input;\n\n return input.toString().replace(/\\{(\\d+)\\}/g, (_, i) => args[i].toString());\n}\n\n// Get percentage\nexport function getPercentage(current, max) {\n if (current === 0 || max === 0 || Number.isNaN(current) || Number.isNaN(max)) {\n return 0;\n }\n\n return ((current / max) * 100).toFixed(2);\n}\n\n// Replace all occurrences of a string in a string\nexport function replaceAll(input = '', find = '', replace = '') {\n return input.replace(new RegExp(find.toString().replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1'), 'g'), replace.toString());\n}\n\n// Convert to title case\nexport function toTitleCase(input = '') {\n return input.toString().replace(/\\w\\S*/g, text => text.charAt(0).toUpperCase() + text.slice(1).toLowerCase());\n}\n\n// Convert string to pascalCase\nexport function toPascalCase(input = '') {\n let string = input.toString();\n\n // Convert kebab case\n string = replaceAll(string, '-', ' ');\n\n // Convert snake case\n string = replaceAll(string, '_', ' ');\n\n // Convert to title case\n string = toTitleCase(string);\n\n // Convert to pascal case\n return replaceAll(string, ' ', '');\n}\n\n// Convert string to pascalCase\nexport function toCamelCase(input = '') {\n let string = input.toString();\n\n // Convert to pascal case\n string = toPascalCase(string);\n\n // Convert first character to lowercase\n return string.charAt(0).toLowerCase() + string.slice(1);\n}\n\n// Remove HTML from a string\nexport function stripHTML(source) {\n const fragment = document.createDocumentFragment();\n const element = document.createElement('div');\n fragment.appendChild(element);\n element.innerHTML = source;\n return fragment.firstChild.textContent;\n}\n\n// Like outerHTML, but also works for DocumentFragment\nexport function getHTML(element) {\n const wrapper = document.createElement('div');\n wrapper.appendChild(element);\n return wrapper.innerHTML;\n}\n","// ==========================================================================\n// Plyr internationalization\n// ==========================================================================\n\nimport is from './is';\nimport { getDeep } from './objects';\nimport { replaceAll } from './strings';\n\n// Skip i18n for abbreviations and brand names\nconst resources = {\n pip: 'PIP',\n airplay: 'AirPlay',\n html5: 'HTML5',\n vimeo: 'Vimeo',\n youtube: 'YouTube',\n};\n\nconst i18n = {\n get(key = '', config = {}) {\n if (is.empty(key) || is.empty(config)) {\n return '';\n }\n\n let string = getDeep(config.i18n, key);\n\n if (is.empty(string)) {\n if (Object.keys(resources).includes(key)) {\n return resources[key];\n }\n\n return '';\n }\n\n const replace = {\n '{seektime}': config.seekTime,\n '{title}': config.title,\n };\n\n Object.entries(replace).forEach(([k, v]) => {\n string = replaceAll(string, k, v);\n });\n\n return string;\n },\n};\n\nexport default i18n;\n","// ==========================================================================\n// Plyr storage\n// ==========================================================================\n\nimport is from './utils/is';\nimport { extend } from './utils/objects';\n\nclass Storage {\n constructor(player) {\n this.enabled = player.config.storage.enabled;\n this.key = player.config.storage.key;\n }\n\n // Check for actual support (see if we can use it)\n static get supported() {\n try {\n if (!('localStorage' in window)) return false;\n const test = '___test';\n // Try to use it (it might be disabled, e.g. user is in private mode)\n // see: https://github.com/sampotts/plyr/issues/131\n window.localStorage.setItem(test, test);\n window.localStorage.removeItem(test);\n return true;\n }\n catch {\n return false;\n }\n }\n\n get = (key) => {\n if (!Storage.supported || !this.enabled) {\n return null;\n }\n const store = window.localStorage.getItem(this.key);\n if (is.empty(store)) return null;\n const json = JSON.parse(store);\n return is.string(key) && key.length ? json[key] : json;\n };\n\n set = (object) => {\n // Bail if we don't have localStorage support or it's disabled\n if (!Storage.supported || !this.enabled) {\n return;\n }\n\n // Can only store objects\n if (!is.object(object)) {\n return;\n }\n\n // Get current storage\n let storage = this.get();\n\n // Default to empty object\n if (is.empty(storage)) {\n storage = {};\n }\n\n // Update the working copy of the values\n extend(storage, object);\n\n // Update storage\n try {\n window.localStorage.setItem(this.key, JSON.stringify(storage));\n }\n catch { }\n };\n}\n\nexport default Storage;\n","// ==========================================================================\n// Fetch wrapper\n// Using XHR to avoid issues with older browsers\n// ==========================================================================\n\nexport default function fetch(url, responseType = 'text', withCredentials = false) {\n return new Promise((resolve, reject) => {\n try {\n const request = new XMLHttpRequest();\n\n // Check for CORS support\n if (!('withCredentials' in request)) return;\n\n // Set to true if needed for CORS\n if (withCredentials) {\n request.withCredentials = true;\n }\n\n request.addEventListener('load', () => {\n if (responseType === 'text') {\n try {\n resolve(JSON.parse(request.responseText));\n }\n catch {\n resolve(request.responseText);\n }\n }\n else {\n resolve(request.response);\n }\n });\n\n request.addEventListener('error', () => {\n throw new Error(request.status);\n });\n\n request.open('GET', url, true);\n request.responseType = responseType;\n request.send();\n }\n catch (error) {\n reject(error);\n }\n });\n}\n","// ==========================================================================\n// Sprite loader\n// ==========================================================================\n\nimport Storage from '../storage';\nimport fetch from './fetch';\nimport is from './is';\n\n// Load an external SVG sprite\nexport default function loadSprite(url, id) {\n if (!is.string(url)) {\n return;\n }\n\n const prefix = 'cache';\n const hasId = is.string(id);\n let isCached = false;\n const exists = () => document.getElementById(id) !== null;\n\n const update = (container, data) => {\n container.innerHTML = data;\n\n // Check again incase of race condition\n if (hasId && exists()) {\n return;\n }\n\n // Inject the SVG to the body\n document.body.insertAdjacentElement('afterbegin', container);\n };\n\n // Only load once if ID set\n if (!hasId || !exists()) {\n const useStorage = Storage.supported;\n // Create container\n const container = document.createElement('div');\n container.setAttribute('hidden', '');\n\n if (hasId) {\n container.setAttribute('id', id);\n }\n\n // Check in cache\n if (useStorage) {\n const cached = window.localStorage.getItem(`${prefix}-${id}`);\n isCached = cached !== null;\n\n if (isCached) {\n const data = JSON.parse(cached);\n update(container, data.content);\n }\n }\n\n // Get the sprite\n fetch(url)\n .then((result) => {\n if (is.empty(result)) {\n return;\n }\n\n if (useStorage) {\n try {\n window.localStorage.setItem(\n `${prefix}-${id}`,\n JSON.stringify({\n content: result,\n }),\n );\n }\n catch {}\n }\n\n update(container, result);\n })\n .catch(() => {});\n }\n}\n","// ==========================================================================\n// Time utils\n// ==========================================================================\n\nimport is from './is';\n\n// Time helpers\nexport const getHours = value => Math.trunc((value / 60 / 60) % 60, 10);\nexport const getMinutes = value => Math.trunc((value / 60) % 60, 10);\nexport const getSeconds = value => Math.trunc(value % 60, 10);\n\n// Format time to UI friendly string\nexport function formatTime(time = 0, displayHours = false, inverted = false) {\n // Bail if the value isn't a number\n if (!is.number(time)) {\n return formatTime(undefined, displayHours, inverted);\n }\n\n // Format time component to add leading zero\n const format = value => `0${value}`.slice(-2);\n // Breakdown to hours, mins, secs\n let hours = getHours(time);\n const mins = getMinutes(time);\n const secs = getSeconds(time);\n\n // Do we need to display hours?\n if (displayHours || hours > 0) {\n hours = `${hours}:`;\n }\n else {\n hours = '';\n }\n\n // Render\n return `${inverted && time > 0 ? '-' : ''}${hours}${format(mins)}:${format(secs)}`;\n}\n","// ==========================================================================\n// Plyr controls\n// TODO: This needs to be split into smaller files and cleaned up\n// ==========================================================================\n\nimport RangeTouch from 'rangetouch';\n\nimport captions from './captions';\nimport html5 from './html5';\nimport support from './support';\nimport { repaint, transitionEndEvent } from './utils/animation';\nimport { dedupe } from './utils/arrays';\nimport browser from './utils/browser';\nimport {\n createElement,\n emptyElement,\n getAttributesFromSelector,\n getElement,\n getElements,\n hasClass,\n matches,\n removeElement,\n setAttributes,\n setFocus,\n toggleClass,\n toggleHidden,\n} from './utils/elements';\nimport { off, on } from './utils/events';\nimport i18n from './utils/i18n';\nimport is from './utils/is';\nimport loadSprite from './utils/load-sprite';\nimport { extend } from './utils/objects';\nimport { getPercentage, replaceAll, toCamelCase, toTitleCase } from './utils/strings';\nimport { formatTime, getHours } from './utils/time';\n\n// TODO: Don't export a massive object - break down and create class\nconst controls = {\n // Get icon URL\n getIconUrl() {\n const url = new URL(this.config.iconUrl, window.location);\n const host = window.location.host ? window.location.host : window.top.location.host;\n const cors = url.host !== host || (browser.isIE && !window.svg4everybody);\n\n return {\n url: this.config.iconUrl,\n cors,\n };\n },\n\n // Find the UI controls\n findElements() {\n try {\n this.elements.controls = getElement.call(this, this.config.selectors.controls.wrapper);\n\n // Buttons\n this.elements.buttons = {\n play: getElements.call(this, this.config.selectors.buttons.play),\n pause: getElement.call(this, this.config.selectors.buttons.pause),\n restart: getElement.call(this, this.config.selectors.buttons.restart),\n rewind: getElement.call(this, this.config.selectors.buttons.rewind),\n fastForward: getElement.call(this, this.config.selectors.buttons.fastForward),\n mute: getElement.call(this, this.config.selectors.buttons.mute),\n pip: getElement.call(this, this.config.selectors.buttons.pip),\n airplay: getElement.call(this, this.config.selectors.buttons.airplay),\n settings: getElement.call(this, this.config.selectors.buttons.settings),\n captions: getElement.call(this, this.config.selectors.buttons.captions),\n fullscreen: getElement.call(this, this.config.selectors.buttons.fullscreen),\n };\n\n // Progress\n this.elements.progress = getElement.call(this, this.config.selectors.progress);\n\n // Inputs\n this.elements.inputs = {\n seek: getElement.call(this, this.config.selectors.inputs.seek),\n volume: getElement.call(this, this.config.selectors.inputs.volume),\n };\n\n // Display\n this.elements.display = {\n buffer: getElement.call(this, this.config.selectors.display.buffer),\n currentTime: getElement.call(this, this.config.selectors.display.currentTime),\n duration: getElement.call(this, this.config.selectors.display.duration),\n };\n\n // Seek tooltip\n if (is.element(this.elements.progress)) {\n this.elements.display.seekTooltip = this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`);\n }\n\n return true;\n }\n catch (error) {\n // Log it\n this.debug.warn('It looks like there is a problem with your custom controls HTML', error);\n\n // Restore native video controls\n this.toggleNativeControls(true);\n\n return false;\n }\n },\n\n // Create icon\n createIcon(type, attributes) {\n const namespace = 'http://www.w3.org/2000/svg';\n const iconUrl = controls.getIconUrl.call(this);\n const iconPath = `${!iconUrl.cors ? iconUrl.url : ''}#${this.config.iconPrefix}`;\n // Create \n const icon = document.createElementNS(namespace, 'svg');\n setAttributes(\n icon,\n extend(attributes, {\n 'aria-hidden': 'true',\n 'focusable': 'false',\n }),\n );\n\n // Create the to reference sprite\n const use = document.createElementNS(namespace, 'use');\n const path = `${iconPath}-${type}`;\n\n // Set `href` attributes\n // https://github.com/sampotts/plyr/issues/460\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href\n if ('href' in use) {\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);\n }\n\n // Always set the older attribute even though it's \"deprecated\" (it'll be around for ages)\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);\n\n // Add to \n icon.appendChild(use);\n\n return icon;\n },\n\n // Create hidden text label\n createLabel(key, attr = {}) {\n const text = i18n.get(key, this.config);\n const attributes = { ...attr, class: [attr.class, this.config.classNames.hidden].filter(Boolean).join(' ') };\n\n return createElement('span', attributes, text);\n },\n\n // Create a badge\n createBadge(text) {\n if (is.empty(text)) {\n return null;\n }\n\n const badge = createElement('span', {\n class: this.config.classNames.menu.value,\n });\n\n badge.appendChild(\n createElement(\n 'span',\n {\n class: this.config.classNames.menu.badge,\n },\n text,\n ),\n );\n\n return badge;\n },\n\n // Create a
`);\n }\n\n // Set position\n tipElement.style.left = `${percent}%`;\n\n // Show/hide the tooltip\n // If the event is a moues in/out and percentage is inside bounds\n if (is.event(event) && ['mouseenter', 'mouseleave'].includes(event.type)) {\n toggle(event.type === 'mouseenter');\n }\n },\n\n // Handle time change event\n timeUpdate(event) {\n // Only invert if only one time element is displayed and used for both duration and currentTime\n const invert = !is.element(this.elements.display.duration) && this.config.invertTime;\n\n // Duration\n controls.updateTimeDisplay.call(\n this,\n this.elements.display.currentTime,\n invert ? this.duration - this.currentTime : this.currentTime,\n invert,\n );\n\n // Ignore updates while seeking\n if (event && event.type === 'timeupdate' && this.media.seeking) {\n return;\n }\n\n // Playing progress\n controls.updateProgress.call(this, event);\n },\n\n // Show the duration on metadataloaded or durationchange events\n durationUpdate() {\n // Bail if no UI or durationchange event triggered after playing/seek when invertTime is false\n if (!this.supported.ui || (!this.config.invertTime && this.currentTime)) {\n return;\n }\n\n // If duration is the 2**32 (shaka), Infinity (HLS), DASH-IF (Number.MAX_SAFE_INTEGER || Number.MAX_VALUE) indicating live we hide the currentTime and progressbar.\n // https://github.com/video-dev/hls.js/blob/5820d29d3c4c8a46e8b75f1e3afa3e68c1a9a2db/src/controller/buffer-controller.js#L415\n // https://github.com/google/shaka-player/blob/4d889054631f4e1cf0fbd80ddd2b71887c02e232/lib/media/streaming_engine.js#L1062\n // https://github.com/Dash-Industry-Forum/dash.js/blob/69859f51b969645b234666800d4cb596d89c602d/src/dash/models/DashManifestModel.js#L338\n if (this.duration >= 2 ** 32) {\n toggleHidden(this.elements.display.currentTime, true);\n toggleHidden(this.elements.progress, true);\n return;\n }\n\n // Update ARIA values\n if (is.element(this.elements.inputs.seek)) {\n this.elements.inputs.seek.setAttribute('aria-valuemax', this.duration);\n }\n\n // If there's a spot to display duration\n const hasDuration = is.element(this.elements.display.duration);\n\n // If there's only one time display, display duration there\n if (!hasDuration && this.config.displayDuration && this.paused) {\n controls.updateTimeDisplay.call(this, this.elements.display.currentTime, this.duration);\n }\n\n // If there's a duration element, update content\n if (hasDuration) {\n controls.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);\n }\n\n if (this.config.markers.enabled) {\n controls.setMarkers.call(this);\n }\n\n // Update the tooltip (if visible)\n controls.updateSeekTooltip.call(this);\n },\n\n // Hide/show a tab\n toggleMenuButton(setting, toggle) {\n toggleHidden(this.elements.settings.buttons[setting], !toggle);\n },\n\n // Update the selected setting\n updateSetting(setting, container, input) {\n const pane = this.elements.settings.panels[setting];\n let value = null;\n let list = container;\n\n if (setting === 'captions') {\n value = this.currentTrack;\n }\n else {\n value = !is.empty(input) ? input : this[setting];\n\n // Get default\n if (is.empty(value)) {\n value = this.config[setting].default;\n }\n\n // Unsupported value\n if (!is.empty(this.options[setting]) && !this.options[setting].includes(value)) {\n this.debug.warn(`Unsupported value of '${value}' for ${setting}`);\n return;\n }\n\n // Disabled value\n if (!this.config[setting].options.includes(value)) {\n this.debug.warn(`Disabled value of '${value}' for ${setting}`);\n return;\n }\n }\n\n // Get the list if we need to\n if (!is.element(list)) {\n list = pane && pane.querySelector('[role=\"menu\"]');\n }\n\n // If there's no list it means it's not been rendered...\n if (!is.element(list)) {\n return;\n }\n\n // Update the label\n const label = this.elements.settings.buttons[setting].querySelector(`.${this.config.classNames.menu.value}`);\n label.innerHTML = controls.getLabel.call(this, setting, value);\n\n // Find the radio option and check it\n const target = list && list.querySelector(`[value=\"${value}\"]`);\n\n if (is.element(target)) {\n target.checked = true;\n }\n },\n\n // Translate a value into a nice label\n getLabel(setting, value) {\n switch (setting) {\n case 'speed':\n return value === 1 ? i18n.get('normal', this.config) : `${value}×`;\n\n case 'quality':\n if (is.number(value)) {\n const label = i18n.get(`qualityLabel.${value}`, this.config);\n\n if (!label.length) {\n return `${value}p`;\n }\n\n return label;\n }\n\n return toTitleCase(value);\n\n case 'captions':\n return captions.getLabel.call(this);\n\n default:\n return null;\n }\n },\n\n // Set the quality menu\n setQualityMenu(options) {\n // Menu required\n if (!is.element(this.elements.settings.panels.quality)) {\n return;\n }\n\n const type = 'quality';\n const list = this.elements.settings.panels.quality.querySelector('[role=\"menu\"]');\n\n // Set options if passed and filter based on uniqueness and config\n if (is.array(options)) {\n this.options.quality = dedupe(options).filter(quality => this.config.quality.options.includes(quality));\n }\n\n // Toggle the pane and tab\n const toggle = !is.empty(this.options.quality) && this.options.quality.length > 1;\n controls.toggleMenuButton.call(this, type, toggle);\n\n // Empty the menu\n emptyElement(list);\n\n // Check if we need to toggle the parent\n controls.checkMenu.call(this);\n\n // If we're hiding, nothing more to do\n if (!toggle) {\n return;\n }\n\n // Get the badge HTML for HD, 4K etc\n const getBadge = (quality) => {\n const label = i18n.get(`qualityBadge.${quality}`, this.config);\n\n if (!label.length) {\n return null;\n }\n\n return controls.createBadge.call(this, label);\n };\n\n // Sort options by the config and then render options\n this.options.quality\n .sort((a, b) => {\n const sorting = this.config.quality.options;\n return sorting.indexOf(a) > sorting.indexOf(b) ? 1 : -1;\n })\n .forEach((quality) => {\n controls.createMenuItem.call(this, {\n value: quality,\n list,\n type,\n title: controls.getLabel.call(this, 'quality', quality),\n badge: getBadge(quality),\n });\n });\n\n controls.updateSetting.call(this, type, list);\n },\n\n // Set the looping options\n /* setLoopMenu() {\n // Menu required\n if (!is.element(this.elements.settings.panels.loop)) {\n return;\n }\n\n const options = ['start', 'end', 'all', 'reset'];\n const list = this.elements.settings.panels.loop.querySelector('[role=\"menu\"]');\n\n // Show the pane and tab\n toggleHidden(this.elements.settings.buttons.loop, false);\n toggleHidden(this.elements.settings.panels.loop, false);\n\n // Toggle the pane and tab\n const toggle = !is.empty(this.loop.options);\n controls.toggleMenuButton.call(this, 'loop', toggle);\n\n // Empty the menu\n emptyElement(list);\n\n options.forEach(option => {\n const item = createElement('li');\n\n const button = createElement(\n 'button',\n extend(getAttributesFromSelector(this.config.selectors.buttons.loop), {\n type: 'button',\n class: this.config.classNames.control,\n 'data-plyr-loop-action': option,\n }),\n i18n.get(option, this.config)\n );\n\n if (['start', 'end'].includes(option)) {\n const badge = controls.createBadge.call(this, '00:00');\n button.appendChild(badge);\n }\n\n item.appendChild(button);\n list.appendChild(item);\n });\n }, */\n\n // Get current selected caption language\n // TODO: rework this to user the getter in the API?\n\n // Set a list of available captions languages\n setCaptionsMenu() {\n // Menu required\n if (!is.element(this.elements.settings.panels.captions)) {\n return;\n }\n\n // TODO: Captions or language? Currently it's mixed\n const type = 'captions';\n const list = this.elements.settings.panels.captions.querySelector('[role=\"menu\"]');\n const tracks = captions.getTracks.call(this);\n const toggle = Boolean(tracks.length);\n\n // Toggle the pane and tab\n controls.toggleMenuButton.call(this, type, toggle);\n\n // Empty the menu\n emptyElement(list);\n\n // Check if we need to toggle the parent\n controls.checkMenu.call(this);\n\n // If there's no captions, bail\n if (!toggle) {\n return;\n }\n\n // Generate options data\n const options = tracks.map((track, value) => ({\n value,\n checked: this.captions.toggled && this.currentTrack === value,\n title: captions.getLabel.call(this, track),\n badge: track.language && controls.createBadge.call(this, track.language.toUpperCase()),\n list,\n type: 'language',\n }));\n\n // Add the \"Disabled\" option to turn off captions\n options.unshift({\n value: -1,\n checked: !this.captions.toggled,\n title: i18n.get('disabled', this.config),\n list,\n type: 'language',\n });\n\n // Generate options\n options.forEach(controls.createMenuItem.bind(this));\n\n controls.updateSetting.call(this, type, list);\n },\n\n // Set a list of available captions languages\n setSpeedMenu() {\n // Menu required\n if (!is.element(this.elements.settings.panels.speed)) {\n return;\n }\n\n const type = 'speed';\n const list = this.elements.settings.panels.speed.querySelector('[role=\"menu\"]');\n\n // Filter out invalid speeds\n this.options.speed = this.options.speed.filter(o => o >= this.minimumSpeed && o <= this.maximumSpeed);\n\n // Toggle the pane and tab\n const toggle = !is.empty(this.options.speed) && this.options.speed.length > 1;\n controls.toggleMenuButton.call(this, type, toggle);\n\n // Empty the menu\n emptyElement(list);\n\n // Check if we need to toggle the parent\n controls.checkMenu.call(this);\n\n // If we're hiding, nothing more to do\n if (!toggle) {\n return;\n }\n\n // Create items\n this.options.speed.forEach((speed) => {\n controls.createMenuItem.call(this, {\n value: speed,\n list,\n type,\n title: controls.getLabel.call(this, 'speed', speed),\n });\n });\n\n controls.updateSetting.call(this, type, list);\n },\n\n // Check if we need to hide/show the settings menu\n checkMenu() {\n const { buttons } = this.elements.settings;\n const visible = !is.empty(buttons) && Object.values(buttons).some(button => !button.hidden);\n\n toggleHidden(this.elements.settings.menu, !visible);\n },\n\n // Focus the first menu item in a given (or visible) menu\n focusFirstMenuItem(pane, focusVisible = false) {\n if (this.elements.settings.popup.hidden) {\n return;\n }\n\n let target = pane;\n\n if (!is.element(target)) {\n target = Object.values(this.elements.settings.panels).find(p => !p.hidden);\n }\n\n const firstItem = target.querySelector('[role^=\"menuitem\"]');\n\n setFocus.call(this, firstItem, focusVisible);\n },\n\n // Show/hide menu\n toggleMenu(input) {\n const { popup } = this.elements.settings;\n const button = this.elements.buttons.settings;\n\n // Menu and button are required\n if (!is.element(popup) || !is.element(button)) {\n return;\n }\n\n // True toggle by default\n const { hidden } = popup;\n let show = hidden;\n\n if (is.boolean(input)) {\n show = input;\n }\n else if (is.keyboardEvent(input) && input.key === 'Escape') {\n show = false;\n }\n else if (is.event(input)) {\n // If Plyr is in a shadowDOM, the event target is set to the component, instead of the\n // Element in the shadowDOM. The path, if available, is complete.\n const target = is.function(input.composedPath) ? input.composedPath()[0] : input.target;\n const isMenuItem = popup.contains(target);\n\n // If the click was inside the menu or if the click\n // wasn't the button or menu item and we're trying to\n // show the menu (a doc click shouldn't show the menu)\n if (isMenuItem || (!isMenuItem && input.target !== button && show)) {\n return;\n }\n }\n\n // Set button attributes\n button.setAttribute('aria-expanded', show);\n\n // Show the actual popup\n toggleHidden(popup, !show);\n\n // Add class hook\n toggleClass(this.elements.container, this.config.classNames.menu.open, show);\n\n // Focus the first item if key interaction\n if (show && is.keyboardEvent(input)) {\n controls.focusFirstMenuItem.call(this, null, true);\n }\n else if (!show && !hidden) {\n // If closing, re-focus the button\n setFocus.call(this, button, is.keyboardEvent(input));\n }\n },\n\n // Get the natural size of a menu panel\n getMenuSize(tab) {\n const clone = tab.cloneNode(true);\n clone.style.position = 'absolute';\n clone.style.opacity = 0;\n clone.removeAttribute('hidden');\n\n // Append to parent so we get the \"real\" size\n tab.parentNode.appendChild(clone);\n\n // Get the sizes before we remove\n const width = clone.scrollWidth;\n const height = clone.scrollHeight;\n\n // Remove from the DOM\n removeElement(clone);\n\n return {\n width,\n height,\n };\n },\n\n // Show a panel in the menu\n showMenuPanel(type = '', focusVisible = false) {\n const target = this.elements.container.querySelector(`#plyr-settings-${this.id}-${type}`);\n\n // Nothing to show, bail\n if (!is.element(target)) {\n return;\n }\n\n // Hide all other panels\n const container = target.parentNode;\n const current = Array.from(container.children).find(node => !node.hidden);\n\n // If we can do fancy animations, we'll animate the height/width\n if (support.transitions && !support.reducedMotion) {\n // Set the current width as a base\n container.style.width = `${current.scrollWidth}px`;\n container.style.height = `${current.scrollHeight}px`;\n\n // Get potential sizes\n const size = controls.getMenuSize.call(this, target);\n\n // Restore auto height/width\n const restore = (event) => {\n // We're only bothered about height and width on the container\n if (event.target !== container || !['width', 'height'].includes(event.propertyName)) {\n return;\n }\n\n // Revert back to auto\n container.style.width = '';\n container.style.height = '';\n\n // Only listen once\n off.call(this, container, transitionEndEvent, restore);\n };\n\n // Listen for the transition finishing and restore auto height/width\n on.call(this, container, transitionEndEvent, restore);\n\n // Set dimensions to target\n container.style.width = `${size.width}px`;\n container.style.height = `${size.height}px`;\n }\n\n // Set attributes on current tab\n toggleHidden(current, true);\n\n // Set attributes on target\n toggleHidden(target, false);\n\n // Focus the first item\n controls.focusFirstMenuItem.call(this, target, focusVisible);\n },\n\n // Set the download URL\n setDownloadUrl() {\n const button = this.elements.buttons.download;\n\n // Bail if no button\n if (!is.element(button)) {\n return;\n }\n\n // Set attribute\n button.setAttribute('href', this.download);\n },\n\n // Build the default HTML\n create(data) {\n const {\n bindMenuItemShortcuts,\n createButton,\n createProgress,\n createRange,\n createTime,\n setQualityMenu,\n setSpeedMenu,\n showMenuPanel,\n } = controls;\n this.elements.controls = null;\n\n // Larger overlaid play button\n if (is.array(this.config.controls) && this.config.controls.includes('play-large')) {\n this.elements.container.appendChild(createButton.call(this, 'play-large'));\n }\n\n // Create the container\n const container = createElement('div', getAttributesFromSelector(this.config.selectors.controls.wrapper));\n this.elements.controls = container;\n\n // Default item attributes\n const defaultAttributes = { class: 'plyr__controls__item' };\n\n // Loop through controls in order\n dedupe(is.array(this.config.controls) ? this.config.controls : []).forEach((control) => {\n // Restart button\n if (control === 'restart') {\n container.appendChild(createButton.call(this, 'restart', defaultAttributes));\n }\n\n // Rewind button\n if (control === 'rewind') {\n container.appendChild(createButton.call(this, 'rewind', defaultAttributes));\n }\n\n // Play/Pause button\n if (control === 'play') {\n container.appendChild(createButton.call(this, 'play', defaultAttributes));\n }\n\n // Fast forward button\n if (control === 'fast-forward') {\n container.appendChild(createButton.call(this, 'fast-forward', defaultAttributes));\n }\n\n // Progress\n if (control === 'progress') {\n const progressContainer = createElement('div', {\n class: `${defaultAttributes.class} plyr__progress__container`,\n });\n\n const progress = createElement('div', getAttributesFromSelector(this.config.selectors.progress));\n\n // Seek range slider\n progress.appendChild(\n createRange.call(this, 'seek', {\n id: `plyr-seek-${data.id}`,\n }),\n );\n\n // Buffer progress\n progress.appendChild(createProgress.call(this, 'buffer'));\n\n // TODO: Add loop display indicator\n\n // Seek tooltip\n if (this.config.tooltips.seek) {\n const tooltip = createElement(\n 'span',\n {\n class: this.config.classNames.tooltip,\n },\n '00:00',\n );\n\n progress.appendChild(tooltip);\n this.elements.display.seekTooltip = tooltip;\n }\n\n this.elements.progress = progress;\n progressContainer.appendChild(this.elements.progress);\n container.appendChild(progressContainer);\n }\n\n // Media current time display\n if (control === 'current-time') {\n container.appendChild(createTime.call(this, 'currentTime', defaultAttributes));\n }\n\n // Media duration display\n if (control === 'duration') {\n container.appendChild(createTime.call(this, 'duration', defaultAttributes));\n }\n\n // Volume controls\n if (control === 'mute' || control === 'volume') {\n let { volume } = this.elements;\n\n // Create the volume container if needed\n if (!is.element(volume) || !container.contains(volume)) {\n volume = createElement(\n 'div',\n extend({}, defaultAttributes, {\n class: `${defaultAttributes.class} plyr__volume`.trim(),\n }),\n );\n\n this.elements.volume = volume;\n\n container.appendChild(volume);\n }\n\n // Toggle mute button\n if (control === 'mute') {\n volume.appendChild(createButton.call(this, 'mute'));\n }\n\n // Volume range control\n // Ignored on iOS as it's handled globally\n // https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html\n if (control === 'volume' && !browser.isIos && !browser.isIPadOS) {\n // Set the attributes\n const attributes = {\n max: 1,\n step: 0.05,\n value: this.config.volume,\n };\n\n // Create the volume range slider\n volume.appendChild(\n createRange.call(\n this,\n 'volume',\n extend(attributes, {\n id: `plyr-volume-${data.id}`,\n }),\n ),\n );\n }\n }\n\n // Toggle captions button\n if (control === 'captions') {\n container.appendChild(createButton.call(this, 'captions', defaultAttributes));\n }\n\n // Settings button / menu\n if (control === 'settings' && !is.empty(this.config.settings)) {\n const wrapper = createElement(\n 'div',\n extend({}, defaultAttributes, {\n class: `${defaultAttributes.class} plyr__menu`.trim(),\n hidden: '',\n }),\n );\n\n wrapper.appendChild(\n createButton.call(this, 'settings', {\n 'aria-haspopup': true,\n 'aria-controls': `plyr-settings-${data.id}`,\n 'aria-expanded': false,\n }),\n );\n\n const popup = createElement('div', {\n class: 'plyr__menu__container',\n id: `plyr-settings-${data.id}`,\n hidden: '',\n });\n\n const inner = createElement('div');\n\n const home = createElement('div', {\n id: `plyr-settings-${data.id}-home`,\n });\n\n // Create the menu\n const menu = createElement('div', {\n role: 'menu',\n });\n\n home.appendChild(menu);\n inner.appendChild(home);\n this.elements.settings.panels.home = home;\n\n // Build the menu items\n this.config.settings.forEach((type) => {\n // TODO: bundle this with the createMenuItem helper and bindings\n const menuItem = createElement(\n 'button',\n extend(getAttributesFromSelector(this.config.selectors.buttons.settings), {\n 'type': 'button',\n 'class': `${this.config.classNames.control} ${this.config.classNames.control}--forward`,\n 'role': 'menuitem',\n 'aria-haspopup': true,\n 'hidden': '',\n }),\n );\n\n // Bind menu shortcuts for keyboard users\n bindMenuItemShortcuts.call(this, menuItem, type);\n\n // Show menu on click\n on.call(this, menuItem, 'click', () => {\n showMenuPanel.call(this, type, false);\n });\n\n const flex = createElement('span', null, i18n.get(type, this.config));\n\n const value = createElement('span', {\n class: this.config.classNames.menu.value,\n });\n\n // Speed contains HTML entities\n value.innerHTML = data[type];\n\n flex.appendChild(value);\n menuItem.appendChild(flex);\n menu.appendChild(menuItem);\n\n // Build the panes\n const pane = createElement('div', {\n id: `plyr-settings-${data.id}-${type}`,\n hidden: '',\n });\n\n // Back button\n const backButton = createElement('button', {\n type: 'button',\n class: `${this.config.classNames.control} ${this.config.classNames.control}--back`,\n });\n\n // Visible label\n backButton.appendChild(\n createElement(\n 'span',\n {\n 'aria-hidden': true,\n },\n i18n.get(type, this.config),\n ),\n );\n\n // Screen reader label\n backButton.appendChild(\n createElement(\n 'span',\n {\n class: this.config.classNames.hidden,\n },\n i18n.get('menuBack', this.config),\n ),\n );\n\n // Go back via keyboard\n on.call(\n this,\n pane,\n 'keydown',\n (event) => {\n if (event.key !== 'ArrowLeft') return;\n\n // Prevent seek\n event.preventDefault();\n event.stopPropagation();\n\n // Show the respective menu\n showMenuPanel.call(this, 'home', true);\n },\n false,\n );\n\n // Go back via button click\n on.call(this, backButton, 'click', () => {\n showMenuPanel.call(this, 'home', false);\n });\n\n // Add to pane\n pane.appendChild(backButton);\n\n // Menu\n pane.appendChild(\n createElement('div', {\n role: 'menu',\n }),\n );\n\n inner.appendChild(pane);\n\n this.elements.settings.buttons[type] = menuItem;\n this.elements.settings.panels[type] = pane;\n });\n\n popup.appendChild(inner);\n wrapper.appendChild(popup);\n container.appendChild(wrapper);\n\n this.elements.settings.popup = popup;\n this.elements.settings.menu = wrapper;\n }\n\n // Picture in picture button\n if (control === 'pip' && support.pip) {\n container.appendChild(createButton.call(this, 'pip', defaultAttributes));\n }\n\n // Airplay button\n if (control === 'airplay' && support.airplay) {\n container.appendChild(createButton.call(this, 'airplay', defaultAttributes));\n }\n\n // Download button\n if (control === 'download') {\n const attributes = extend({}, defaultAttributes, {\n element: 'a',\n href: this.download,\n target: '_blank',\n });\n\n // Set download attribute for HTML5 only\n if (this.isHTML5) {\n attributes.download = '';\n }\n\n const { download } = this.config.urls;\n\n if (!is.url(download) && this.isEmbed) {\n extend(attributes, {\n icon: `logo-${this.provider}`,\n label: this.provider,\n });\n }\n\n container.appendChild(createButton.call(this, 'download', attributes));\n }\n\n // Toggle fullscreen button\n if (control === 'fullscreen') {\n container.appendChild(createButton.call(this, 'fullscreen', defaultAttributes));\n }\n });\n\n // Set available quality levels\n if (this.isHTML5) {\n setQualityMenu.call(this, html5.getQualityOptions.call(this));\n }\n\n setSpeedMenu.call(this);\n\n return container;\n },\n\n // Insert controls\n inject() {\n // Sprite\n if (this.config.loadSprite) {\n const icon = controls.getIconUrl.call(this);\n\n // Only load external sprite using AJAX\n if (icon.cors) {\n loadSprite(icon.url, 'sprite-plyr');\n }\n }\n\n // Create a unique ID\n this.id = Math.floor(Math.random() * 10000);\n\n // Null by default\n let container = null;\n this.elements.controls = null;\n\n // Set template properties\n const props = {\n id: this.id,\n seektime: this.config.seekTime,\n title: this.config.title,\n };\n let update = true;\n\n // If function, run it and use output\n if (is.function(this.config.controls)) {\n this.config.controls = this.config.controls.call(this, props);\n }\n\n // Convert falsy controls to empty array (primarily for empty strings)\n if (!this.config.controls) {\n this.config.controls = [];\n }\n\n if (is.element(this.config.controls) || is.string(this.config.controls)) {\n // HTMLElement or Non-empty string passed as the option\n container = this.config.controls;\n }\n else {\n // Create controls\n container = controls.create.call(this, {\n id: this.id,\n seektime: this.config.seekTime,\n speed: this.speed,\n quality: this.quality,\n captions: captions.getLabel.call(this),\n // TODO: Looping\n // loop: 'None',\n });\n update = false;\n }\n\n // Replace props with their value\n const replace = (input) => {\n let result = input;\n\n Object.entries(props).forEach(([key, value]) => {\n result = replaceAll(result, `{${key}}`, value);\n });\n\n return result;\n };\n\n // Update markup\n if (update) {\n if (is.string(this.config.controls)) {\n container = replace(container);\n }\n }\n\n // Controls container\n let target;\n\n // Inject to custom location\n if (is.string(this.config.selectors.controls.container)) {\n target = document.querySelector(this.config.selectors.controls.container);\n }\n\n // Inject into the container by default\n if (!is.element(target)) {\n target = this.elements.container;\n }\n\n // Inject controls HTML (needs to be before captions, hence \"afterbegin\")\n const insertMethod = is.element(container) ? 'insertAdjacentElement' : 'insertAdjacentHTML';\n target[insertMethod]('afterbegin', container);\n\n // Find the elements if need be\n if (!is.element(this.elements.controls)) {\n controls.findElements.call(this);\n }\n\n // Add pressed property to buttons\n if (!is.empty(this.elements.buttons)) {\n const addProperty = (button) => {\n const className = this.config.classNames.controlPressed;\n button.setAttribute('aria-pressed', 'false');\n\n Object.defineProperty(button, 'pressed', {\n configurable: true,\n enumerable: true,\n get() {\n return hasClass(button, className);\n },\n set(pressed = false) {\n toggleClass(button, className, pressed);\n button.setAttribute('aria-pressed', pressed ? 'true' : 'false');\n },\n });\n };\n\n // Toggle classname when pressed property is set\n Object.values(this.elements.buttons)\n .filter(Boolean)\n .forEach((button) => {\n if (is.array(button) || is.nodeList(button)) {\n Array.from(button).filter(Boolean).forEach(addProperty);\n }\n else {\n addProperty(button);\n }\n });\n }\n\n // Edge sometimes doesn't finish the paint so force a repaint\n if (browser.isEdge) {\n repaint(target);\n }\n\n // Setup tooltips\n if (this.config.tooltips.controls) {\n const { classNames, selectors } = this.config;\n const selector = `${selectors.controls.wrapper} ${selectors.labels} .${classNames.hidden}`;\n const labels = getElements.call(this, selector);\n\n Array.from(labels).forEach((label) => {\n toggleClass(label, this.config.classNames.hidden, false);\n toggleClass(label, this.config.classNames.tooltip, true);\n });\n }\n },\n\n // Set media metadata\n setMediaMetadata() {\n try {\n if ('mediaSession' in navigator) {\n navigator.mediaSession.metadata = new window.MediaMetadata({\n title: this.config.mediaMetadata.title,\n artist: this.config.mediaMetadata.artist,\n album: this.config.mediaMetadata.album,\n artwork: this.config.mediaMetadata.artwork,\n });\n }\n }\n catch {\n // Do nothing\n }\n },\n\n // Add markers\n setMarkers() {\n if (!this.duration || this.elements.markers) return;\n\n // Get valid points\n const points = this.config.markers?.points?.filter(({ time }) => time > 0 && time < this.duration);\n if (!points?.length) return;\n\n const containerFragment = document.createDocumentFragment();\n const pointsFragment = document.createDocumentFragment();\n let tipElement = null;\n const tipVisible = `${this.config.classNames.tooltip}--visible`;\n const toggleTip = show => toggleClass(tipElement, tipVisible, show);\n\n // Inject markers to progress container\n points.forEach((point) => {\n const markerElement = createElement(\n 'span',\n {\n class: this.config.classNames.marker,\n },\n '',\n );\n\n const left = `${(point.time / this.duration) * 100}%`;\n\n if (tipElement) {\n // Show on hover\n markerElement.addEventListener('mouseenter', () => {\n if (point.label) return;\n tipElement.style.left = left;\n tipElement.innerHTML = point.label;\n toggleTip(true);\n });\n\n // Hide on leave\n markerElement.addEventListener('mouseleave', () => {\n toggleTip(false);\n });\n }\n\n markerElement.addEventListener('click', () => {\n this.currentTime = point.time;\n });\n\n markerElement.style.left = left;\n pointsFragment.appendChild(markerElement);\n });\n\n containerFragment.appendChild(pointsFragment);\n\n // Inject a tooltip if needed\n if (!this.config.tooltips.seek) {\n tipElement = createElement(\n 'span',\n {\n class: this.config.classNames.tooltip,\n },\n '',\n );\n\n containerFragment.appendChild(tipElement);\n }\n\n this.elements.markers = {\n points: pointsFragment,\n tip: tipElement,\n };\n\n this.elements.progress.appendChild(containerFragment);\n },\n};\n\nexport default controls;\n","// ==========================================================================\n// URL utils\n// ==========================================================================\n\nimport is from './is';\n\n/**\n * Parse a string to a URL object\n * @param {string} input - the URL to be parsed\n * @param {boolean} safe - failsafe parsing\n */\nexport function parseUrl(input, safe = true) {\n let url = input;\n\n if (safe) {\n const parser = document.createElement('a');\n parser.href = url;\n url = parser.href;\n }\n\n try {\n return new URL(url);\n }\n catch {\n return null;\n }\n}\n\n// Convert object to URLSearchParams\nexport function buildUrlParams(input) {\n const params = new URLSearchParams();\n\n if (is.object(input)) {\n Object.entries(input).forEach(([key, value]) => {\n params.set(key, value);\n });\n }\n\n return params;\n}\n","// ==========================================================================\n// Plyr Captions\n// TODO: Create as class\n// ==========================================================================\n\nimport controls from './controls';\nimport support from './support';\nimport { dedupe } from './utils/arrays';\nimport browser from './utils/browser';\nimport {\n createElement,\n emptyElement,\n getAttributesFromSelector,\n insertAfter,\n removeElement,\n toggleClass,\n} from './utils/elements';\nimport { on, triggerEvent } from './utils/events';\nimport fetch from './utils/fetch';\nimport i18n from './utils/i18n';\nimport is from './utils/is';\nimport { getHTML } from './utils/strings';\nimport { parseUrl } from './utils/urls';\n\nconst captions = {\n // Setup captions\n setup() {\n // Requires UI support\n if (!this.supported.ui) {\n return;\n }\n\n // Only Vimeo and HTML5 video supported at this point\n if (!this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks)) {\n // Clear menu and hide\n if (\n is.array(this.config.controls)\n && this.config.controls.includes('settings')\n && this.config.settings.includes('captions')\n ) {\n controls.setCaptionsMenu.call(this);\n }\n\n return;\n }\n\n // Inject the container\n if (!is.element(this.elements.captions)) {\n this.elements.captions = createElement('div', getAttributesFromSelector(this.config.selectors.captions));\n this.elements.captions.setAttribute('dir', 'auto');\n\n insertAfter(this.elements.captions, this.elements.wrapper);\n }\n\n // Fix IE captions if CORS is used\n // Fetch captions and inject as blobs instead (data URIs not supported!)\n if (browser.isIE && window.URL) {\n const elements = this.media.querySelectorAll('track');\n\n Array.from(elements).forEach((track) => {\n const src = track.getAttribute('src');\n const url = parseUrl(src);\n\n if (\n url !== null\n && url.hostname !== window.location.href.hostname\n && ['http:', 'https:'].includes(url.protocol)\n ) {\n fetch(src, 'blob')\n .then((blob) => {\n track.setAttribute('src', window.URL.createObjectURL(blob));\n })\n .catch(() => {\n removeElement(track);\n });\n }\n });\n }\n\n // Get and set initial data\n // The \"preferred\" options are not realized unless / until the wanted language has a match\n // * languages: Array of user's browser languages.\n // * language: The language preferred by user settings or config\n // * active: The state preferred by user settings or config\n // * toggled: The real captions state\n\n const browserLanguages = navigator.languages || [navigator.language || navigator.userLanguage || 'en'];\n const languages = dedupe(browserLanguages.map(language => language.split('-')[0]));\n let language = (this.storage.get('language') || this.captions.language || this.config.captions.language || 'auto').toLowerCase();\n\n // Use first browser language when language is 'auto'\n if (language === 'auto') {\n [language] = languages;\n }\n\n let active = this.storage.get('captions') || this.captions.active;\n if (!is.boolean(active)) {\n ({ active } = this.config.captions);\n }\n\n Object.assign(this.captions, {\n toggled: false,\n active,\n language,\n languages,\n });\n\n // Watch changes to textTracks and update captions menu\n if (this.isHTML5) {\n const trackEvents = this.config.captions.update ? 'addtrack removetrack' : 'removetrack';\n on.call(this, this.media.textTracks, trackEvents, captions.update.bind(this));\n }\n\n // Update available languages in list next tick (the event must not be triggered before the listeners)\n setTimeout(captions.update.bind(this), 0);\n },\n\n // Update available language options in settings based on tracks\n update() {\n const tracks = captions.getTracks.call(this, true);\n // Get the wanted language\n const { active, language, meta, currentTrackNode } = this.captions;\n const languageExists = Boolean(tracks.find(track => track.language === language));\n\n // Handle tracks (add event listener and \"pseudo\"-default)\n if (this.isHTML5 && this.isVideo) {\n tracks\n .filter(track => !meta.get(track))\n .forEach((track) => {\n this.debug.log('Track added', track);\n\n // Attempt to store if the original dom element was \"default\"\n meta.set(track, {\n default: track.mode === 'showing',\n });\n\n // Turn off native caption rendering to avoid double captions\n // Note: mode='hidden' forces a track to download. To ensure every track\n // isn't downloaded at once, only 'showing' tracks should be reassigned\n\n if (track.mode === 'showing') {\n track.mode = 'hidden';\n }\n\n // Add event listener for cue changes\n on.call(this, track, 'cuechange', () => captions.updateCues.call(this));\n });\n }\n\n // Update language first time it matches, or if the previous matching track was removed\n if ((languageExists && this.language !== language) || !tracks.includes(currentTrackNode)) {\n captions.setLanguage.call(this, language);\n captions.toggle.call(this, active && languageExists);\n }\n\n // Enable or disable captions based on track length\n if (this.elements) {\n toggleClass(this.elements.container, this.config.classNames.captions.enabled, !is.empty(tracks));\n }\n\n // Update available languages in list\n if (\n is.array(this.config.controls)\n && this.config.controls.includes('settings')\n && this.config.settings.includes('captions')\n ) {\n controls.setCaptionsMenu.call(this);\n }\n },\n\n // Toggle captions display\n // Used internally for the toggleCaptions method, with the passive option forced to false\n toggle(input, passive = true) {\n // If there's no full support\n if (!this.supported.ui) {\n return;\n }\n\n const { toggled } = this.captions; // Current state\n const activeClass = this.config.classNames.captions.active;\n // Get the next state\n // If the method is called without parameter, toggle based on current value\n const active = is.nullOrUndefined(input) ? !toggled : input;\n\n // Update state and trigger event\n if (active !== toggled) {\n // When passive, don't override user preferences\n if (!passive) {\n this.captions.active = active;\n this.storage.set({ captions: active });\n }\n\n // Force language if the call isn't passive and there is no matching language to toggle to\n if (!this.language && active && !passive) {\n const tracks = captions.getTracks.call(this);\n const track = captions.findTrack.call(this, [this.captions.language, ...this.captions.languages], true);\n\n // Override user preferences to avoid switching languages if a matching track is added\n this.captions.language = track.language;\n\n // Set caption, but don't store in localStorage as user preference\n captions.set.call(this, tracks.indexOf(track));\n return;\n }\n\n // Toggle button if it's enabled\n if (this.elements.buttons.captions) {\n this.elements.buttons.captions.pressed = active;\n }\n\n // Add class hook\n toggleClass(this.elements.container, activeClass, active);\n\n this.captions.toggled = active;\n\n // Update settings menu\n controls.updateSetting.call(this, 'captions');\n\n // Trigger event (not used internally)\n triggerEvent.call(this, this.media, active ? 'captionsenabled' : 'captionsdisabled');\n }\n\n // Wait for the call stack to clear before setting mode='hidden'\n // on the active track - forcing the browser to download it\n setTimeout(() => {\n if (active && this.captions.toggled) {\n this.captions.currentTrackNode.mode = 'hidden';\n }\n });\n },\n\n // Set captions by track index\n // Used internally for the currentTrack setter with the passive option forced to false\n set(index, passive = true) {\n const tracks = captions.getTracks.call(this);\n\n // Disable captions if setting to -1\n if (index === -1) {\n captions.toggle.call(this, false, passive);\n return;\n }\n\n if (!is.number(index)) {\n this.debug.warn('Invalid caption argument', index);\n return;\n }\n\n if (!(index in tracks)) {\n this.debug.warn('Track not found', index);\n return;\n }\n\n if (this.captions.currentTrack !== index) {\n this.captions.currentTrack = index;\n const track = tracks[index];\n const { language } = track || {};\n\n // Store reference to node for invalidation on remove\n this.captions.currentTrackNode = track;\n\n // Update settings menu\n controls.updateSetting.call(this, 'captions');\n\n // When passive, don't override user preferences\n if (!passive) {\n this.captions.language = language;\n this.storage.set({ language });\n }\n\n // Handle Vimeo captions\n if (this.isVimeo) {\n this.embed.enableTextTrack(language);\n }\n\n // Trigger event\n triggerEvent.call(this, this.media, 'languagechange');\n }\n\n // Show captions\n captions.toggle.call(this, true, passive);\n\n if (this.isHTML5 && this.isVideo) {\n // If we change the active track while a cue is already displayed we need to update it\n captions.updateCues.call(this);\n }\n },\n\n // Set captions by language\n // Used internally for the language setter with the passive option forced to false\n setLanguage(input, passive = true) {\n if (!is.string(input)) {\n this.debug.warn('Invalid language argument', input);\n return;\n }\n // Normalize\n const language = input.toLowerCase();\n this.captions.language = language;\n\n // Set currentTrack\n const tracks = captions.getTracks.call(this);\n const track = captions.findTrack.call(this, [language]);\n captions.set.call(this, tracks.indexOf(track), passive);\n },\n\n // Get current valid caption tracks\n // If update is false it will also ignore tracks without metadata\n // This is used to \"freeze\" the language options when captions.update is false\n getTracks(update = false) {\n // Handle media or textTracks missing or null\n const tracks = Array.from((this.media || {}).textTracks || []);\n // For HTML5, use cache instead of current tracks when it exists (if captions.update is false)\n // Filter out removed tracks and tracks that aren't captions/subtitles (for example metadata)\n return tracks\n .filter(track => !this.isHTML5 || update || this.captions.meta.has(track))\n .filter(track => ['captions', 'subtitles'].includes(track.kind));\n },\n\n // Match tracks based on languages and get the first\n findTrack(languages, force = false) {\n const tracks = captions.getTracks.call(this);\n const sortIsDefault = track => Number((this.captions.meta.get(track) || {}).default);\n const sorted = Array.from(tracks).sort((a, b) => sortIsDefault(b) - sortIsDefault(a));\n let track;\n\n languages.every((language) => {\n track = sorted.find(t => t.language === language);\n return !track; // Break iteration if there is a match\n });\n\n // If no match is found but is required, get first\n return track || (force ? sorted[0] : undefined);\n },\n\n // Get the current track\n getCurrentTrack() {\n return captions.getTracks.call(this)[this.currentTrack];\n },\n\n // Get UI label for track\n getLabel(track) {\n let currentTrack = track;\n\n if (!is.track(currentTrack) && support.textTracks && this.captions.toggled) {\n currentTrack = captions.getCurrentTrack.call(this);\n }\n\n if (is.track(currentTrack)) {\n if (!is.empty(currentTrack.label)) {\n return currentTrack.label;\n }\n\n if (!is.empty(currentTrack.language)) {\n return track.language.toUpperCase();\n }\n\n return i18n.get('enabled', this.config);\n }\n\n return i18n.get('disabled', this.config);\n },\n\n // Update captions using current track's active cues\n // Also optional array argument in case there isn't any track (ex: vimeo)\n updateCues(input) {\n // Requires UI\n if (!this.supported.ui) {\n return;\n }\n\n if (!is.element(this.elements.captions)) {\n this.debug.warn('No captions element to render to');\n return;\n }\n\n // Only accept array or empty input\n if (!is.nullOrUndefined(input) && !Array.isArray(input)) {\n this.debug.warn('updateCues: Invalid input', input);\n return;\n }\n\n let cues = input;\n\n // Get cues from track\n if (!cues) {\n const track = captions.getCurrentTrack.call(this);\n\n cues = Array.from((track || {}).activeCues || [])\n .map(cue => cue.getCueAsHTML())\n .map(getHTML);\n }\n\n // Set new caption text\n const content = cues.map(cueText => cueText.trim()).join('\\n');\n const changed = content !== this.elements.captions.innerHTML;\n\n if (changed) {\n // Empty the container and create a new child element\n emptyElement(this.elements.captions);\n const caption = createElement('span', getAttributesFromSelector(this.config.selectors.caption));\n caption.innerHTML = content;\n this.elements.captions.appendChild(caption);\n\n // Trigger event\n triggerEvent.call(this, this.media, 'cuechange');\n }\n },\n};\n\nexport default captions;\n","// ==========================================================================\n// Plyr default config\n// ==========================================================================\n\nconst defaults = {\n // Disable\n enabled: true,\n\n // Custom media title\n title: '',\n\n // Logging to console\n debug: false,\n\n // Auto play (if supported)\n autoplay: false,\n\n // Only allow one media playing at once (vimeo only)\n autopause: true,\n\n // Allow inline playback on iOS\n playsinline: true,\n\n // Default time to skip when rewind/fast forward\n seekTime: 10,\n\n // Default volume\n volume: 1,\n muted: false,\n\n // Pass a custom duration\n duration: null,\n\n // Display the media duration on load in the current time position\n // If you have opted to display both duration and currentTime, this is ignored\n displayDuration: true,\n\n // Invert the current time to be a countdown\n invertTime: true,\n\n // Clicking the currentTime inverts it's value to show time left rather than elapsed\n toggleInvert: true,\n\n // Force an aspect ratio\n // The format must be `'w:h'` (e.g. `'16:9'`)\n ratio: null,\n\n // Click video container to play/pause\n clickToPlay: true,\n\n // Auto hide the controls\n hideControls: true,\n\n // Reset to start when playback ended\n resetOnEnd: false,\n\n // Disable the standard context menu\n disableContextMenu: true,\n\n // Sprite (for icons)\n loadSprite: true,\n iconPrefix: 'plyr',\n iconUrl: 'https://cdn.plyr.io/3.8.3/plyr.svg',\n\n // Blank video (used to prevent errors on source change)\n blankVideo: 'https://cdn.plyr.io/static/blank.mp4',\n\n // Quality default\n quality: {\n default: 576,\n // The options to display in the UI, if available for the source media\n options: [4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240],\n forced: false,\n onChange: null,\n },\n\n // Set loops\n loop: {\n active: false,\n // start: null,\n // end: null,\n },\n\n // Speed default and options to display\n speed: {\n selected: 1,\n // The options to display in the UI, if available for the source media (e.g. Vimeo and YouTube only support 0.5x-4x)\n options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4],\n },\n\n // Keyboard shortcut settings\n keyboard: {\n focused: true,\n global: false,\n },\n\n // Display tooltips\n tooltips: {\n controls: false,\n seek: true,\n },\n\n // Captions settings\n captions: {\n active: false,\n language: 'auto',\n // Listen to new tracks added after Plyr is initialized.\n // This is needed for streaming captions, but may result in unselectable options\n update: false,\n },\n\n // Fullscreen settings\n fullscreen: {\n enabled: true, // Allow fullscreen?\n fallback: true, // Fallback using full viewport/window\n iosNative: false, // Use the native fullscreen in iOS (disables custom controls)\n // Selector for the fullscreen container so contextual / non-player content can remain visible in fullscreen mode\n // Non-ancestors of the player element will be ignored\n // container: null, // defaults to the player element\n },\n\n // Local storage\n storage: {\n enabled: true,\n key: 'plyr',\n },\n\n // Default controls\n controls: [\n 'play-large',\n // 'restart',\n // 'rewind',\n 'play',\n // 'fast-forward',\n 'progress',\n 'current-time',\n // 'duration',\n 'mute',\n 'volume',\n 'captions',\n 'settings',\n 'pip',\n 'airplay',\n // 'download',\n 'fullscreen',\n ],\n settings: ['captions', 'quality', 'speed'],\n\n // Localisation\n i18n: {\n restart: 'Restart',\n rewind: 'Rewind {seektime}s',\n play: 'Play',\n pause: 'Pause',\n fastForward: 'Forward {seektime}s',\n seek: 'Seek',\n seekLabel: '{currentTime} of {duration}',\n played: 'Played',\n buffered: 'Buffered',\n currentTime: 'Current time',\n duration: 'Duration',\n volume: 'Volume',\n mute: 'Mute',\n unmute: 'Unmute',\n enableCaptions: 'Enable captions',\n disableCaptions: 'Disable captions',\n download: 'Download',\n enterFullscreen: 'Enter fullscreen',\n exitFullscreen: 'Exit fullscreen',\n frameTitle: 'Player for {title}',\n captions: 'Captions',\n settings: 'Settings',\n pip: 'PIP',\n menuBack: 'Go back to previous menu',\n speed: 'Speed',\n normal: 'Normal',\n quality: 'Quality',\n loop: 'Loop',\n start: 'Start',\n end: 'End',\n all: 'All',\n reset: 'Reset',\n disabled: 'Disabled',\n enabled: 'Enabled',\n advertisement: 'Ad',\n qualityBadge: {\n 2160: '4K',\n 1440: 'HD',\n 1080: 'HD',\n 720: 'HD',\n 576: 'SD',\n 480: 'SD',\n },\n },\n\n // URLs\n urls: {\n download: null,\n vimeo: {\n sdk: 'https://player.vimeo.com/api/player.js',\n iframe: 'https://player.vimeo.com/video/{0}?{1}',\n api: 'https://vimeo.com/api/oembed.json?url={0}',\n },\n youtube: {\n sdk: 'https://www.youtube.com/iframe_api',\n api: 'https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}',\n },\n googleIMA: {\n sdk: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js',\n },\n },\n\n // Custom control listeners\n listeners: {\n seek: null,\n play: null,\n pause: null,\n restart: null,\n rewind: null,\n fastForward: null,\n mute: null,\n volume: null,\n captions: null,\n download: null,\n fullscreen: null,\n pip: null,\n airplay: null,\n speed: null,\n quality: null,\n loop: null,\n language: null,\n },\n\n // Events to watch and bubble\n events: [\n // Events to watch on HTML5 media elements and bubble\n // https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events\n 'ended',\n 'progress',\n 'stalled',\n 'playing',\n 'waiting',\n 'canplay',\n 'canplaythrough',\n 'loadstart',\n 'loadeddata',\n 'loadedmetadata',\n 'timeupdate',\n 'volumechange',\n 'play',\n 'pause',\n 'error',\n 'seeking',\n 'seeked',\n 'emptied',\n 'ratechange',\n 'cuechange',\n\n // Custom events\n 'download',\n 'enterfullscreen',\n 'exitfullscreen',\n 'captionsenabled',\n 'captionsdisabled',\n 'languagechange',\n 'controlshidden',\n 'controlsshown',\n 'ready',\n\n // YouTube\n 'statechange',\n\n // Quality\n 'qualitychange',\n\n // Ads\n 'adsloaded',\n 'adscontentpause',\n 'adscontentresume',\n 'adstarted',\n 'adsmidpoint',\n 'adscomplete',\n 'adsallcomplete',\n 'adsimpression',\n 'adsclick',\n ],\n\n // Selectors\n // Change these to match your template if using custom HTML\n selectors: {\n editable: 'input, textarea, select, [contenteditable]',\n container: '.plyr',\n controls: {\n container: null,\n wrapper: '.plyr__controls',\n },\n labels: '[data-plyr]',\n buttons: {\n play: '[data-plyr=\"play\"]',\n pause: '[data-plyr=\"pause\"]',\n restart: '[data-plyr=\"restart\"]',\n rewind: '[data-plyr=\"rewind\"]',\n fastForward: '[data-plyr=\"fast-forward\"]',\n mute: '[data-plyr=\"mute\"]',\n captions: '[data-plyr=\"captions\"]',\n download: '[data-plyr=\"download\"]',\n fullscreen: '[data-plyr=\"fullscreen\"]',\n pip: '[data-plyr=\"pip\"]',\n airplay: '[data-plyr=\"airplay\"]',\n settings: '[data-plyr=\"settings\"]',\n loop: '[data-plyr=\"loop\"]',\n },\n inputs: {\n seek: '[data-plyr=\"seek\"]',\n volume: '[data-plyr=\"volume\"]',\n speed: '[data-plyr=\"speed\"]',\n language: '[data-plyr=\"language\"]',\n quality: '[data-plyr=\"quality\"]',\n },\n display: {\n currentTime: '.plyr__time--current',\n duration: '.plyr__time--duration',\n buffer: '.plyr__progress__buffer',\n loop: '.plyr__progress__loop', // Used later\n volume: '.plyr__volume--display',\n },\n progress: '.plyr__progress',\n captions: '.plyr__captions',\n caption: '.plyr__caption',\n },\n\n // Class hooks added to the player in different states\n classNames: {\n type: 'plyr--{0}',\n provider: 'plyr--{0}',\n video: 'plyr__video-wrapper',\n embed: 'plyr__video-embed',\n videoFixedRatio: 'plyr__video-wrapper--fixed-ratio',\n embedContainer: 'plyr__video-embed__container',\n poster: 'plyr__poster',\n posterEnabled: 'plyr__poster-enabled',\n ads: 'plyr__ads',\n control: 'plyr__control',\n controlPressed: 'plyr__control--pressed',\n playing: 'plyr--playing',\n paused: 'plyr--paused',\n stopped: 'plyr--stopped',\n loading: 'plyr--loading',\n hover: 'plyr--hover',\n tooltip: 'plyr__tooltip',\n cues: 'plyr__cues',\n marker: 'plyr__progress__marker',\n hidden: 'plyr__sr-only',\n hideControls: 'plyr--hide-controls',\n isTouch: 'plyr--is-touch',\n uiSupported: 'plyr--full-ui',\n noTransition: 'plyr--no-transition',\n display: {\n time: 'plyr__time',\n },\n menu: {\n value: 'plyr__menu__value',\n badge: 'plyr__badge',\n open: 'plyr--menu-open',\n },\n captions: {\n enabled: 'plyr--captions-enabled',\n active: 'plyr--captions-active',\n },\n fullscreen: {\n enabled: 'plyr--fullscreen-enabled',\n fallback: 'plyr--fullscreen-fallback',\n },\n pip: {\n supported: 'plyr--pip-supported',\n active: 'plyr--pip-active',\n },\n airplay: {\n supported: 'plyr--airplay-supported',\n active: 'plyr--airplay-active',\n },\n previewThumbnails: {\n // Tooltip thumbs\n thumbContainer: 'plyr__preview-thumb',\n thumbContainerShown: 'plyr__preview-thumb--is-shown',\n imageContainer: 'plyr__preview-thumb__image-container',\n timeContainer: 'plyr__preview-thumb__time-container',\n // Scrubbing\n scrubbingContainer: 'plyr__preview-scrubbing',\n scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown',\n },\n },\n\n // Embed attributes\n attributes: {\n embed: {\n provider: 'data-plyr-provider',\n id: 'data-plyr-embed-id',\n hash: 'data-plyr-embed-hash',\n },\n },\n\n // Advertisements plugin\n // Register for an account here: http://vi.ai/publisher-video-monetization/?aid=plyrio\n ads: {\n enabled: false,\n publisherId: '',\n tagUrl: '',\n },\n\n // Preview Thumbnails plugin\n previewThumbnails: {\n enabled: false,\n src: '',\n withCredentials: false,\n },\n\n // Vimeo plugin\n vimeo: {\n byline: false,\n portrait: false,\n title: false,\n speed: true,\n transparent: false,\n // Custom settings from Plyr\n customControls: true,\n referrerPolicy: null, // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy\n // Whether the owner of the video has a Pro or Business account\n // (which allows us to properly hide controls without CSS hacks, etc)\n premium: false,\n },\n\n // YouTube plugin\n youtube: {\n rel: 0, // No related vids\n showinfo: 0, // Hide info\n iv_load_policy: 3, // Hide annotations\n modestbranding: 1, // Hide logos as much as possible (they still show one in the corner when paused)\n // Custom settings from Plyr\n customControls: true,\n noCookie: false, // Whether to use an alternative version of YouTube without cookies\n },\n\n // Media Metadata\n mediaMetadata: {\n title: '',\n artist: '',\n album: '',\n artwork: [],\n },\n\n // Markers\n markers: {\n enabled: false,\n points: [],\n },\n};\n\nexport default defaults;\n","// ==========================================================================\n// Plyr states\n// ==========================================================================\n\nexport const pip = {\n active: 'picture-in-picture',\n inactive: 'inline',\n};\n\nexport default { pip };\n","// ==========================================================================\n// Plyr supported types and providers\n// ==========================================================================\n\nexport const providers = {\n html5: 'html5',\n youtube: 'youtube',\n vimeo: 'vimeo',\n};\n\nexport const types = {\n audio: 'audio',\n video: 'video',\n};\n\n/**\n * Get provider by URL\n * @param {string} url\n */\nexport function getProviderByUrl(url) {\n // YouTube\n if (/^(?:https?:\\/\\/)?(?:www\\.)?(?:youtube\\.com|youtube-nocookie\\.com|youtu\\.?be)\\/.+$/.test(url)) {\n return providers.youtube;\n }\n\n // Vimeo\n if (/^https?:\\/\\/player.vimeo.com\\/video\\/\\d{0,9}(?=\\b|\\/)/.test(url)) {\n return providers.vimeo;\n }\n\n return null;\n}\n\nexport default { providers, types };\n","// ==========================================================================\n// Console wrapper\n// ==========================================================================\n\nfunction noop() {}\n\nexport default class Console {\n constructor(enabled = false) {\n this.enabled = window.console && enabled;\n\n if (this.enabled) {\n this.log('Debugging enabled');\n }\n }\n\n get log() {\n // eslint-disable-next-line no-console\n return this.enabled ? Function.prototype.bind.call(console.log, console) : noop;\n }\n\n get warn() {\n return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop;\n }\n\n get error() {\n return this.enabled ? Function.prototype.bind.call(console.error, console) : noop;\n }\n}\n","// ==========================================================================\n// Fullscreen wrapper\n// https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API#prefixing\n// https://webkit.org/blog/7929/designing-websites-for-iphone-x/\n// ==========================================================================\n\nimport browser from './utils/browser';\nimport { closest, getElements, hasClass, toggleClass } from './utils/elements';\nimport { on, triggerEvent } from './utils/events';\nimport is from './utils/is';\nimport { silencePromise } from './utils/promise';\n\nclass Fullscreen {\n constructor(player) {\n // Keep reference to parent\n this.player = player;\n\n // Get prefix\n this.prefix = Fullscreen.prefix;\n this.property = Fullscreen.property;\n\n // Scroll position\n this.scrollPosition = { x: 0, y: 0 };\n\n // Force the use of 'full window/browser' rather than fullscreen\n this.forceFallback = player.config.fullscreen.fallback === 'force';\n\n // Get the fullscreen element\n // Checks container is an ancestor, defaults to null\n this.player.elements.fullscreen\n = player.config.fullscreen.container && closest(this.player.elements.container, player.config.fullscreen.container);\n\n // Register event listeners\n // Handle event (incase user presses escape etc)\n on.call(\n this.player,\n document,\n this.prefix === 'ms' ? 'MSFullscreenChange' : `${this.prefix}fullscreenchange`,\n () => {\n // TODO: Filter for target??\n this.onChange();\n },\n );\n\n // Fullscreen toggle on double click\n on.call(this.player, this.player.elements.container, 'dblclick', (event) => {\n // Ignore double click in controls\n if (is.element(this.player.elements.controls) && this.player.elements.controls.contains(event.target)) {\n return;\n }\n\n this.player.listeners.proxy(event, this.toggle, 'fullscreen');\n });\n\n // Tap focus when in fullscreen\n on.call(this, this.player.elements.container, 'keydown', event => this.trapFocus(event));\n\n // Update the UI\n this.update();\n }\n\n // Determine if native supported\n static get nativeSupported() {\n return !!(\n document.fullscreenEnabled\n || document.webkitFullscreenEnabled\n || document.mozFullScreenEnabled\n || document.msFullscreenEnabled\n );\n }\n\n // If we're actually using native\n get useNative() {\n return Fullscreen.nativeSupported && !this.forceFallback;\n }\n\n // Get the prefix for handlers\n static get prefix() {\n // No prefix\n if (is.function(document.exitFullscreen)) return '';\n\n // Check for fullscreen support by vendor prefix\n let value = '';\n const prefixes = ['webkit', 'moz', 'ms'];\n\n prefixes.some((pre) => {\n if (is.function(document[`${pre}ExitFullscreen`]) || is.function(document[`${pre}CancelFullScreen`])) {\n value = pre;\n return true;\n }\n\n return false;\n });\n\n return value;\n }\n\n static get property() {\n return this.prefix === 'moz' ? 'FullScreen' : 'Fullscreen';\n }\n\n // Determine if fullscreen is supported\n get supported() {\n return [\n // Fullscreen is enabled in config\n this.player.config.fullscreen.enabled,\n // Must be a video\n this.player.isVideo,\n // Either native is supported or fallback enabled\n Fullscreen.nativeSupported || this.player.config.fullscreen.fallback,\n // YouTube has no way to trigger fullscreen, so on devices with no native support, playsinline\n // must be enabled and iosNative fullscreen must be disabled to offer the fullscreen fallback\n !this.player.isYouTube\n || Fullscreen.nativeSupported\n || !browser.isIos\n || (this.player.config.playsinline && !this.player.config.fullscreen.iosNative),\n ].every(Boolean);\n }\n\n // Get active state\n get active() {\n if (!this.supported) return false;\n\n // Fallback using classname\n if (!Fullscreen.nativeSupported || this.forceFallback) {\n return hasClass(this.target, this.player.config.classNames.fullscreen.fallback);\n }\n\n const element = !this.prefix\n ? this.target.getRootNode().fullscreenElement\n : this.target.getRootNode()[`${this.prefix}${this.property}Element`];\n\n return element && element.shadowRoot ? element === this.target.getRootNode().host : element === this.target;\n }\n\n // Get target element\n get target() {\n return browser.isIos && this.player.config.fullscreen.iosNative\n ? this.player.media\n : this.player.elements.fullscreen ?? this.player.elements.container;\n }\n\n onChange = () => {\n if (!this.supported) return;\n\n // Update toggle button\n const button = this.player.elements.buttons.fullscreen;\n if (is.element(button)) {\n button.pressed = this.active;\n }\n\n // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up\n const target = this.target === this.player.media ? this.target : this.player.elements.container;\n // Trigger an event\n triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);\n };\n\n toggleFallback = (toggle = false) => {\n // Store or restore scroll position\n if (toggle) {\n this.scrollPosition = {\n x: window.scrollX ?? 0,\n y: window.scrollY ?? 0,\n };\n }\n else {\n window.scrollTo(this.scrollPosition.x, this.scrollPosition.y);\n }\n\n // Toggle scroll\n document.body.style.overflow = toggle ? 'hidden' : '';\n\n // Toggle class hook\n toggleClass(this.target, this.player.config.classNames.fullscreen.fallback, toggle);\n\n // Force full viewport on iPhone X+\n if (browser.isIos) {\n let viewport = document.head.querySelector('meta[name=\"viewport\"]');\n const property = 'viewport-fit=cover';\n\n // Inject the viewport meta if required\n if (!viewport) {\n viewport = document.createElement('meta');\n viewport.setAttribute('name', 'viewport');\n }\n\n // Check if the property already exists\n const hasProperty = is.string(viewport.content) && viewport.content.includes(property);\n\n if (toggle) {\n this.cleanupViewport = !hasProperty;\n if (!hasProperty) viewport.content += `,${property}`;\n }\n else if (this.cleanupViewport) {\n viewport.content = viewport.content\n .split(',')\n .filter(part => part.trim() !== property)\n .join(',');\n }\n }\n\n // Toggle button and fire events\n this.onChange();\n };\n\n // Trap focus inside container\n trapFocus = (event) => {\n // Bail if iOS/iPadOS, not active, not the tab key\n if (browser.isIos || browser.isIPadOS || !this.active || event.key !== 'Tab') return;\n\n // Get the current focused element\n const focused = document.activeElement;\n const focusable = getElements.call(this.player, 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]');\n const [first] = focusable;\n const last = focusable[focusable.length - 1];\n\n if (focused === last && !event.shiftKey) {\n // Move focus to first element that can be tabbed if Shift isn't used\n first.focus();\n event.preventDefault();\n }\n else if (focused === first && event.shiftKey) {\n // Move focus to last element that can be tabbed if Shift is used\n last.focus();\n event.preventDefault();\n }\n };\n\n // Update UI\n update = () => {\n if (this.supported) {\n let mode;\n\n if (this.forceFallback) mode = 'Fallback (forced)';\n else if (Fullscreen.nativeSupported) mode = 'Native';\n else mode = 'Fallback';\n\n this.player.debug.log(`${mode} fullscreen enabled`);\n }\n else {\n this.player.debug.log('Fullscreen not supported and fallback disabled');\n }\n\n // Add styling hook to show button\n toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.supported);\n };\n\n // Make an element fullscreen\n enter = () => {\n if (!this.supported) return;\n\n // iOS native fullscreen doesn't need the request step\n if (browser.isIos && this.player.config.fullscreen.iosNative) {\n if (this.player.isVimeo) {\n this.player.embed.requestFullscreen();\n }\n else {\n this.target.webkitEnterFullscreen();\n }\n }\n else if (!Fullscreen.nativeSupported || this.forceFallback) {\n this.toggleFallback(true);\n }\n else if (!this.prefix) {\n this.target.requestFullscreen({ navigationUI: 'hide' });\n }\n else if (!is.empty(this.prefix)) {\n this.target[`${this.prefix}Request${this.property}`]();\n }\n };\n\n // Bail from fullscreen\n exit = () => {\n if (!this.supported) return;\n\n // iOS native fullscreen\n if (browser.isIos && this.player.config.fullscreen.iosNative) {\n if (this.player.isVimeo) {\n this.player.embed.exitFullscreen();\n }\n else {\n this.target.webkitEnterFullscreen();\n }\n silencePromise(this.player.play());\n }\n else if (!Fullscreen.nativeSupported || this.forceFallback) {\n this.toggleFallback(false);\n }\n else if (!this.prefix) {\n (document.cancelFullScreen || document.exitFullscreen).call(document);\n }\n else if (!is.empty(this.prefix)) {\n const action = this.prefix === 'moz' ? 'Cancel' : 'Exit';\n document[`${this.prefix}${action}${this.property}`]();\n }\n };\n\n // Toggle state\n toggle = () => {\n if (!this.active) this.enter();\n else this.exit();\n };\n}\n\nexport default Fullscreen;\n","// ==========================================================================\n// Load image avoiding xhr/fetch CORS issues\n// Server status can't be obtained this way unfortunately, so this uses \"naturalWidth\" to determine if the image has loaded\n// By default it checks if it is at least 1px, but you can add a second argument to change this\n// ==========================================================================\n\nexport default function loadImage(src, minWidth = 1) {\n return new Promise((resolve, reject) => {\n const image = new Image();\n\n const handler = () => {\n delete image.onload;\n delete image.onerror;\n (image.naturalWidth >= minWidth ? resolve : reject)(image);\n };\n\n Object.assign(image, { onload: handler, onerror: handler, src });\n });\n}\n","// ==========================================================================\n// Plyr UI\n// ==========================================================================\n\nimport captions from './captions';\nimport controls from './controls';\nimport support from './support';\nimport { getElement, toggleClass } from './utils/elements';\nimport { ready, triggerEvent } from './utils/events';\nimport i18n from './utils/i18n';\nimport is from './utils/is';\nimport loadImage from './utils/load-image';\n\nconst ui = {\n addStyleHook() {\n toggleClass(this.elements.container, this.config.selectors.container.replace('.', ''), true);\n toggleClass(this.elements.container, this.config.classNames.uiSupported, this.supported.ui);\n },\n\n // Toggle native HTML5 media controls\n toggleNativeControls(toggle = false) {\n if (toggle && this.isHTML5) {\n this.media.setAttribute('controls', '');\n }\n else {\n this.media.removeAttribute('controls');\n }\n },\n\n // Setup the UI\n build() {\n // Re-attach media element listeners\n // TODO: Use event bubbling?\n this.listeners.media();\n\n // Don't setup interface if no support\n if (!this.supported.ui) {\n this.debug.warn(`Basic support only for ${this.provider} ${this.type}`);\n\n // Restore native controls\n ui.toggleNativeControls.call(this, true);\n\n // Bail\n return;\n }\n\n // Inject custom controls if not present\n if (!is.element(this.elements.controls)) {\n // Inject custom controls\n controls.inject.call(this);\n\n // Re-attach control listeners\n this.listeners.controls();\n }\n\n // Remove native controls\n ui.toggleNativeControls.call(this);\n\n // Setup captions for HTML5\n if (this.isHTML5) {\n captions.setup.call(this);\n }\n\n // Reset volume\n this.volume = null;\n\n // Reset mute state\n this.muted = null;\n\n // Reset loop state\n this.loop = null;\n\n // Reset quality setting\n this.quality = null;\n\n // Reset speed\n this.speed = null;\n\n // Reset volume display\n controls.updateVolume.call(this);\n\n // Reset time display\n controls.timeUpdate.call(this);\n\n // Reset duration display\n controls.durationUpdate.call(this);\n\n // Update the UI\n ui.checkPlaying.call(this);\n\n // Check for picture-in-picture support\n toggleClass(\n this.elements.container,\n this.config.classNames.pip.supported,\n support.pip && this.isHTML5 && this.isVideo,\n );\n\n // Check for airplay support\n toggleClass(this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5);\n\n // Add touch class\n toggleClass(this.elements.container, this.config.classNames.isTouch, this.touch);\n\n // Ready for API calls\n this.ready = true;\n\n // Ready event at end of execution stack\n setTimeout(() => {\n triggerEvent.call(this, this.media, 'ready');\n }, 0);\n\n // Set the title\n ui.setTitle.call(this);\n\n // Assure the poster image is set, if the property was added before the element was created\n if (this.poster) {\n ui.setPoster.call(this, this.poster, false).catch(() => {});\n }\n\n // Manually set the duration if user has overridden it.\n // The event listeners for it doesn't get called if preload is disabled (#701)\n if (this.config.duration) {\n controls.durationUpdate.call(this);\n }\n\n // Media metadata\n if (this.config.mediaMetadata) {\n controls.setMediaMetadata.call(this);\n }\n },\n\n // Setup aria attribute for play and iframe title\n setTitle() {\n // Find the current text\n let label = i18n.get('play', this.config);\n\n // If there's a media title set, use that for the label\n if (is.string(this.config.title) && !is.empty(this.config.title)) {\n label += `, ${this.config.title}`;\n }\n\n // If there's a play button, set label\n Array.from(this.elements.buttons.play || []).forEach((button) => {\n button.setAttribute('aria-label', label);\n });\n\n // Set iframe title\n // https://github.com/sampotts/plyr/issues/124\n if (this.isEmbed) {\n const iframe = getElement.call(this, 'iframe');\n\n if (!is.element(iframe)) {\n return;\n }\n\n // Default to media type\n const title = !is.empty(this.config.title) ? this.config.title : 'video';\n const format = i18n.get('frameTitle', this.config);\n\n iframe.setAttribute('title', format.replace('{title}', title));\n }\n },\n\n // Toggle poster\n togglePoster(enable) {\n toggleClass(this.elements.container, this.config.classNames.posterEnabled, enable);\n },\n\n // Set the poster image (async)\n // Used internally for the poster setter, with the passive option forced to false\n setPoster(poster, passive = true) {\n // Don't override if call is passive\n if (passive && this.poster) {\n return Promise.reject(new Error('Poster already set'));\n }\n\n // Set property synchronously to respect the call order\n this.media.setAttribute('data-poster', poster);\n\n // Show the poster\n this.elements.poster.removeAttribute('hidden');\n\n // Wait until ui is ready\n return (\n ready\n .call(this)\n // Load image\n .then(() => loadImage(poster))\n .catch((error) => {\n // Hide poster on error unless it's been set by another call\n if (poster === this.poster) {\n ui.togglePoster.call(this, false);\n }\n // Rethrow\n throw error;\n })\n .then(() => {\n // Prevent race conditions\n if (poster !== this.poster) {\n throw new Error('setPoster cancelled by later call to setPoster');\n }\n })\n .then(() => {\n Object.assign(this.elements.poster.style, {\n backgroundImage: `url('${poster}')`,\n // Reset backgroundSize as well (since it can be set to \"cover\" for padded thumbnails for youtube)\n backgroundSize: '',\n });\n\n ui.togglePoster.call(this, true);\n\n return poster;\n })\n );\n },\n\n // Check playing state\n checkPlaying(event) {\n // Class hooks\n toggleClass(this.elements.container, this.config.classNames.playing, this.playing);\n toggleClass(this.elements.container, this.config.classNames.paused, this.paused);\n toggleClass(this.elements.container, this.config.classNames.stopped, this.stopped);\n\n // Set state\n Array.from(this.elements.buttons.play || []).forEach((target) => {\n Object.assign(target, { pressed: this.playing });\n target.setAttribute('aria-label', i18n.get(this.playing ? 'pause' : 'play', this.config));\n });\n\n // Only update controls on non timeupdate events\n if (is.event(event) && event.type === 'timeupdate') {\n return;\n }\n\n // Toggle controls\n ui.toggleControls.call(this);\n },\n\n // Check if media is loading\n checkLoading(event) {\n this.loading = ['stalled', 'waiting'].includes(event.type);\n\n // Clear timer\n clearTimeout(this.timers.loading);\n\n // Timer to prevent flicker when seeking\n this.timers.loading = setTimeout(\n () => {\n // Update progress bar loading class state\n toggleClass(this.elements.container, this.config.classNames.loading, this.loading);\n\n // Update controls visibility\n ui.toggleControls.call(this);\n },\n this.loading ? 250 : 0,\n );\n },\n\n // Toggle controls based on state and `force` argument\n toggleControls(force) {\n const { controls: controlsElement } = this.elements;\n\n if (controlsElement && this.config.hideControls) {\n // Don't hide controls if a touch-device user recently seeked. (Must be limited to touch devices, or it occasionally prevents desktop controls from hiding.)\n const recentTouchSeek = this.touch && this.lastSeekTime + 2000 > Date.now();\n\n // Show controls if force, loading, paused, button interaction, or recent seek, otherwise hide\n this.toggleControls(\n Boolean(\n force || this.loading || this.paused || controlsElement.pressed || controlsElement.hover || recentTouchSeek,\n ),\n );\n }\n },\n\n // Migrate any custom properties from the media to the parent\n migrateStyles() {\n // Loop through values (as they are the keys when the object is spread 🤔)\n Object.values({ ...this.media.style })\n // We're only fussed about Plyr specific properties\n .filter(key => !is.empty(key) && is.string(key) && key.startsWith('--plyr'))\n .forEach((key) => {\n // Set on the container\n this.elements.container.style.setProperty(key, this.media.style.getPropertyValue(key));\n\n // Clean up from media element\n this.media.style.removeProperty(key);\n });\n\n // Remove attribute if empty\n if (is.empty(this.media.style)) {\n this.media.removeAttribute('style');\n }\n },\n};\n\nexport default ui;\n","// ==========================================================================\n// Plyr Event Listeners\n// ==========================================================================\n\nimport controls from './controls';\nimport ui from './ui';\nimport { repaint } from './utils/animation';\nimport browser from './utils/browser';\nimport { getElement, getElements, matches, toggleClass } from './utils/elements';\nimport { off, on, once, toggleListener, triggerEvent } from './utils/events';\nimport is from './utils/is';\nimport { silencePromise } from './utils/promise';\nimport { getAspectRatio, getViewportSize, supportsCSS } from './utils/style';\n\nclass Listeners {\n constructor(player) {\n this.player = player;\n this.lastKey = null;\n this.focusTimer = null;\n this.lastKeyDown = null;\n\n this.handleKey = this.handleKey.bind(this);\n this.toggleMenu = this.toggleMenu.bind(this);\n this.firstTouch = this.firstTouch.bind(this);\n }\n\n // Handle key presses\n handleKey(event) {\n const { player } = this;\n const { elements } = player;\n const { key, type, altKey, ctrlKey, metaKey, shiftKey } = event;\n const pressed = type === 'keydown';\n const repeat = pressed && key === this.lastKey;\n\n // Bail if a modifier key is set\n if (altKey || ctrlKey || metaKey || shiftKey) {\n return;\n }\n\n // If the event is bubbled from the media element\n // Firefox doesn't get the key for whatever reason\n if (!key) {\n return;\n }\n\n // Seek by increment\n const seekByIncrement = (increment) => {\n // Divide the max duration into 10th's and times by the number value\n player.currentTime = (player.duration / 10) * increment;\n };\n\n // Handle the key on keydown\n // Reset on keyup\n if (pressed) {\n // Check focused element\n // and if the focused element is not editable (e.g. text input)\n // and any that accept key input http://webaim.org/techniques/keyboard/\n const focused = document.activeElement;\n if (is.element(focused)) {\n const { editable } = player.config.selectors;\n const { seek } = elements.inputs;\n\n if (focused !== seek && matches(focused, editable)) {\n return;\n }\n\n if (event.key === ' ' && matches(focused, 'button, [role^=\"menuitem\"]')) {\n return;\n }\n }\n\n // Which keys should we prevent default\n const preventDefault = [\n ' ',\n 'ArrowLeft',\n 'ArrowUp',\n 'ArrowRight',\n 'ArrowDown',\n\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n\n 'c',\n 'f',\n 'k',\n 'l',\n 'm',\n ];\n\n // If the key is found prevent default (e.g. prevent scrolling for arrows)\n if (preventDefault.includes(key)) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n switch (key) {\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n if (!repeat) {\n seekByIncrement(Number.parseInt(key, 10));\n }\n break;\n\n case ' ':\n case 'k':\n if (!repeat) {\n silencePromise(player.togglePlay());\n }\n break;\n\n case 'ArrowUp':\n player.increaseVolume(0.1);\n break;\n\n case 'ArrowDown':\n player.decreaseVolume(0.1);\n break;\n\n case 'm':\n if (!repeat) {\n player.muted = !player.muted;\n }\n break;\n\n case 'ArrowRight':\n player.forward();\n break;\n\n case 'ArrowLeft':\n player.rewind();\n break;\n\n case 'f':\n player.fullscreen.toggle();\n break;\n\n case 'c':\n if (!repeat) {\n player.toggleCaptions();\n }\n break;\n\n case 'l':\n player.loop = !player.loop;\n break;\n\n default:\n break;\n }\n\n // Escape is handle natively when in full screen\n // So we only need to worry about non native\n if (key === 'Escape' && !player.fullscreen.usingNative && player.fullscreen.active) {\n player.fullscreen.toggle();\n }\n\n // Store last key for next cycle\n this.lastKey = key;\n }\n else {\n this.lastKey = null;\n }\n }\n\n // Toggle menu\n toggleMenu(event) {\n controls.toggleMenu.call(this.player, event);\n }\n\n // Device is touch enabled\n firstTouch = () => {\n const { player } = this;\n const { elements } = player;\n\n player.touch = true;\n\n // Add touch class\n toggleClass(elements.container, player.config.classNames.isTouch, true);\n };\n\n // Global window & document listeners\n global = (toggle = true) => {\n const { player } = this;\n\n // Keyboard shortcuts\n if (player.config.keyboard.global) {\n toggleListener.call(player, window, 'keydown keyup', this.handleKey, toggle, false);\n }\n\n // Click anywhere closes menu\n toggleListener.call(player, document.body, 'click', this.toggleMenu, toggle);\n\n // Detect touch by events\n once.call(player, document.body, 'touchstart', this.firstTouch);\n };\n\n // Container listeners\n container = () => {\n const { player } = this;\n const { config, elements, timers } = player;\n\n // Keyboard shortcuts\n if (!config.keyboard.global && config.keyboard.focused) {\n on.call(player, elements.container, 'keydown keyup', this.handleKey, false);\n }\n\n // Toggle controls on mouse events and entering fullscreen\n on.call(\n player,\n elements.container,\n 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen',\n (event) => {\n const { controls: controlsElement } = elements;\n\n // Remove button states for fullscreen\n if (controlsElement && event.type === 'enterfullscreen') {\n controlsElement.pressed = false;\n controlsElement.hover = false;\n }\n\n // Show, then hide after a timeout unless another control event occurs\n const show = ['touchstart', 'touchmove', 'mousemove'].includes(event.type);\n let delay = 0;\n\n if (show) {\n ui.toggleControls.call(player, true);\n // Use longer timeout for touch devices\n delay = player.touch ? 3000 : 2000;\n }\n\n // Clear timer\n clearTimeout(timers.controls);\n\n // Set new timer to prevent flicker when seeking\n timers.controls = setTimeout(() => ui.toggleControls.call(player, false), delay);\n },\n );\n\n // Set a gutter for Vimeo\n const setGutter = () => {\n if (!player.isVimeo || player.config.vimeo.premium) {\n return;\n }\n\n const target = elements.wrapper;\n const { active } = player.fullscreen;\n const [videoWidth, videoHeight] = getAspectRatio.call(player);\n const useNativeAspectRatio = supportsCSS(`aspect-ratio: ${videoWidth} / ${videoHeight}`);\n\n // If not active, remove styles\n if (!active) {\n if (useNativeAspectRatio) {\n target.style.width = null;\n target.style.height = null;\n }\n else {\n target.style.maxWidth = null;\n target.style.margin = null;\n }\n return;\n }\n\n // Determine which dimension will overflow and constrain view\n const [viewportWidth, viewportHeight] = getViewportSize();\n const overflow = viewportWidth / viewportHeight > videoWidth / videoHeight;\n\n if (useNativeAspectRatio) {\n target.style.width = overflow ? 'auto' : '100%';\n target.style.height = overflow ? '100%' : 'auto';\n }\n else {\n target.style.maxWidth = overflow ? `${(viewportHeight / videoHeight) * videoWidth}px` : null;\n target.style.margin = overflow ? '0 auto' : null;\n }\n };\n\n // Handle resizing\n const resized = () => {\n clearTimeout(timers.resized);\n timers.resized = setTimeout(setGutter, 50);\n };\n\n on.call(player, elements.container, 'enterfullscreen exitfullscreen', (event) => {\n const { target } = player.fullscreen;\n\n // Ignore events not from target\n if (target !== elements.container) {\n return;\n }\n\n // If it's not an embed and no ratio specified\n if (!player.isEmbed && is.empty(player.config.ratio)) {\n return;\n }\n\n // Set Vimeo gutter\n setGutter();\n\n // Watch for resizes\n const method = event.type === 'enterfullscreen' ? on : off;\n method.call(player, window, 'resize', resized);\n });\n };\n\n // Listen for media events\n media = () => {\n const { player } = this;\n const { elements } = player;\n\n // Time change on media\n on.call(player, player.media, 'timeupdate seeking seeked', event => controls.timeUpdate.call(player, event));\n\n // Display duration\n on.call(player, player.media, 'durationchange loadeddata loadedmetadata', event =>\n controls.durationUpdate.call(player, event));\n\n // Handle the media finishing\n on.call(player, player.media, 'ended', () => {\n // Show poster on end\n if (player.isHTML5 && player.isVideo && player.config.resetOnEnd) {\n // Restart\n player.restart();\n\n // Call pause otherwise IE11 will start playing the video again\n player.pause();\n }\n });\n\n // Check for buffer progress\n on.call(player, player.media, 'progress playing seeking seeked', event =>\n controls.updateProgress.call(player, event));\n\n // Handle volume changes\n on.call(player, player.media, 'volumechange', event => controls.updateVolume.call(player, event));\n\n // Handle play/pause\n on.call(player, player.media, 'playing play pause ended emptied timeupdate', event =>\n ui.checkPlaying.call(player, event));\n\n // Loading state\n on.call(player, player.media, 'waiting canplay seeked playing', event => ui.checkLoading.call(player, event));\n\n // Click video\n if (player.supported.ui && player.config.clickToPlay && !player.isAudio) {\n // Re-fetch the wrapper\n const wrapper = getElement.call(player, `.${player.config.classNames.video}`);\n\n // Bail if there's no wrapper (this should never happen)\n if (!is.element(wrapper)) {\n return;\n }\n\n // On click play, pause or restart\n on.call(player, elements.container, 'click', (event) => {\n const targets = [elements.container, wrapper];\n\n // Ignore if click if not container or in video wrapper\n if (!targets.includes(event.target) && !wrapper.contains(event.target)) {\n return;\n }\n\n // Touch devices will just show controls (if hidden)\n if (player.touch && player.config.hideControls) {\n return;\n }\n\n if (player.ended) {\n this.proxy(event, player.restart, 'restart');\n this.proxy(\n event,\n () => {\n silencePromise(player.play());\n },\n 'play',\n );\n }\n else {\n this.proxy(\n event,\n () => {\n silencePromise(player.togglePlay());\n },\n 'play',\n );\n }\n });\n }\n\n // Disable right click\n if (player.supported.ui && player.config.disableContextMenu) {\n on.call(\n player,\n elements.wrapper,\n 'contextmenu',\n (event) => {\n event.preventDefault();\n },\n false,\n );\n }\n\n // Volume change\n on.call(player, player.media, 'volumechange', () => {\n // Save to storage\n player.storage.set({\n volume: player.volume,\n muted: player.muted,\n });\n });\n\n // Speed change\n on.call(player, player.media, 'ratechange', () => {\n // Update UI\n controls.updateSetting.call(player, 'speed');\n\n // Save to storage\n player.storage.set({ speed: player.speed });\n });\n\n // Quality change\n on.call(player, player.media, 'qualitychange', (event) => {\n // Update UI\n controls.updateSetting.call(player, 'quality', null, event.detail.quality);\n });\n\n // Update download link when ready and if quality changes\n on.call(player, player.media, 'ready qualitychange', () => {\n controls.setDownloadUrl.call(player);\n });\n\n // Proxy events to container\n // Bubble up key events for Edge\n const proxyEvents = player.config.events.concat(['keyup', 'keydown']).join(' ');\n\n on.call(player, player.media, proxyEvents, (event) => {\n let { detail = {} } = event;\n\n // Get error details from media\n if (event.type === 'error') {\n detail = player.media.error;\n }\n\n triggerEvent.call(player, elements.container, event.type, true, detail);\n });\n };\n\n // Run default and custom handlers\n proxy = (event, defaultHandler, customHandlerKey) => {\n const { player } = this;\n const customHandler = player.config.listeners[customHandlerKey];\n const hasCustomHandler = is.function(customHandler);\n let returned = true;\n\n // Execute custom handler\n if (hasCustomHandler) {\n returned = customHandler.call(player, event);\n }\n\n // Only call default handler if not prevented in custom handler\n if (returned !== false && is.function(defaultHandler)) {\n defaultHandler.call(player, event);\n }\n };\n\n // Trigger custom and default handlers\n bind = (element, type, defaultHandler, customHandlerKey, passive = true) => {\n const { player } = this;\n const customHandler = player.config.listeners[customHandlerKey];\n const hasCustomHandler = is.function(customHandler);\n\n on.call(\n player,\n element,\n type,\n event => this.proxy(event, defaultHandler, customHandlerKey),\n passive && !hasCustomHandler,\n );\n };\n\n // Listen for control events\n controls = () => {\n const { player } = this;\n const { elements } = player;\n // IE doesn't support input event, so we fallback to change\n const inputEvent = browser.isIE ? 'change' : 'input';\n\n // Play/pause toggle\n if (elements.buttons.play) {\n Array.from(elements.buttons.play).forEach((button) => {\n this.bind(\n button,\n 'click',\n () => {\n silencePromise(player.togglePlay());\n },\n 'play',\n );\n });\n }\n\n // Pause\n this.bind(elements.buttons.restart, 'click', player.restart, 'restart');\n\n // Rewind\n this.bind(\n elements.buttons.rewind,\n 'click',\n () => {\n // Record seek time so we can prevent hiding controls for a few seconds after rewind\n player.lastSeekTime = Date.now();\n player.rewind();\n },\n 'rewind',\n );\n\n // Rewind\n this.bind(\n elements.buttons.fastForward,\n 'click',\n () => {\n // Record seek time so we can prevent hiding controls for a few seconds after fast forward\n player.lastSeekTime = Date.now();\n player.forward();\n },\n 'fastForward',\n );\n\n // Mute toggle\n this.bind(\n elements.buttons.mute,\n 'click',\n () => {\n player.muted = !player.muted;\n },\n 'mute',\n );\n\n // Captions toggle\n this.bind(elements.buttons.captions, 'click', () => player.toggleCaptions());\n\n // Download\n this.bind(\n elements.buttons.download,\n 'click',\n () => {\n triggerEvent.call(player, player.media, 'download');\n },\n 'download',\n );\n\n // Fullscreen toggle\n this.bind(\n elements.buttons.fullscreen,\n 'click',\n () => {\n player.fullscreen.toggle();\n },\n 'fullscreen',\n );\n\n // Picture-in-Picture\n this.bind(\n elements.buttons.pip,\n 'click',\n () => {\n player.pip = 'toggle';\n },\n 'pip',\n );\n\n // Airplay\n this.bind(elements.buttons.airplay, 'click', player.airplay, 'airplay');\n\n // Settings menu - click toggle\n this.bind(\n elements.buttons.settings,\n 'click',\n (event) => {\n // Prevent the document click listener closing the menu\n event.stopPropagation();\n event.preventDefault();\n\n controls.toggleMenu.call(player, event);\n },\n null,\n false,\n ); // Can't be passive as we're preventing default\n\n // Settings menu - keyboard toggle\n // We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1220143\n this.bind(\n elements.buttons.settings,\n 'keyup',\n (event) => {\n if (![' ', 'Enter'].includes(event.key)) {\n return;\n }\n\n // Because return triggers a click anyway, all we need to do is set focus\n if (event.key === 'Enter') {\n controls.focusFirstMenuItem.call(player, null, true);\n return;\n }\n\n // Prevent scroll\n event.preventDefault();\n\n // Prevent playing video (Firefox)\n event.stopPropagation();\n\n // Toggle menu\n controls.toggleMenu.call(player, event);\n },\n null,\n false, // Can't be passive as we're preventing default\n );\n\n // Escape closes menu\n this.bind(elements.settings.menu, 'keydown', (event) => {\n if (event.key === 'Escape') {\n controls.toggleMenu.call(player, event);\n }\n });\n\n // Set range input alternative \"value\", which matches the tooltip time (#954)\n this.bind(elements.inputs.seek, 'mousedown mousemove', (event) => {\n const rect = elements.progress.getBoundingClientRect();\n const scrollLeft = event.pageX - event.clientX;\n const percent = (100 / rect.width) * (event.pageX - rect.left - scrollLeft);\n event.currentTarget.setAttribute('seek-value', percent);\n });\n\n // Pause while seeking\n this.bind(elements.inputs.seek, 'mousedown mouseup keydown keyup touchstart touchend', (event) => {\n const seek = event.currentTarget;\n const attribute = 'play-on-seeked';\n\n if (is.keyboardEvent(event) && !['ArrowLeft', 'ArrowRight'].includes(event.key)) {\n return;\n }\n\n // Record seek time so we can prevent hiding controls for a few seconds after seek\n player.lastSeekTime = Date.now();\n\n // Was playing before?\n const play = seek.hasAttribute(attribute);\n // Done seeking\n const done = ['mouseup', 'touchend', 'keyup'].includes(event.type);\n\n // If we're done seeking and it was playing, resume playback\n if (play && done) {\n seek.removeAttribute(attribute);\n silencePromise(player.play());\n }\n else if (!done && player.playing) {\n seek.setAttribute(attribute, '');\n player.pause();\n }\n });\n\n // Fix range inputs on iOS\n // Super weird iOS bug where after you interact with an ,\n // it takes over further interactions on the page. This is a hack\n if (browser.isIos) {\n const inputs = getElements.call(player, 'input[type=\"range\"]');\n Array.from(inputs).forEach(input => this.bind(input, inputEvent, event => repaint(event.target)));\n }\n\n // Seek\n this.bind(\n elements.inputs.seek,\n inputEvent,\n (event) => {\n const seek = event.currentTarget;\n // If it exists, use seek-value instead of \"value\" for consistency with tooltip time (#954)\n let seekTo = seek.getAttribute('seek-value');\n\n if (is.empty(seekTo)) {\n seekTo = seek.value;\n }\n\n seek.removeAttribute('seek-value');\n\n player.currentTime = (seekTo / seek.max) * player.duration;\n },\n 'seek',\n );\n\n // Seek tooltip\n this.bind(elements.progress, 'mouseenter mouseleave mousemove', event =>\n controls.updateSeekTooltip.call(player, event));\n\n // Preview thumbnails plugin\n // TODO: Really need to work on some sort of plug-in wide event bus or pub-sub for this\n this.bind(elements.progress, 'mousemove touchmove', (event) => {\n const { previewThumbnails } = player;\n\n if (previewThumbnails && previewThumbnails.loaded) {\n previewThumbnails.startMove(event);\n }\n });\n\n // Hide thumbnail preview - on mouse click, mouse leave, and video play/seek. All four are required, e.g., for buffering\n this.bind(elements.progress, 'mouseleave touchend click', () => {\n const { previewThumbnails } = player;\n\n if (previewThumbnails && previewThumbnails.loaded) {\n previewThumbnails.endMove(false, true);\n }\n });\n\n // Show scrubbing preview\n this.bind(elements.progress, 'mousedown touchstart', (event) => {\n const { previewThumbnails } = player;\n\n if (previewThumbnails && previewThumbnails.loaded) {\n previewThumbnails.startScrubbing(event);\n }\n });\n\n this.bind(elements.progress, 'mouseup touchend', (event) => {\n const { previewThumbnails } = player;\n\n if (previewThumbnails && previewThumbnails.loaded) {\n previewThumbnails.endScrubbing(event);\n }\n });\n\n // Polyfill for lower fill in for webkit\n if (browser.isWebKit) {\n Array.from(getElements.call(player, 'input[type=\"range\"]')).forEach((element) => {\n this.bind(element, 'input', event => controls.updateRangeFill.call(player, event.target));\n });\n }\n\n // Current time invert\n // Only if one time element is used for both currentTime and duration\n if (player.config.toggleInvert && !is.element(elements.display.duration)) {\n this.bind(elements.display.currentTime, 'click', () => {\n // Do nothing if we're at the start\n if (player.currentTime === 0) {\n return;\n }\n\n player.config.invertTime = !player.config.invertTime;\n\n controls.timeUpdate.call(player);\n });\n }\n\n // Volume\n this.bind(\n elements.inputs.volume,\n inputEvent,\n (event) => {\n player.volume = event.target.value;\n },\n 'volume',\n );\n\n // Update controls.hover state (used for ui.toggleControls to avoid hiding when interacting)\n this.bind(elements.controls, 'mouseenter mouseleave', (event) => {\n elements.controls.hover = !player.touch && event.type === 'mouseenter';\n });\n\n // Also update controls.hover state for any non-player children of fullscreen element (as above)\n if (elements.fullscreen) {\n Array.from(elements.fullscreen.children)\n .filter(c => !c.contains(elements.container))\n .forEach((child) => {\n this.bind(child, 'mouseenter mouseleave', (event) => {\n if (elements.controls) {\n elements.controls.hover = !player.touch && event.type === 'mouseenter';\n }\n });\n });\n }\n\n // Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting)\n this.bind(elements.controls, 'mousedown mouseup touchstart touchend touchcancel', (event) => {\n elements.controls.pressed = ['mousedown', 'touchstart'].includes(event.type);\n });\n\n // Show controls when they receive focus (e.g., when using keyboard tab key)\n this.bind(elements.controls, 'focusin', () => {\n const { config, timers } = player;\n\n // Skip transition to prevent focus from scrolling the parent element\n toggleClass(elements.controls, config.classNames.noTransition, true);\n\n // Toggle\n ui.toggleControls.call(player, true);\n\n // Restore transition\n setTimeout(() => {\n toggleClass(elements.controls, config.classNames.noTransition, false);\n }, 0);\n\n // Delay a little more for mouse users\n const delay = this.touch ? 3000 : 4000;\n\n // Clear timer\n clearTimeout(timers.controls);\n\n // Hide again after delay\n timers.controls = setTimeout(() => ui.toggleControls.call(player, false), delay);\n });\n\n // Mouse wheel for volume\n this.bind(\n elements.inputs.volume,\n 'wheel',\n (event) => {\n // Detect \"natural\" scroll - supported on OS X Safari only\n // Other browsers on OS X will be inverted until support improves\n const inverted = event.webkitDirectionInvertedFromDevice;\n // Get delta from event. Invert if `inverted` is true\n const [x, y] = [event.deltaX, -event.deltaY].map(value => (inverted ? -value : value));\n // Using the biggest delta, normalize to 1 or -1 (or 0 if no delta)\n const direction = Math.sign(Math.abs(x) > Math.abs(y) ? x : y);\n\n // Change the volume by 2%\n player.increaseVolume(direction / 50);\n\n // Don't break page scrolling at max and min\n const { volume } = player.media;\n if ((direction === 1 && volume < 1) || (direction === -1 && volume > 0)) {\n event.preventDefault();\n }\n },\n 'volume',\n false,\n );\n };\n}\n\nexport default Listeners;\n","// ==========================================================================\n// Load an external script\n// ==========================================================================\n\nimport loadjs from 'loadjs';\n\nexport default function loadScript(url) {\n return new Promise((resolve, reject) => {\n loadjs(url, {\n success: resolve,\n error: reject,\n });\n });\n}\n","// ==========================================================================\n// Vimeo plugin\n// ==========================================================================\n\nimport captions from '../captions';\nimport controls from '../controls';\nimport ui from '../ui';\nimport { createElement, replaceElement, toggleClass } from '../utils/elements';\nimport { triggerEvent } from '../utils/events';\nimport fetch from '../utils/fetch';\nimport is from '../utils/is';\nimport loadScript from '../utils/load-script';\nimport { format, stripHTML } from '../utils/strings';\nimport { roundAspectRatio, setAspectRatio } from '../utils/style';\nimport { buildUrlParams } from '../utils/urls';\n\n// Parse Vimeo ID from URL\nfunction parseId(url) {\n if (is.empty(url)) {\n return null;\n }\n\n if (is.number(Number(url))) {\n return url;\n }\n\n // eslint-disable-next-line regexp/optimal-quantifier-concatenation\n const regex = /^.*(vimeo.com\\/|video\\/)(\\d+).*/;\n const match = url.match(regex);\n return match ? match[2] : url;\n}\n\n// Try to extract a hash for private videos from the URL\nfunction parseHash(url) {\n /* This regex matches a hexadecimal hash if given in any of these forms:\n * - [https://player.]vimeo.com/video/{id}/{hash}[?params]\n * - [https://player.]vimeo.com/video/{id}?h={hash}[¶ms]\n * - [https://player.]vimeo.com/video/{id}?[params]&h={hash}\n * - video/{id}/{hash}\n * If matched, the hash is available in capture group 4\n */\n const regex = /^.*(vimeo.com\\/|video\\/)(\\d+)(\\?.*h=|\\/)+([\\d,a-f]+)/;\n const found = url.match(regex);\n\n return found && found.length === 5 ? found[4] : null;\n}\n\n// Set playback state and trigger change (only on actual change)\nfunction assurePlaybackState(play) {\n if (play && !this.embed.hasPlayed) {\n this.embed.hasPlayed = true;\n }\n if (this.media.paused === play) {\n this.media.paused = !play;\n triggerEvent.call(this, this.media, play ? 'play' : 'pause');\n }\n}\n\nconst vimeo = {\n setup() {\n const player = this;\n\n // Add embed class for responsive\n toggleClass(player.elements.wrapper, player.config.classNames.embed, true);\n\n // Set speed options from config\n player.options.speed = player.config.speed.options;\n\n // Set initial ratio\n setAspectRatio.call(player);\n\n // Load the SDK if not already\n if (!is.object(window.Vimeo)) {\n loadScript(player.config.urls.vimeo.sdk)\n .then(() => {\n vimeo.ready.call(player);\n })\n .catch((error) => {\n player.debug.warn('Vimeo SDK (player.js) failed to load', error);\n });\n }\n else {\n vimeo.ready.call(player);\n }\n },\n\n // API Ready\n ready() {\n const player = this;\n const config = player.config.vimeo;\n const { premium, referrerPolicy, ...frameParams } = config;\n // Get the source URL or ID\n let source = player.media.getAttribute('src');\n let hash = '';\n // Get from
if needed\n if (is.empty(source)) {\n source = player.media.getAttribute(player.config.attributes.embed.id);\n // hash can also be set as attribute on the
\n hash = player.media.getAttribute(player.config.attributes.embed.hash);\n }\n else {\n hash = parseHash(source);\n }\n const hashParam = hash ? { h: hash } : {};\n\n // If the owner has a pro or premium account then we can hide controls etc\n if (premium) {\n Object.assign(frameParams, {\n controls: false,\n sidedock: false,\n });\n }\n\n // Get Vimeo params for the iframe\n const params = buildUrlParams({\n loop: player.config.loop.active,\n autoplay: player.autoplay,\n muted: player.muted,\n gesture: 'media',\n playsinline: player.config.playsinline,\n // hash has to be added to iframe-URL\n ...hashParam,\n ...frameParams,\n });\n\n const id = parseId(source);\n // Build an iframe\n const iframe = createElement('iframe');\n const src = format(player.config.urls.vimeo.iframe, id, params);\n iframe.setAttribute('src', src);\n iframe.setAttribute('allowfullscreen', '');\n iframe.setAttribute(\n 'allow',\n ['autoplay', 'fullscreen', 'picture-in-picture', 'encrypted-media', 'accelerometer', 'gyroscope'].join('; '),\n );\n\n // Set the referrer policy if required\n if (!is.empty(referrerPolicy)) {\n iframe.setAttribute('referrerPolicy', referrerPolicy);\n }\n\n // Inject the package\n if (premium || !config.customControls) {\n iframe.setAttribute('data-poster', player.poster);\n player.media = replaceElement(iframe, player.media);\n }\n else {\n const wrapper = createElement('div', {\n 'class': player.config.classNames.embedContainer,\n 'data-poster': player.poster,\n });\n wrapper.appendChild(iframe);\n player.media = replaceElement(wrapper, player.media);\n }\n\n // Get poster image\n if (!config.customControls) {\n fetch(format(player.config.urls.vimeo.api, src)).then((response) => {\n if (is.empty(response) || !response.thumbnail_url) {\n return;\n }\n\n // Set and show poster\n ui.setPoster.call(player, response.thumbnail_url).catch(() => {});\n });\n }\n\n // Setup instance\n // https://github.com/vimeo/player.js\n player.embed = new window.Vimeo.Player(iframe, {\n autopause: player.config.autopause,\n muted: player.muted,\n });\n\n player.media.paused = true;\n player.media.currentTime = 0;\n\n // Disable native text track rendering\n if (player.supported.ui) {\n player.embed.disableTextTrack();\n }\n\n // Create a faux HTML5 API using the Vimeo API\n player.media.play = () => {\n assurePlaybackState.call(player, true);\n return player.embed.play();\n };\n\n player.media.pause = () => {\n assurePlaybackState.call(player, false);\n return player.embed.pause();\n };\n\n player.media.stop = () => {\n player.pause();\n player.currentTime = 0;\n };\n\n // Seeking\n let { currentTime } = player.media;\n Object.defineProperty(player.media, 'currentTime', {\n get() {\n return currentTime;\n },\n set(time) {\n // Vimeo will automatically play on seek if the video hasn't been played before\n\n // Get current paused state and volume etc\n const { embed, media, paused, volume } = player;\n const restorePause = paused && !embed.hasPlayed;\n\n // Set seeking state and trigger event\n media.seeking = true;\n triggerEvent.call(player, media, 'seeking');\n\n // If paused, mute until seek is complete\n Promise.resolve(restorePause && embed.setVolume(0))\n // Seek\n .then(() => embed.setCurrentTime(time))\n // Restore paused\n .then(() => restorePause && embed.pause())\n // Restore volume\n .then(() => restorePause && embed.setVolume(volume))\n .catch(() => {\n // Do nothing\n });\n },\n });\n\n // Playback speed\n let speed = player.config.speed.selected;\n Object.defineProperty(player.media, 'playbackRate', {\n get() {\n return speed;\n },\n set(input) {\n player.embed\n .setPlaybackRate(input)\n .then(() => {\n speed = input;\n triggerEvent.call(player, player.media, 'ratechange');\n })\n .catch(() => {\n // Cannot set Playback Rate, Video is probably not on Pro account\n player.options.speed = [1];\n });\n },\n });\n\n // Volume\n let { volume } = player.config;\n Object.defineProperty(player.media, 'volume', {\n get() {\n return volume;\n },\n set(input) {\n player.embed.setVolume(input).then(() => {\n volume = input;\n triggerEvent.call(player, player.media, 'volumechange');\n });\n },\n });\n\n // Muted\n let { muted } = player.config;\n Object.defineProperty(player.media, 'muted', {\n get() {\n return muted;\n },\n set(input) {\n const toggle = is.boolean(input) ? input : false;\n\n player.embed.setMuted(toggle ? true : player.config.muted).then(() => {\n muted = toggle;\n triggerEvent.call(player, player.media, 'volumechange');\n });\n },\n });\n\n // Loop\n let { loop } = player.config;\n Object.defineProperty(player.media, 'loop', {\n get() {\n return loop;\n },\n set(input) {\n const toggle = is.boolean(input) ? input : player.config.loop.active;\n\n player.embed.setLoop(toggle).then(() => {\n loop = toggle;\n });\n },\n });\n\n // Source\n let currentSrc;\n player.embed\n .getVideoUrl()\n .then((value) => {\n currentSrc = value;\n controls.setDownloadUrl.call(player);\n })\n .catch((error) => {\n this.debug.warn(error);\n });\n\n Object.defineProperty(player.media, 'currentSrc', {\n get() {\n return currentSrc;\n },\n });\n\n // Ended\n Object.defineProperty(player.media, 'ended', {\n get() {\n return player.currentTime === player.duration;\n },\n });\n\n // Set aspect ratio based on video size\n Promise.all([player.embed.getVideoWidth(), player.embed.getVideoHeight()]).then((dimensions) => {\n const [width, height] = dimensions;\n player.embed.ratio = roundAspectRatio(width, height);\n setAspectRatio.call(this);\n });\n\n // Set autopause\n player.embed.setAutopause(player.config.autopause).then((state) => {\n player.config.autopause = state;\n });\n\n // Get title\n player.embed.getVideoTitle().then((title) => {\n player.config.title = title;\n ui.setTitle.call(this);\n });\n\n // Get current time\n player.embed.getCurrentTime().then((value) => {\n currentTime = value;\n triggerEvent.call(player, player.media, 'timeupdate');\n });\n\n // Get duration\n player.embed.getDuration().then((value) => {\n player.media.duration = value;\n triggerEvent.call(player, player.media, 'durationchange');\n });\n\n // Get captions\n player.embed.getTextTracks().then((tracks) => {\n player.media.textTracks = tracks;\n captions.setup.call(player);\n });\n\n player.embed.on('cuechange', ({ cues = [] }) => {\n const strippedCues = cues.map(cue => stripHTML(cue.text));\n captions.updateCues.call(player, strippedCues);\n });\n\n player.embed.on('loaded', () => {\n // Assure state and events are updated on autoplay\n player.embed.getPaused().then((paused) => {\n assurePlaybackState.call(player, !paused);\n if (!paused) {\n triggerEvent.call(player, player.media, 'playing');\n }\n });\n\n if (is.element(player.embed.element) && player.supported.ui) {\n const frame = player.embed.element;\n\n // Fix keyboard focus issues\n // https://github.com/sampotts/plyr/issues/317\n frame.setAttribute('tabindex', -1);\n }\n });\n\n player.embed.on('bufferstart', () => {\n triggerEvent.call(player, player.media, 'waiting');\n });\n\n player.embed.on('bufferend', () => {\n triggerEvent.call(player, player.media, 'playing');\n });\n\n player.embed.on('play', () => {\n assurePlaybackState.call(player, true);\n triggerEvent.call(player, player.media, 'playing');\n });\n\n player.embed.on('pause', () => {\n assurePlaybackState.call(player, false);\n });\n\n player.embed.on('timeupdate', (data) => {\n player.media.seeking = false;\n currentTime = data.seconds;\n triggerEvent.call(player, player.media, 'timeupdate');\n });\n\n player.embed.on('progress', (data) => {\n player.media.buffered = data.percent;\n triggerEvent.call(player, player.media, 'progress');\n\n // Check all loaded\n if (Number.parseInt(data.percent, 10) === 1) {\n triggerEvent.call(player, player.media, 'canplaythrough');\n }\n\n // Get duration as if we do it before load, it gives an incorrect value\n // https://github.com/sampotts/plyr/issues/891\n player.embed.getDuration().then((value) => {\n if (value !== player.media.duration) {\n player.media.duration = value;\n triggerEvent.call(player, player.media, 'durationchange');\n }\n });\n });\n\n player.embed.on('seeked', () => {\n player.media.seeking = false;\n triggerEvent.call(player, player.media, 'seeked');\n });\n\n player.embed.on('ended', () => {\n player.media.paused = true;\n triggerEvent.call(player, player.media, 'ended');\n });\n\n player.embed.on('error', (detail) => {\n player.media.error = detail;\n triggerEvent.call(player, player.media, 'error');\n });\n\n // Rebuild UI\n if (config.customControls) {\n setTimeout(() => ui.build.call(player), 0);\n }\n },\n};\n\nexport default vimeo;\n","// ==========================================================================\n// YouTube plugin\n// ==========================================================================\n\nimport ui from '../ui';\nimport { createElement, replaceElement, toggleClass } from '../utils/elements';\nimport { triggerEvent } from '../utils/events';\nimport fetch from '../utils/fetch';\nimport is from '../utils/is';\nimport loadImage from '../utils/load-image';\nimport loadScript from '../utils/load-script';\nimport { extend } from '../utils/objects';\nimport { format, generateId } from '../utils/strings';\nimport { roundAspectRatio, setAspectRatio } from '../utils/style';\n\n// Parse YouTube ID from URL\nfunction parseId(url) {\n if (is.empty(url)) {\n return null;\n }\n\n const regex = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regex);\n return match && match[2] ? match[2] : url;\n}\n\n// Set playback state and trigger change (only on actual change)\nfunction assurePlaybackState(play) {\n if (play && !this.embed.hasPlayed) {\n this.embed.hasPlayed = true;\n }\n if (this.media.paused === play) {\n this.media.paused = !play;\n triggerEvent.call(this, this.media, play ? 'play' : 'pause');\n }\n}\n\nfunction getHost(config) {\n if (config.noCookie) {\n return 'https://www.youtube-nocookie.com';\n }\n\n if (window.location.protocol === 'http:') {\n return 'http://www.youtube.com';\n }\n\n // Use YouTube's default\n return undefined;\n}\n\nconst youtube = {\n setup() {\n // Add embed class for responsive\n toggleClass(this.elements.wrapper, this.config.classNames.embed, true);\n\n // Setup API\n if (is.object(window.YT) && is.function(window.YT.Player)) {\n youtube.ready.call(this);\n }\n else {\n // Reference current global callback\n const callback = window.onYouTubeIframeAPIReady;\n\n // Set callback to process queue\n window.onYouTubeIframeAPIReady = () => {\n // Call global callback if set\n if (is.function(callback)) {\n callback();\n }\n\n youtube.ready.call(this);\n };\n\n // Load the SDK\n loadScript(this.config.urls.youtube.sdk).catch((error) => {\n this.debug.warn('YouTube API failed to load', error);\n });\n }\n },\n\n // Get the media title\n getTitle(videoId) {\n const url = format(this.config.urls.youtube.api, videoId);\n\n fetch(url)\n .then((data) => {\n if (is.object(data)) {\n const { title, height, width } = data;\n\n // Set title\n this.config.title = title;\n ui.setTitle.call(this);\n\n // Set aspect ratio\n this.embed.ratio = roundAspectRatio(width, height);\n }\n\n setAspectRatio.call(this);\n })\n .catch(() => {\n // Set aspect ratio\n setAspectRatio.call(this);\n });\n },\n\n // API ready\n ready() {\n const player = this;\n const config = player.config.youtube;\n // Ignore already setup (race condition)\n const currentId = player.media && player.media.getAttribute('id');\n if (!is.empty(currentId) && currentId.startsWith('youtube-')) {\n return;\n }\n\n // Get the source URL or ID\n let source = player.media.getAttribute('src');\n\n // Get from
if needed\n if (is.empty(source)) {\n source = player.media.getAttribute(this.config.attributes.embed.id);\n }\n\n // Replace the