diff --git a/changelog.md b/changelog.md index 5caa20c5..a11bb3f8 100644 --- a/changelog.md +++ b/changelog.md @@ -8,16 +8,17 @@ # 1.6.x -- Изменен загрузчик стилей при сборке расширения, благодаря этому скорость сборки стала немного быстрее, а итоговый размер кода, отвечающего за стили, уменьшен в ~1.65 раза -- Исправлена работа расширения без наличия WebAudio (#749) -- Исправлена ошибка из-за которой кнопка перевода могла не появляться до первичного получения субтитров или завершения автоперевода -- Исправлена ошибка из-за которой при смене адреса worker прокси-сервера домен сразу применялся, даже, если проксирование аудио выключено -- Автоперевод и первичное получение субтитров, теперь, происходит параллельно - Добавлена настройка горячей клавиши перевода (#485 в #760) - Добавлена поддержка путей `/inbox/` и `/bk/` для Видео Mail.ru (#763) - Добавлена поддержка 9animetv (#748) - Добавлена поддержка EpicGames Developers (#255, #505) - Добавлена поддержка Odysee (#755) + +- Изменен загрузчик стилей при сборке расширения, благодаря этому скорость сборки стала немного быстрее, а итоговый размер кода, отвечающего за стили, уменьшен в ~1.65 раза +- Исправлена работа расширения без наличия WebAudio (#749) +- Исправлена ошибка из-за которой кнопка перевода могла не появляться до первичного получения субтитров или завершения автоперевода +- Исправлена ошибка из-за которой при смене адреса worker прокси-сервера домен сразу применялся, даже, если проксирование аудио выключено +- Автоперевод и первичное получение субтитров, теперь, происходит параллельно - Некоторые другие мелкие улучшения # 1.6.1 diff --git a/dist/vot-min.user.js b/dist/vot-min.user.js index ebd9cc7a..3c997646 100644 --- a/dist/vot-min.user.js +++ b/dist/vot-min.user.js @@ -163,7 +163,7 @@ // ==/UserScript== /*! For license information please see vot-min.user.js.LICENSE.txt */ -(()=>{var t={"./src/styles/main.scss":()=>{GM_addStyle('.vot-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;border:none;border-radius:4px;outline:none;min-width:64px;height:36px;padding:0 16px;font-size:14px;font-weight:500;line-height:36px;transition:box-shadow .2s;display:inline-block;position:relative;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.vot-button[hidden]{display:none!important}.vot-button::-moz-focus-inner{border:none}.vot-button:before,.vot-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-button:before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.vot-button:hover:before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.vot-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size}.vot-button[disabled=true]{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.12);color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);box-shadow:none;cursor:initial}.vot-button[disabled=true]:before,.vot-button[disabled=true]:after{opacity:0}.vot-outlined-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;border:1px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.24);vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border-radius:4px;outline:none;min-width:64px;height:36px;margin:0;padding:0 16px;font-size:14px;font-weight:500;line-height:34px;display:inline-block;position:relative}.vot-outlined-button[hidden]{display:none!important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button:before,.vot-outlined-button:after{content:"";opacity:0;border-radius:3px;position:absolute;inset:0}.vot-outlined-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover:before{opacity:.04}.vot-outlined-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-outlined-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-outlined-button[disabled=true]:before,.vot-outlined-button[disabled=true]:after{opacity:0}.vot-text-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:4px;outline:none;min-width:64px;height:36px;margin:0;padding:0 8px;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-text-button[hidden]{display:none!important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button:before,.vot-text-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-text-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover:before{opacity:.04}.vot-text-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-text-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-text-button[disabled=true]:before,.vot-text-button[disabled=true]:after{opacity:0}.vot-icon-button{--vot-helper-onsurface:rgba(var(--vot-onsurface-rgb,0,0,0),.87);box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:50%;outline:none;width:36px;height:36px;margin:0;padding:0;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-icon-button[hidden]{display:none!important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button:before,.vot-icon-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-icon-button:before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover:before{opacity:.04}.vot-icon-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size,opacity}.vot-icon-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);fill:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-icon-button[disabled=true]:before,.vot-icon-button[disabled=true]:after{opacity:0}.vot-textfield{display:inline-block;--vot-helper-theme:rgb(var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243)))!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari3:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;padding-top:6px!important;font-size:16px!important;line-height:1.5!important;position:relative!important}.vot-textfield[hidden]{display:none!important}.vot-textfield>input,.vot-textfield>textarea{box-sizing:border-box!important;border-style:solid!important;border-width:1px!important;border-color:transparent var(--vot-helper-safari2)var(--vot-helper-safari2)!important;height:inherit!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;-webkit-text-fill-color:currentColor!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;caret-color:var(--vot-helper-theme)!important;background-color:#0000!important;border-radius:4px!important;width:100%!important;margin:0!important;padding:15px 13px!important;transition:border .2s,box-shadow .2s!important;box-shadow:inset 1px 0 #0000,inset -1px 0 #0000,inset 0 -1px #0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2)!important}.vot-textfield>input+span,.vot-textfield>textarea+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;cursor:text!important;pointer-events:none!important;width:100%!important;max-height:100%!important;font-size:75%!important;line-height:15px!important;transition:color .2s,font-size .2s,line-height .2s!important;display:flex!important;position:absolute!important;top:0!important;left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit!important;line-height:68px!important}.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{content:""!important;box-sizing:border-box!important;border-top:solid 1px var(--vot-helper-safari2)!important;pointer-events:none!important;min-width:10px!important;height:8px!important;margin-top:6px!important;transition:border .2s,box-shadow .2s!important;display:block!important;box-shadow:inset 0 1px #0000!important}.vot-textfield>input+span:before,.vot-textfield>textarea+span:before{border-left:1px solid #0000!important;border-radius:4px 0!important;margin-right:4px!important}.vot-textfield>input+span:after,.vot-textfield>textarea+span:after{border-right:1px solid #0000!important;border-radius:0 4px!important;flex-grow:1!important;margin-left:4px!important}.vot-textfield>input.vot-show-placeholer+span:before,.vot-textfield>textarea.vot-show-placeholer+span:before{margin-right:0!important}.vot-textfield>input.vot-show-placeholer+span:after,.vot-textfield>textarea.vot-show-placeholer+span:after{margin-left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span:before,.vot-textfield>input:not(:focus):placeholder-shown+span:after,.vot-textfield>textarea:not(:focus):placeholder-shown+span:before,.vot-textfield>textarea:not(:focus):placeholder-shown+span:after{border-top-color:#0000!important}.vot-textfield:hover>input:not(:disabled),.vot-textfield:hover>textarea:not(:disabled){border-color:transparent var(--vot-helper-safari3)var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled)+span:before,.vot-textfield:hover>input:not(:disabled)+span:after,.vot-textfield:hover>textarea:not(:disabled)+span:before,.vot-textfield:hover>textarea:not(:disabled)+span:after{border-top-color:var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled):not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:disabled):not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3)!important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:transparent var(--vot-helper-theme)var(--vot-helper-theme)!important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme)!important;outline:none!important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme)!important}.vot-textfield>input:focus+span:before,.vot-textfield>input:focus+span:after,.vot-textfield>textarea:focus+span:before,.vot-textfield>textarea:focus+span:after{border-top-color:var(--vot-helper-theme)!important;box-shadow:inset 0 1px var(--vot-helper-theme)!important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:transparent var(--vot-helper-safari1)var(--vot-helper-safari1)!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;pointer-events:none!important}.vot-textfield>input:disabled+span:before,.vot-textfield>input:disabled+span:after,.vot-textfield>textarea:disabled+span:before,.vot-textfield>textarea:disabled+span:after,.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1)!important}.vot-textfield>input:disabled:placeholder-shown+span:before,.vot-textfield>input:disabled:placeholder-shown+span:after,.vot-textfield>textarea:disabled:placeholder-shown+span:before,.vot-textfield>textarea:disabled:placeholder-shown+span:after{border-top-color:#0000!important}@media not all and (-webkit-min-device-pixel-ratio:.0000264583),not all and (min-resolution:.001dpcm){@supports ((-webkit-appearance:none)){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{transition-duration:.1s!important}}}.vot-checkbox{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));z-index:0;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-size:16px;line-height:1.5;display:inline-block;position:relative}.vot-checkbox[hidden]{display:none!important}.vot-checkbox>input{appearance:none;z-index:10000;box-sizing:border-box;border:2px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);cursor:pointer;background:0 0;border-radius:2px;outline:none;width:18px;height:18px;margin:3px 1px;transition:border-color .2s,background-color .2s;display:block;position:absolute}.vot-checkbox>input+span{box-sizing:border-box;width:inherit;cursor:pointer;padding-left:30px;font-weight:400;display:inline-block}.vot-checkbox>input+span:before{content:"";background-color:rgb(var(--vot-onsurface-rgb,0,0,0));opacity:0;pointer-events:none;border-radius:50%;width:40px;height:40px;transition:opacity .3s,transform .2s;display:block;position:absolute;top:-8px;left:-10px;transform:scale(1)}.vot-checkbox>input+span:after{content:"";z-index:10000;pointer-events:none;border:0 solid #0000;border-width:0 0 2px 2px;width:10px;height:5px;transition:border-color .2s;display:block;position:absolute;top:3px;left:1px;transform:translate(3px,4px)rotate(-45deg);box-sizing:content-box!important}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:before,.vot-checkbox>input:indeterminate+span:before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:after,.vot-checkbox>input:indeterminate+span:after{border-color:rgb(var(--vot-helper-ontheme,255,255,255))}.vot-checkbox>input:indeterminate+span:after{border-left-width:0;transform:translate(4px,3px)}.vot-checkbox:hover>input+span:before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input{border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);border-color:#0000}.vot-checkbox:active>input+span:before{opacity:1;transition:transform,opacity;transform:scale(0)}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);border-color:#0000}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled+span:before{opacity:0;transform:scale(0)}.vot-slider{display:inline-block;--vot-safari-helper1:rgba(var(--vot-primary-rgb,33,150,243),.04)!important;--vot-safari-helper2:rgba(var(--vot-primary-rgb,33,150,243),.12)!important;--vot-safari-helper3:rgba(var(--vot-primary-rgb,33,150,243),.16)!important;--vot-safari-helper4:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;width:100%!important;font-size:16px!important;line-height:1.5!important}.vot-slider[hidden]{display:none!important}.vot-slider>input{appearance:none!important;cursor:pointer!important;background-color:#0000!important;width:100%!important;height:36px!important;margin:0 0 -36px!important;display:block!important;position:relative!important;top:24px!important}.vot-slider>input:last-child{margin:0!important;position:static!important}.vot-slider>span{margin-bottom:36px!important;display:inline-block!important}.vot-slider>input:disabled{cursor:default!important;opacity:.38!important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input::-webkit-slider-runnable-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-webkit-slider-thumb{appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;margin:0!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1)!important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4)!important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;color:rgb(var(--vot-surface-rgb,255,255,255))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input::-moz-range-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-moz-range-thumb{appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-moz-range-progress{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input::-moz-focus-outer{border:none!important}.vot-slider>input:focus{outline:none!important}.vot-slider>input::-ms-track{box-sizing:border-box!important;background-color:#0000!important;border:none!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important;padding:0 17px!important}.vot-slider>input::-ms-fill-lower{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-fill-upper{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-thumb{appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;margin:0 17px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;opacity:.38!important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:before{content:""!important;width:calc(100%*var(--vot-progress,0))!important;background:rgb(var(--vot-primary-rgb,33,150,243))!important;height:2px!important;display:block!important;position:absolute!important;top:calc(50% - 1px)!important}.vot-select{font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;font-size:14px;font-weight:400;line-height:1.5;display:flex;--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0)!important;--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87)!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-select[hidden]{display:none!important}.vot-select-label{font-size:16px}.vot-select-outer{cursor:pointer;justify-content:space-between;align-items:center;width:120px;max-width:120px;padding:0 5px;display:flex;border-style:solid!important;border-width:1px!important;border-color:var(--vot-helper-safari1)!important;border-radius:4px!important;transition:border .2s!important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2)!important}.vot-select-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vot-select-arrow-icon{justify-content:center;align-items:center;width:20px;height:32px;display:flex}.vot-select-content-list{flex-direction:column;display:flex}.vot-select-content-list .vot-select-content-item{cursor:pointer;border-radius:8px;padding:5px 10px}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb,33,150,243));background-color:rgba(var(--vot-primary-rgb,33,150,243),.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb,33,150,243),.1)!important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none!important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-weight:700;line-height:1.5}.vot-header[hidden]{display:none!important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-size:16px;line-height:1.5;display:flex}.vot-info[hidden]{display:none!important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb),.5);flex:1;margin-left:8px}.vot-details{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;cursor:pointer;border-radius:.5em;justify-content:space-between;align-items:center;margin:0 -.5em;padding:.5em;font-size:16px;line-height:1.5;transition:background .5s;display:flex}.vot-details[hidden]{display:none!important}.vot-details-arrow-icon{fill:rgba(var(--vot-helper-onsurface-rgb),.87);justify-content:center;align-items:center;width:20px;height:32px;display:flex;transform:scale(1.25)rotate(-90deg)}.vot-details:hover{background:rgba(var(--vot-onsurface-rgb,0,0,0),.04)}.vot-lang-select{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;display:flex}.vot-lang-select[hidden]{display:none!important}.vot-lang-select-icon{justify-content:center;align-items:center;width:32px;height:32px;display:flex}.vot-segmented-button{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);-webkit-user-select:none;user-select:none;background:rgb(var(--vot-surface-rgb,255,255,255));color:var(--vot-helper-theme);fill:var(--vot-helper-theme);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;border-radius:4px;align-items:center;max-width:100vw;height:32px;font-size:16px;line-height:1.5;transition:opacity .5s;display:flex;position:absolute;top:5rem;left:50%;overflow:hidden;transform:translate(-50%)}.vot-segmented-button[hidden]{display:none!important}.vot-segmented-button *{box-sizing:border-box!important}.vot-segmented-button .vot-separator{background:rgba(var(--vot-helper-theme-rgb),.1);width:1px;height:50%}.vot-segmented-button .vot-separator[hidden]{display:none!important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{color:inherit;background-color:#0000;border:none;justify-content:center;align-items:center;height:100%;padding:0 8px;transition:background-color .1s ease-in-out;display:flex;position:relative;overflow:hidden}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none!important}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before,.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover:before,.vot-segmented-button .vot-segment-only-icon:hover:before{opacity:.04}.vot-segmented-button .vot-segment:active:after,.vot-segmented-button .vot-segment-only-icon:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{white-space:nowrap;color:inherit;margin-left:8px}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb,33,150,243));fill:rgb(var(--vot-primary-rgb,33,150,243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button[data-loading=true] #vot-loading-icon{display:block!important}.vot-segmented-button[data-loading=true] #vot-translate-icon{display:none!important}.vot-segmented-button[data-direction=column]{flex-direction:column;height:fit-content}.vot-segmented-button[data-direction=column] .vot-segment-label{display:none}.vot-segmented-button[data-direction=column]>.vot-segment-only-icon,.vot-segmented-button[data-direction=column]>.vot-segment{padding:8px}.vot-segmented-button[data-direction=column] .vot-separator{width:50%;height:1px}.vot-segmented-button[data-position=left]{top:12.5vh;left:50px}.vot-segmented-button[data-position=right]{top:12.5vh;left:auto;right:0}.vot-segmented-button svg{width:fit-content}.vot-menu{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);-webkit-user-select:none;user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;visibility:visible;opacity:1;transform-origin:top;border-radius:8px;min-width:300px;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;position:absolute;top:calc(5rem + 48px);left:50%;overflow:hidden;transform:translate(-50%)scale(1)}.vot-menu *{box-sizing:border-box!important}.vot-menu[hidden]{pointer-events:none;visibility:hidden;opacity:0;transform:translate(-50%)scale(0);display:block!important}.vot-menu-content-wrapper{max-height:calc(var(--vot-container-height,75vh) - (5rem + 32px + 16px)*2);flex-direction:column;min-height:100px;display:flex;overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-menu-header-container:empty{padding:0 0 16px}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{font-size:inherit;font-weight:inherit;text-align:start;outline:0;flex:1;margin:0;display:flex}.vot-menu-title{padding-bottom:16px;padding-inline:16px;flex:1;padding-top:16px;font-size:16px;line-height:1}.vot-menu-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:8px;min-height:1.375rem;padding:0 16px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-menu-footer-container{padding-bottom:16px;padding-inline:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-menu-footer-container:empty{padding:16px 0 0}.vot-menu[data-position=left]{top:12.5vh;left:240px}.vot-menu[data-position=right]{top:12.5vh;left:auto;right:-80px}.vot-dialog{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);max-width:initial;max-height:initial;width:min(var(--vot-dialog-width,512px),100%);top:50%;bottom:50%;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);-webkit-user-select:none;user-select:none;visibility:visible;opacity:1;transform-origin:50%;border-radius:8px;height:fit-content;margin:auto;padding:0;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;display:block;position:fixed;inset-block:0;inset-inline:0;overflow:auto hidden;transform:scale(1);box-shadow:0 0 16px #0000001f,0 16px 16px #0000003d}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transition:opacity .1s,transform .2s;transform:scale(.5)}.vot-dialog-container{visibility:visible;z-index:2147483647;position:absolute}.vot-dialog-container[hidden]{pointer-events:none;visibility:hidden;display:block!important}.vot-dialog-container *{box-sizing:border-box!important}.vot-dialog-backdrop{opacity:1;background-color:#0009;transition:opacity .3s;position:fixed;inset:0}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog-content-wrapper{flex-direction:column;max-height:75vh;display:flex;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-dialog-header-container:empty{padding:0 0 20px}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{font-size:inherit;font-weight:inherit;outline:0;flex:1;margin:0;display:flex}.vot-dialog-title{padding-bottom:16px;padding-inline:20px;flex:1;padding-top:20px;font-size:115.385%;font-weight:700;line-height:1}.vot-dialog-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:16px;min-height:1.375rem;padding:0 20px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-dialog-footer-container{padding-bottom:16px;padding-inline:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-dialog-footer-container:empty{padding:20px 0 0}.vot-subtitles-widget{z-index:2147483647;pointer-events:none;justify-content:center;align-items:center;width:50%;min-height:20%;max-height:100%;display:flex;position:absolute;top:75%;left:25%}.vot-subtitles{--vot-subtitles-background:rgba(var(--vot-surface-rgb,46,47,52),var(--vot-subtitles-opacity,.8));background:var(--vot-subtitles-background,#2e2f34cc);color:var(--vot-subtitles-color,#e3e3e3);pointer-events:all;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:.5em;width:max-content;max-width:100%;max-height:100%;padding:.5em;font-size:20px;line-height:normal;position:relative}.vot-subtitles span{-webkit-user-select:text;user-select:text}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color,#2196f3)}:root{--vot-font-family:"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system;--vot-primary-rgb:139,180,245;--vot-onprimary-rgb:32,33,36;--vot-surface-rgb:32,33,36;--vot-onsurface-rgb:227,227,227;--vot-subtitles-color:rgb(var(--vot-onsurface-rgb,227,227,227));--vot-subtitles-passed-color:rgb(var(--vot-primary-rgb,33,150,243))}vot-block{display:block;visibility:visible!important}')},"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n=o(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,n){void 0===n&&(n=!1);var i=t.getVersionPrecision(e),a=t.getVersionPrecision(o),r=Math.max(i,a),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),n=e+new Array(o+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(s=r-Math.min(i,a)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?i-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var u=s.default.find(r,(function(t){return e.isPlatform(t)}));if(u){var c=this.satisfies(o[u]);if(void 0!==c)return c}}if(a>0){var h=Object.keys(i),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),i=s.default.getBrowserTypeByAlias(n);return e&&i&&(n=i.toLowerCase()),n===o},e.compareVersion=function(t){var e=[0],o=t,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(n=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(n=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(i,o,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:a.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=i.default.getWindowsVersionName(e);return{name:a.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:a.OS_MAP.iOS},o=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=i.default.getMacOSVersionName(e),n={name:a.OS_MAP.MacOS,version:e};return o&&(n.versionName=o),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=i.default.getAndroidVersionName(e),n={name:a.OS_MAP.Android,version:e};return o&&(n.versionName=o),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:a.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:a.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:a.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:a.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:a.ENGINE_MAP.Trident},o=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:a.ENGINE_MAP.Presto},o=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:a.ENGINE_MAP.Gecko},o=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:a.ENGINE_MAP.WebKit},o=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,o),a.exports}(()=>{"use strict";var t=o("./node_modules/bowser/es5.js");const e=protobuf;var n;function i(t){switch(t){case 0:case"NO_CONNECTION":return n.NO_CONNECTION;case 10:case"TRANSLATING":return n.TRANSLATING;case 20:case"STREAMING":return n.STREAMING;default:return n.UNRECOGNIZED}}!function(t){t[t.NO_CONNECTION=0]="NO_CONNECTION",t[t.TRANSLATING=10]="TRANSLATING",t[t.STREAMING=20]="STREAMING",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(n||(n={}));const a={encode:(t,o=e.Writer.create())=>(""!==t.target&&o.uint32(10).string(t.target),""!==t.targetUrl&&o.uint32(18).string(t.targetUrl),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={target:"",targetUrl:""};for(;n.pos>>3){case 1:if(10!==t)break;a.target=n.string();continue;case 2:if(18!==t)break;a.targetUrl=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({target:b(t.target)?globalThis.String(t.target):"",targetUrl:b(t.targetUrl)?globalThis.String(t.targetUrl):""}),toJSON(t){const e={};return""!==t.target&&(e.target=t.target),""!==t.targetUrl&&(e.targetUrl=t.targetUrl),e},create:t=>a.fromPartial(t??{}),fromPartial(t){const e={target:"",targetUrl:""};return e.target=t.target??"",e.targetUrl=t.targetUrl??"",e}};const r={encode(t,o=e.Writer.create()){""!==t.url&&o.uint32(26).string(t.url),void 0!==t.deviceId&&o.uint32(34).string(t.deviceId),!1!==t.firstRequest&&o.uint32(40).bool(t.firstRequest),0!==t.duration&&o.uint32(49).double(t.duration),0!==t.unknown0&&o.uint32(56).int32(t.unknown0),""!==t.language&&o.uint32(66).string(t.language),!1!==t.forceSourceLang&&o.uint32(72).bool(t.forceSourceLang),0!==t.unknown1&&o.uint32(80).int32(t.unknown1);for(const e of t.translationHelp)a.encode(e,o.uint32(90).fork()).ldelim();return""!==t.responseLanguage&&o.uint32(114).string(t.responseLanguage),0!==t.unknown2&&o.uint32(120).int32(t.unknown2),0!==t.unknown3&&o.uint32(128).int32(t.unknown3),!1!==t.bypassCache&&o.uint32(136).bool(t.bypassCache),o},decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const r={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1};for(;n.pos>>3){case 3:if(26!==t)break;r.url=n.string();continue;case 4:if(34!==t)break;r.deviceId=n.string();continue;case 5:if(40!==t)break;r.firstRequest=n.bool();continue;case 6:if(49!==t)break;r.duration=n.double();continue;case 7:if(56!==t)break;r.unknown0=n.int32();continue;case 8:if(66!==t)break;r.language=n.string();continue;case 9:if(72!==t)break;r.forceSourceLang=n.bool();continue;case 10:if(80!==t)break;r.unknown1=n.int32();continue;case 11:if(90!==t)break;r.translationHelp.push(a.decode(n,n.uint32()));continue;case 14:if(114!==t)break;r.responseLanguage=n.string();continue;case 15:if(120!==t)break;r.unknown2=n.int32();continue;case 16:if(128!==t)break;r.unknown3=n.int32();continue;case 17:if(136!==t)break;r.bypassCache=n.bool();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return r},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",deviceId:b(t.deviceId)?globalThis.String(t.deviceId):void 0,firstRequest:!!b(t.firstRequest)&&globalThis.Boolean(t.firstRequest),duration:b(t.duration)?globalThis.Number(t.duration):0,unknown0:b(t.unknown0)?globalThis.Number(t.unknown0):0,language:b(t.language)?globalThis.String(t.language):"",forceSourceLang:!!b(t.forceSourceLang)&&globalThis.Boolean(t.forceSourceLang),unknown1:b(t.unknown1)?globalThis.Number(t.unknown1):0,translationHelp:globalThis.Array.isArray(t?.translationHelp)?t.translationHelp.map((t=>a.fromJSON(t))):[],responseLanguage:b(t.responseLanguage)?globalThis.String(t.responseLanguage):"",unknown2:b(t.unknown2)?globalThis.Number(t.unknown2):0,unknown3:b(t.unknown3)?globalThis.Number(t.unknown3):0,bypassCache:!!b(t.bypassCache)&&globalThis.Boolean(t.bypassCache)}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),void 0!==t.deviceId&&(e.deviceId=t.deviceId),!1!==t.firstRequest&&(e.firstRequest=t.firstRequest),0!==t.duration&&(e.duration=t.duration),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.language&&(e.language=t.language),!1!==t.forceSourceLang&&(e.forceSourceLang=t.forceSourceLang),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),t.translationHelp?.length&&(e.translationHelp=t.translationHelp.map((t=>a.toJSON(t)))),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),0!==t.unknown3&&(e.unknown3=Math.round(t.unknown3)),!1!==t.bypassCache&&(e.bypassCache=t.bypassCache),e},create:t=>r.fromPartial(t??{}),fromPartial(t){const e={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1};return e.url=t.url??"",e.deviceId=t.deviceId??void 0,e.firstRequest=t.firstRequest??!1,e.duration=t.duration??0,e.unknown0=t.unknown0??0,e.language=t.language??"",e.forceSourceLang=t.forceSourceLang??!1,e.unknown1=t.unknown1??0,e.translationHelp=t.translationHelp?.map((t=>a.fromPartial(t)))||[],e.responseLanguage=t.responseLanguage??"",e.unknown2=t.unknown2??0,e.unknown3=t.unknown3??0,e.bypassCache=t.bypassCache??!1,e}};const s={encode:(t,o=e.Writer.create())=>(void 0!==t.url&&o.uint32(10).string(t.url),void 0!==t.duration&&o.uint32(17).double(t.duration),0!==t.status&&o.uint32(32).int32(t.status),void 0!==t.remainingTime&&o.uint32(40).int32(t.remainingTime),void 0!==t.unknown0&&o.uint32(48).int32(t.unknown0),""!==t.translationId&&o.uint32(58).string(t.translationId),void 0!==t.language&&o.uint32(66).string(t.language),void 0!==t.message&&o.uint32(74).string(t.message),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(17!==t)break;a.duration=n.double();continue;case 4:if(32!==t)break;a.status=n.int32();continue;case 5:if(40!==t)break;a.remainingTime=n.int32();continue;case 6:if(48!==t)break;a.unknown0=n.int32();continue;case 7:if(58!==t)break;a.translationId=n.string();continue;case 8:if(66!==t)break;a.language=n.string();continue;case 9:if(74!==t)break;a.message=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):void 0,duration:b(t.duration)?globalThis.Number(t.duration):void 0,status:b(t.status)?globalThis.Number(t.status):0,remainingTime:b(t.remainingTime)?globalThis.Number(t.remainingTime):void 0,unknown0:b(t.unknown0)?globalThis.Number(t.unknown0):void 0,translationId:b(t.translationId)?globalThis.String(t.translationId):"",language:b(t.language)?globalThis.String(t.language):void 0,message:b(t.message)?globalThis.String(t.message):void 0}),toJSON(t){const e={};return void 0!==t.url&&(e.url=t.url),void 0!==t.duration&&(e.duration=t.duration),0!==t.status&&(e.status=Math.round(t.status)),void 0!==t.remainingTime&&(e.remainingTime=Math.round(t.remainingTime)),void 0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translationId&&(e.translationId=t.translationId),void 0!==t.language&&(e.language=t.language),void 0!==t.message&&(e.message=t.message),e},create:t=>s.fromPartial(t??{}),fromPartial(t){const e={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};return e.url=t.url??void 0,e.duration=t.duration??void 0,e.status=t.status??0,e.remainingTime=t.remainingTime??void 0,e.unknown0=t.unknown0??void 0,e.translationId=t.translationId??"",e.language=t.language??void 0,e.message=t.message??void 0,e}};const l={encode:(t,o=e.Writer.create())=>(""!==t.language&&o.uint32(10).string(t.language),""!==t.url&&o.uint32(18).string(t.url),0!==t.unknown0&&o.uint32(24).int32(t.unknown0),""!==t.translatedLanguage&&o.uint32(34).string(t.translatedLanguage),""!==t.translatedUrl&&o.uint32(42).string(t.translatedUrl),0!==t.unknown1&&o.uint32(48).int32(t.unknown1),0!==t.unknown2&&o.uint32(56).int32(t.unknown2),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};for(;n.pos>>3){case 1:if(10!==t)break;a.language=n.string();continue;case 2:if(18!==t)break;a.url=n.string();continue;case 3:if(24!==t)break;a.unknown0=n.int32();continue;case 4:if(34!==t)break;a.translatedLanguage=n.string();continue;case 5:if(42!==t)break;a.translatedUrl=n.string();continue;case 6:if(48!==t)break;a.unknown1=n.int32();continue;case 7:if(56!==t)break;a.unknown2=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({language:b(t.language)?globalThis.String(t.language):"",url:b(t.url)?globalThis.String(t.url):"",unknown0:b(t.unknown0)?globalThis.Number(t.unknown0):0,translatedLanguage:b(t.translatedLanguage)?globalThis.String(t.translatedLanguage):"",translatedUrl:b(t.translatedUrl)?globalThis.String(t.translatedUrl):"",unknown1:b(t.unknown1)?globalThis.Number(t.unknown1):0,unknown2:b(t.unknown2)?globalThis.Number(t.unknown2):0}),toJSON(t){const e={};return""!==t.language&&(e.language=t.language),""!==t.url&&(e.url=t.url),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translatedLanguage&&(e.translatedLanguage=t.translatedLanguage),""!==t.translatedUrl&&(e.translatedUrl=t.translatedUrl),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),e},create:t=>l.fromPartial(t??{}),fromPartial(t){const e={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};return e.language=t.language??"",e.url=t.url??"",e.unknown0=t.unknown0??0,e.translatedLanguage=t.translatedLanguage??"",e.translatedUrl=t.translatedUrl??"",e.unknown1=t.unknown1??0,e.unknown2=t.unknown2??0,e}};const d={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:"",language:""};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(18!==t)break;a.language=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",language:b(t.language)?globalThis.String(t.language):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),e},create:t=>d.fromPartial(t??{}),fromPartial(t){const e={url:"",language:""};return e.url=t.url??"",e.language=t.language??"",e}};const u={encode(t,o=e.Writer.create()){!1!==t.waiting&&o.uint32(8).bool(t.waiting);for(const e of t.subtitles)l.encode(e,o.uint32(18).fork()).ldelim();return o},decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={waiting:!1,subtitles:[]};for(;n.pos>>3){case 1:if(8!==t)break;a.waiting=n.bool();continue;case 2:if(18!==t)break;a.subtitles.push(l.decode(n,n.uint32()));continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({waiting:!!b(t.waiting)&&globalThis.Boolean(t.waiting),subtitles:globalThis.Array.isArray(t?.subtitles)?t.subtitles.map((t=>l.fromJSON(t))):[]}),toJSON(t){const e={};return!1!==t.waiting&&(e.waiting=t.waiting),t.subtitles?.length&&(e.subtitles=t.subtitles.map((t=>l.toJSON(t)))),e},create:t=>u.fromPartial(t??{}),fromPartial(t){const e={waiting:!1,subtitles:[]};return e.waiting=t.waiting??!1,e.subtitles=t.subtitles?.map((t=>l.fromPartial(t)))||[],e}};const c={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.timestamp&&o.uint32(18).string(t.timestamp),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:"",timestamp:""};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(18!==t)break;a.timestamp=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",timestamp:b(t.timestamp)?globalThis.String(t.timestamp):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.timestamp&&(e.timestamp=t.timestamp),e},create:t=>c.fromPartial(t??{}),fromPartial(t){const e={url:"",timestamp:""};return e.url=t.url??"",e.timestamp=t.timestamp??"",e}};const h={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),""!==t.responseLanguage&&o.uint32(26).string(t.responseLanguage),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:"",language:"",responseLanguage:""};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(18!==t)break;a.language=n.string();continue;case 3:if(26!==t)break;a.responseLanguage=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",language:b(t.language)?globalThis.String(t.language):"",responseLanguage:b(t.responseLanguage)?globalThis.String(t.responseLanguage):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),e},create:t=>h.fromPartial(t??{}),fromPartial(t){const e={url:"",language:"",responseLanguage:""};return e.url=t.url??"",e.language=t.language??"",e.responseLanguage=t.responseLanguage??"",e}};const p={encode:(t,o=e.Writer.create())=>(0!==t.interval&&o.uint32(8).int32(t.interval),void 0!==t.translatedInfo&&c.encode(t.translatedInfo,o.uint32(18).fork()).ldelim(),void 0!==t.pingId&&o.uint32(24).int32(t.pingId),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={interval:0,translatedInfo:void 0,pingId:void 0};for(;n.pos>>3){case 1:if(8!==t)break;a.interval=n.int32();continue;case 2:if(18!==t)break;a.translatedInfo=c.decode(n,n.uint32());continue;case 3:if(24!==t)break;a.pingId=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({interval:b(t.interval)?i(t.interval):0,translatedInfo:b(t.translatedInfo)?c.fromJSON(t.translatedInfo):void 0,pingId:b(t.pingId)?globalThis.Number(t.pingId):void 0}),toJSON(t){const e={};return 0!==t.interval&&(e.interval=function(t){switch(t){case n.NO_CONNECTION:return"NO_CONNECTION";case n.TRANSLATING:return"TRANSLATING";case n.STREAMING:return"STREAMING";case n.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(t.interval)),void 0!==t.translatedInfo&&(e.translatedInfo=c.toJSON(t.translatedInfo)),void 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>p.fromPartial(t??{}),fromPartial(t){const e={interval:0,translatedInfo:void 0,pingId:void 0};return e.interval=t.interval??0,e.translatedInfo=void 0!==t.translatedInfo&&null!==t.translatedInfo?c.fromPartial(t.translatedInfo):void 0,e.pingId=t.pingId??void 0,e}};const g={encode:(t,o=e.Writer.create())=>(0!==t.pingId&&o.uint32(8).int32(t.pingId),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={pingId:0};for(;n.pos>>3){case 1:if(8!==t)break;a.pingId=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({pingId:b(t.pingId)?globalThis.Number(t.pingId):0}),toJSON(t){const e={};return 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>g.fromPartial(t??{}),fromPartial(t){const e={pingId:0};return e.pingId=t.pingId??0,e}};const v={encode:(t,o=e.Writer.create())=>(""!==t.uuid&&o.uint32(10).string(t.uuid),""!==t.module&&o.uint32(18).string(t.module),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={uuid:"",module:""};for(;n.pos>>3){case 1:if(10!==t)break;a.uuid=n.string();continue;case 2:if(18!==t)break;a.module=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({uuid:b(t.uuid)?globalThis.String(t.uuid):"",module:b(t.module)?globalThis.String(t.module):""}),toJSON(t){const e={};return""!==t.uuid&&(e.uuid=t.uuid),""!==t.module&&(e.module=t.module),e},create:t=>v.fromPartial(t??{}),fromPartial(t){const e={uuid:"",module:""};return e.uuid=t.uuid??"",e.module=t.module??"",e}};const m={encode:(t,o=e.Writer.create())=>(""!==t.secretKey&&o.uint32(10).string(t.secretKey),0!==t.expires&&o.uint32(16).int32(t.expires),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={secretKey:"",expires:0};for(;n.pos>>3){case 1:if(10!==t)break;a.secretKey=n.string();continue;case 2:if(16!==t)break;a.expires=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({secretKey:b(t.secretKey)?globalThis.String(t.secretKey):"",expires:b(t.expires)?globalThis.Number(t.expires):0}),toJSON(t){const e={};return""!==t.secretKey&&(e.secretKey=t.secretKey),0!==t.expires&&(e.expires=Math.round(t.expires)),e},create:t=>m.fromPartial(t??{}),fromPartial(t){const e={secretKey:"",expires:0};return e.secretKey=t.secretKey??"",e.expires=t.expires??0,e}};function b(t){return null!=t}const f={encodeTranslationRequest:(t,e,o,n,i)=>r.encode({url:t,firstRequest:!0,duration:e,unknown0:1,language:o,forceSourceLang:!1,unknown1:0,translationHelp:i||[],responseLanguage:n,unknown2:0,unknown3:1,bypassCache:!1}).finish(),decodeTranslationResponse:t=>s.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>d.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>u.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>g.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>h.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>p.decode(new Uint8Array(t)),encodeYandexSessionRequest:(t,e)=>v.encode({uuid:t,module:e}).finish(),decodeYandexSessionResponse:t=>m.decode(new Uint8Array(t))},y={host:"api.browser.yandex.ru",hostVOT:"vot-api.toil.cc/v1",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 YaBrowser/24.7.0.0 Safari/537.36",componentVersion:"24.7.0.2377",hmac:"bt8xH3VOlb4mqf0nqAibnDOoiPlXsisf",defaultDuration:343},w=new TextEncoder;async function x(t,e,o){const n=await crypto.subtle.importKey("raw",w.encode(e),{name:"HMAC",hash:{name:t}},!1,["sign","verify"]);return await crypto.subtle.sign("HMAC",n,o)}async function S(t){const e=await x("SHA-256",y.hmac,t);return new Uint8Array(e).reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),"")}var k,T;async function V(t,e={headers:{"User-Agent":y.userAgent}}){const{timeout:o=3e3,...n}=e,i=new AbortController,a=setTimeout((()=>i.abort()),o),r=await fetch(t,{signal:i.signal,...n});return clearTimeout(a),r}!function(t){t.custom="custom",t.directlink="custom",t.youtube="youtube",t.piped="piped",t.invidious="invidious",t.vk="vk",t.nine_gag="nine_gag",t.gag="nine_gag",t.twitch="twitch",t.proxitok="proxitok",t.tiktok="tiktok",t.vimeo="vimeo",t.xvideos="xvideos",t.pornhub="pornhub",t.twitter="twitter",t.rumble="rumble",t.facebook="facebook",t.rutube="rutube",t.coub="coub",t.bilibili="bilibili",t.mail_ru="mailru",t.mailru="mailru",t.bitchute="bitchute",t.eporner="eporner",t.peertube="peertube",t.dailymotion="dailymotion",t.trovo="trovo",t.yandexdisk="yandexdisk",t.ok_ru="okru",t.okru="okru",t.googledrive="googledrive",t.bannedvideo="bannedvideo",t.weverse="weverse",t.newgrounds="newgrounds",t.egghead="egghead",t.youku="youku",t.archive="archive",t.kodik="kodik",t.patreon="patreon",t.reddit="reddit",t.kick="kick",t.apple_developer="apple_developer",t.appledeveloper="apple_developer",t.poketube="poketube",t.epicgames="epicgames",t.nineanimetv="nineanimetv",t.odysee="odysee",t.coursehunter="coursehunter",t.udemy="udemy",t.coursera="coursera"}(k||(k={})),function(t){t[t.FAILED=0]="FAILED",t[t.FINISHED=1]="FINISHED",t[t.WAITING=2]="WAITING",t[t.LONG_WAITING=3]="LONG_WAITING",t[t.PART_CONTENT=5]="PART_CONTENT",t[t.LONG_WAITING_2=6]="LONG_WAITING_2"}(T||(T={}));const L=["yewtu.be","yt.artemislena.eu","invidious.flokinet.to","iv.melmac.space","inv.nadeko.net","inv.tux.pizza","invidious.private.coffee","yt.drgnz.club","vid.puffyan.us","invidious.dhusch.de"],M=["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],A=[{additionalData:"mobile",host:k.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:k.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:".player-container"},{host:k.youtube,url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:k.invidious,url:"https://youtu.be/",match:L,selector:"#player"},{host:k.piped,url:"https://youtu.be/",match:M,selector:".shaka-video-container"},{host:k.poketube,url:"https://youtu.be/",match:["poketube.fun","pt.sudovanilla.org","poke.ggtyler.dev","poke.uk2.littlekai.co.uk","poke.blahai.gay"],selector:".video-player-container"},{additionalData:"mobile",host:k.vk,url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{additionalData:"clips",host:k.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:'div[data-testid="clipcontainer-video"]'},{host:k.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:k.nine_gag,url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:k.twitch,url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^(www.)?twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:k.proxitok,url:"https://www.tiktok.com/",match:["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],selector:".column.has-text-centered"},{host:k.tiktok,url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:k.vimeo,url:"https://vimeo.com/",match:/^vimeo.com$/,selector:".player"},{host:k.vimeo,url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,selector:".player"},{host:k.xvideos,url:"https://www.xvideos.com/",match:/^(www.)?(xvideos|xv-ru).com$/,selector:".video-bg-pic"},{host:k.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div"},{additionalData:"embed",host:k.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{host:k.twitter,url:"https://twitter.com/i/status/",match:/^(twitter|x).com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div'},{host:k.rumble,url:"https://rumble.com/",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:k.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[role="main"] div[data-pagelet$="video" i]'},{additionalData:"reels",host:k.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]'},{host:k.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:k.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:k.bilibili,url:"https://www.bilibili.com/video/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:k.bilibili,url:"https://www.bilibili.com/video/",match:/^(www|m).bilibili.com$/,selector:null},{host:k.mailru,url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:k.bitchute,url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:".video-js"},{host:k.eporner,url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:k.peertube,url:"stub",match:["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf","peertube.su","video.blender.org","videos.viorsan.com","tube-sciences-technologies.apps.education.fr","tube-numerique-educatif.apps.education.fr","tube-arts-lettres-sciences-humaines.apps.education.fr","beetoons.tv","comics.peertube.biz","makertube.net"],selector:".vjs-v7"},{host:k.dailymotion,url:"https://dai.ly/",match:/^geo([\d]+)?.dailymotion.com$/,selector:".player"},{host:k.trovo,url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:k.yandexdisk,url:"https://yadi.sk/i/",match:/^disk.yandex.ru$/,selector:".video-player__player > div:nth-child(1)"},{host:k.okru,url:"https://ok.ru/video/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:k.googledrive,url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:k.bannedvideo,url:"https://madmaxworld.tv/watch?id=",match:/^(www.)?banned.video|madmaxworld.tv$/,selector:".vjs-v7",needExtraData:!0},{host:k.weverse,url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper",needExtraData:!0},{host:k.newgrounds,url:"https://www.newgrounds.com/",match:/^(www.)?newgrounds.com$/,selector:".ng-video-player"},{host:k.egghead,url:"https://egghead.io/",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:k.youku,url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"},{host:k.archive,url:"https://archive.org/details/",match:/^archive.org$/,selector:".jw-media"},{host:k.kodik,url:"stub",match:/^kodik.(info|biz|cc)$/,selector:".fp-player",needExtraData:!0},{host:k.patreon,url:"stub",match:/^(www.)?patreon.com$/,selector:'div[data-tag="post-card"] div[elevation="subtle"] > div > div > div > div',needExtraData:!0},{host:k.reddit,url:"stub",match:/^(www.|new.|old.)?reddit.com$/,selector:".reddit-video-player-root",needExtraData:!0},{host:k.kick,url:"https://kick.com/",match:/^kick.com$/,selector:".vjs-v8",needExtraData:!0},{host:k.appledeveloper,url:"https://developer.apple.com/",match:/^developer.apple.com$/,selector:".developer-video-player",needExtraData:!0},{host:k.epicgames,url:"https://dev.epicgames.com/community/learning/",match:/^dev.epicgames.com$/,selector:".vjs-v7",needExtraData:!0},{host:k.nineanimetv,url:"https://9animetv.to/watch/",match:/^rapid-cloud.co$/,selector:".jw-media",needExtraData:!0},{host:k.odysee,url:"stub",match:/^odysee.com$/,selector:".vjs-v7",needExtraData:!0},{host:k.coursehunter,url:"https://coursehunter.net/course/",match:/^coursehunter.net$/,selector:"#oframeplayer > pjsdiv:nth-of-type(1)",needExtraData:!0},{host:k.udemy,url:"https://www.udemy.com/",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)',needExtraData:!0},{host:k.coursera,url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v6",needExtraData:!0},{host:k.custom,url:"stub",match:t=>/([^.]+).mp4/.test(t.pathname),rawResult:!0}],O=JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTMediaCSPError":"Failed to load audio (media csp error)","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})"}'),I={log:(...t)=>{}},C=I,P=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,C.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0,o=!1){if(this.gmSupport)return GM_getValue(t,e);const n=window.localStorage.getItem(t)??e;return o?Number(n):n}async get(t,e=void 0,o=!1){return this.gmSupport?await GM_getValue(t,e):Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):window.localStorage.setItem(t,e)}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","autoVolume","buttonPos","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","audioProxy","showPiPButton","translateAPIErrors","translationService","detectService","m3u8ProxyHost","translateProxyEnabled","hotkeyButton","proxyWorkerHost","audioBooster","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}},E=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],_=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-version","locale-lang-override"];constructor(){const t=P.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(P.syncGet("locale-phrases",""))}reset(){for(let t=0;t{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale(O,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale(O,t)??t}},N=navigator.language||navigator.userLanguage,$=N?.substr(0,2)?.toLowerCase()??"en";function R(t){return t.toLowerCase().split(/[_;-]/)[0].trim()}function B(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function D(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}const F=new RegExp([/(?:https?|ftp):\/\/\S+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/0x[a-fA-F0-9]{40}/g,/[13][a-km-zA-HJ-NP-Z1-9]{25,34}/g,/4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}/g,/Paypal/g].map((t=>t.source)).join("|"));async function q(t,e={}){const{timeout:o=15e3,...n}=e,i=new AbortController,a=setTimeout((()=>i.abort()),o);try{if(t.includes("api.browser.yandex.ru"))throw new Error("Preventing yandex cors");const e=await fetch(t,{signal:i.signal,...n});return clearTimeout(a),e}catch(e){return C.log("GM_fetch preventing cors by GM_xmlhttpRequest",e.message),new Promise(((e,i)=>{clearTimeout(a),GM_xmlhttpRequest({method:n.method||"GET",url:t,responseType:"blob",...n,data:n.body,timeout:o,onload:t=>{const o=Object.fromEntries(t.responseHeaders.trim().split(/\r?\n/).map((t=>t.split(/: (.+)/))).filter((([t])=>t&&/^[\w-]+$/.test(t))));e(new Response(t.response,{status:t.status,headers:o}))},ontimeout:()=>i(new Error("Timeout")),onerror:t=>i(t),onabort:()=>i(new Error("AbortError"))})}))}}class H extends Error{constructor(t){super(t),this.name="VideoHelper",this.message=t}}class z{API_ORIGIN="https://example.com";fetch;constructor({fetchFn:t=q}={}){this.fetch=t}async getVideoData(t){}async getVideoId(t){}}class U extends z{API_ORIGIN="https://my.mail.ru";async getVideoMeta(t){try{const e=await this.fetch(`${this.API_ORIGIN}/+/video/meta/${t}?xemail=&ajax_call=1&func_name=&mna=&mnb=&ext=1&_=${(new Date).getTime()}`);return await e.json()}catch(t){return void console.error("Failed to get mail.ru video data",t.message)}}async getVideoId(t){const e=t.pathname;if(/\/(v|mail|bk|inbox)\//.exec(e))return e.slice(1);const o=/video\/embed\/([^/]+)/.exec(e)?.[1];if(!o)return;const n=await this.getVideoMeta(o);return n?n.meta.url.replace("//my.mail.ru/",""):void 0}}class G extends z{API_ORIGIN="https://global.apis.naver.com/weverse/wevweb";API_APP_ID="be4d79eb8fc7bd008ee82c8ec4ff6fd4";API_HMAC_KEY="1b9cb6378d959b45714bec49971ade22e6e24e42";HEADERS={Accept:"application/json, text/plain, */*",Origin:"https://weverse.io",Referer:"https://weverse.io/"};getURLData(){return{appId:this.API_APP_ID,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}async createHash(t){const e=Date.now(),o=t.substring(0,Math.min(255,t.length))+e,n=await async function(t,e){try{const o=w.encode(e),n=await x("SHA-1",t,o);return btoa(String.fromCharCode(...new Uint8Array(n)))}catch(t){return console.error(t),!1}}(this.API_HMAC_KEY,o);if(!n)throw new H("Failed to get weverse HMAC signature");return{wmsgpad:e.toString(),wmd:n}}async getHashURLParams(t){const e=await this.createHash(t);return new URLSearchParams(e).toString()}async getPostPreview(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{headers:this.HEADERS});return await o.json()}catch(e){return console.error(`Failed to get weverse post preview by postId: ${t}`,e.message),!1}}async getVideoInKey(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{method:"POST",headers:this.HEADERS});return await o.json()}catch(e){return console.error(`Failed to get weverse InKey by videoId: ${t}`,e.message),!1}}async getVideoInfo(t,e,o){const n=Date.now();try{const i=new URLSearchParams({key:e,sid:o,nonce:n.toString(),devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:JSON.stringify([{adSystem:null}]),adu:"/"}).toString(),a=await this.fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+i,{headers:this.HEADERS});return await a.json()}catch(n){return console.error(`Failed to get weverse video info (infraVideoId: ${t}, inkey: ${e}, serviceId: ${o}`,n.message),!1}}extractVideoInfo(t){return t.find((t=>!1===t.useP2P&&t.source.includes(".mp4")))}async getVideoData(t){const e=await this.getPostPreview(t);if(!e)return;const{videoId:o,serviceId:n,infraVideoId:i}=e.extension.video;if(!(o&&n&&i))return;const a=await this.getVideoInKey(o);if(!a)return;const r=await this.getVideoInfo(i,a.inKey,n);if(!r)return;const s=this.extractVideoInfo(r.videos.list);return s?{url:s.source,duration:s.duration}:void 0}async getVideoId(t){return/([^/]+)\/(live|media)\/([^/]+)/.exec(t.pathname)?.[3]}}class W extends z{API_ORIGIN=window.location.origin;async getSecureData(t){try{const e=await this.fetch(`${this.API_ORIGIN}${t}`,{headers:{"User-Agent":y.userAgent,Origin:this.API_ORIGIN,Referer:this.API_ORIGIN}}),o=await e.text(),[n,i,a]=t.split("/").filter((t=>t)),r=(new DOMParser).parseFromString(o,"text/html"),s=Array.from(r.getElementsByTagName("script")).filter((t=>t.innerHTML.includes(`videoId = "${i}"`)));if(!s.length)throw new H("Failed to find secure script");const l=/'{[^']+}'/.exec(s[0].textContent.trim())?.[0];if(!l)throw new H("Secure json wasn't found in secure script");const d=JSON.parse(l.replaceAll("'",""));return{videoType:n,videoId:i,hash:a,...d}}catch(e){return console.error(`Failed to get kodik secure data by videoPath: ${t}.`,e.message),!1}}async getFtor(t){const{videoType:e,videoId:o,hash:n,d:i,d_sign:a,pd:r,pd_sign:s,ref:l,ref_sign:d}=t;try{const t=await this.fetch(this.API_ORIGIN+"/ftor",{method:"POST",headers:{"User-Agent":y.userAgent,Origin:this.API_ORIGIN,Referer:`${this.API_ORIGIN}/${e}/${o}/${n}/360p`},body:new URLSearchParams({d:i,d_sign:a,pd:r,pd_sign:s,ref:decodeURIComponent(l),ref_sign:d,bad_user:"false",cdn_is_working:"true",info:"{}",type:e,hash:n,id:o})});return await t.json()}catch(t){return console.error(`Failed to get kodik video data (type: ${e}, id: ${o}, hash: ${n})`,t.message),!1}}decryptUrl(t){return"https:"+atob(t.replace(/[a-zA-Z]/g,(function(t){const e=t.charCodeAt(0)+13;return String.fromCharCode((t<="Z"?90:122)>=e?e:e-26)})))}async getVideoData(t){const e=await this.getSecureData(t);if(!e)return;const o=await this.getFtor(e);if(!o)return;const n=Object.entries(o.links[o.default.toString()]),i=n.find((([t,e])=>"application/x-mpegURL"===e.type))?.[1];return i?{url:this.decryptUrl(i.src)}:void 0}async getVideoId(t){return/\/(seria|video)\/([^/]+)\/([^/]+)\/([\d]+)p/.exec(t.pathname)?.[0]}}class j extends z{API_ORIGIN="https://www.patreon.com/api";async getPosts(t){try{const e=await this.fetch(`${this.API_ORIGIN}/posts/${t}?json-api-use-default-includes=false`);return await e.json()}catch(e){return console.error(`Failed to get patreon posts by postId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPosts(t);if(!e)return;const o=e.data.attributes.post_file.url;return o?{url:o}:void 0}async getVideoId(t){const e=/posts\/([^/]+)/.exec(t.pathname)?.[1];if(e)return e.replace(/[^\d.]/g,"")}}class Y extends z{API_ORIGIN="https://www.reddit.com";async getVideoData(t){const e=document.querySelector("[data-hls-url]")?.dataset.hlsUrl.replaceAll("&","&");if(e)return{url:decodeURIComponent(e)}}async getVideoId(t){return/\/r\/(([^/]+)\/([^/]+)\/([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}}class J extends z{API_ORIGIN="https://api.banned.video";async getVideoInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/graphql`,{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n title\n description: summary\n duration: videoDuration\n videoUrl: directUrl\n isStream: live\n }\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}});return await e.json()}catch(e){return console.error(`Failed to get bannedvideo video info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getVideoInfo(t);if(!e)return;const{videoUrl:o,duration:n,isStream:i,description:a,title:r}=e.data.getVideo;return{url:o,duration:n,isStream:i,title:r,description:a}}async getVideoId(t){return t.searchParams.get("id")??void 0}}class K extends z{API_ORIGIN="https://kick.com/api/v2";async getClipInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/clips/${t}`);return await e.json()}catch(e){return console.error(`Failed to get kick clip info by clipId: ${t}.`,e.message),!1}}async getVideoData(t){if(!t.startsWith("clip_"))return{url:A.find((t=>t.host===k.kick)).url+t};const e=await this.getClipInfo(t);if(!e)return;const{clip_url:o,duration:n,title:i}=e.clip;return{url:o,duration:n,title:i}}async getVideoId(t){const e=/video\/([^/]+)/.exec(t.pathname)?.[0];if(e)return e;const o=t.searchParams.get("clip");if(o)return o;const n=document.getElementById("clip-video-player");return/clip_([^/]+)/.exec(n?.getAttribute("poster"))?.[0]}}class Z extends z{API_ORIGIN="https://developer.apple.com";async getVideoData(t){const e=document.querySelector("meta[property='og:video']")?.content;if(e)return{url:e}}async getVideoId(t){return/videos\/play\/([^/]+)\/([\d]+)/.exec(t.pathname)?.[0]}}class Q extends z{API_ORIGIN="https://dev.epicgames.com/community/api/learning";async getPostInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/post.json?hash_id=${t}`);return await e.json()}catch(e){return console.error(`Failed to get epicgames post info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPostInfo(t);if(!e)return;const o=e.blocks.find((t=>"video"===t.type))?.video_url?.replace("qsep://","https://");return o?{url:o}:void 0}async getVideoId(t){return/\/(\w{3,5})\/[^/]+$/.exec(t.pathname)?.[1]}}class X extends z{API_ORIGIN="https://9animetv.to/ajax/episode";RAPID_CLOUD_ORIGIN="https://rapid-cloud.co/ajax/embed-6-v2";async getSourceId(t){try{const e=await this.fetch(`${this.API_ORIGIN}/servers?episodeId=${t}`),o=await e.json();return!!o.html&&/data-id="(\d+)"/.exec(o.html)?.[1]}catch(e){return console.error(`Failed to get 9animetv servers info by episodeId: ${t}.`,e.message),!1}}async getPlayerLink(t){try{const e=await this.fetch(`${this.API_ORIGIN}/sources?id=${t}`),o=await e.json();return!!o.link.includes("rapid-cloud.co")&&o.link}catch(e){return console.error(`Failed to get player link by sourceId: ${t}.`,e.message),!1}}async getRapidCloudData(t){try{const e=await this.fetch(`${this.RAPID_CLOUD_ORIGIN}/getSources?id=${t}`),o=await e.json();return o.encrypted?(console.warn("Encrypted RapidCloud data found. Let us know about it",o),!1):o}catch(e){return console.error(`Failed to get rapid cloud data by rapidId: ${t}.`,e.message),!1}}async getVideoData(t){const e=t.split("?ep=")[1],o=await this.getSourceId(e);if(!o)return;const n=await this.getPlayerLink(o);if(!n)return;const i=/\/([^/?]+)\?/.exec(n)?.[1];if(!i)return;const a=await this.getRapidCloudData(i);if(!a)return;const r=a.sources.find((t=>"hls"===t.type))?.file;return r?{url:r}:void 0}async getVideoId(t){return new Promise((t=>{const e="https://9animetv.to";window.addEventListener("message",(o=>{o.origin===e&&o.data?.startsWith("getVideoId:")&&t(o.data.replace("getVideoId:",""))})),window.top.postMessage("getVideoId",e)}))}}class tt extends z{API_ORIGIN="https://odysee.com";async getVideoData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/${t}`),o=await e.text();return{url:/"contentUrl":(\s)?"([^"]+)"/.exec(o)?.[2]}}catch(t){return void console.error("Failed to get odysee video data",t.message)}}async getVideoId(t){return t.pathname.slice(1)}}class et extends z{API_ORIGIN="https://coursehunter.net/api/v1";getCourseId(t){return window.course_id??+document.querySelector('input[name="course_id"]')?.value}async getLessonsData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/course/${t}/lessons`);return await e.json()}catch(e){return console.error(`Failed to get Coursehunter lessons data by courseId: ${t}`,e.message),!1}}async getVideoData(t){const e=this.getCourseId(t);if(!e)return;const o=window.lessons??await this.getLessonsData(e);if(!o)return;const n=+(t.split("?lesson=")?.[1]??document.querySelector(".lessons-item_active")?.dataset?.index??1),i=o?.[n-1],{file:a,duration:r,title:s}=i;return a?{url:a,duration:r,title:s}:void 0}async getVideoId(t){const e=/\/course\/([^/]+)/.exec(t.pathname)?.[1];return e?e+t.search:void 0}}class ot extends z{API_ORIGIN="https://clips.twitch.tv";async getClipLink(t,e){const o=document.querySelector("script[type='application/ld+json']"),n=t.slice(1);if(o){const t=JSON.parse(o.innerText),e=t["@graph"].find((t=>"VideoObject"===t["@type"]))?.creator.url;return`${e.replace("https://www.twitch.tv/","")}/clip/${n}`}const i="embed"===n,a=document.querySelector(i?".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']":".clips-player a:not([class])");if(!a)return;return`${a.href.replace("https://www.twitch.tv/","")}/clip/${i?e:n}`}async getVideoId(t){const e=t.pathname;if(/^m\.twitch\.tv$/.test(e))return/videos\/([^/]+)/.exec(t.href)?.[0]??e.slice(1);if(/^player\.twitch\.tv$/.test(t.hostname))return`videos/${t.searchParams.get("video")}`;const o=/([^/]+)\/(?:clip)\/([^/]+)/.exec(e);if(o)return o[0];return/^clips\.twitch\.tv$/.test(t.hostname)?await this.getClipLink(e,t.searchParams.get("clip")):/(?:videos)\/([^/]+)/.exec(e)?.[0]}}const nt=["auto","ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],it=["ru","en","kk"];class at extends z{API_ORIGIN="https://www.udemy.com/api-2.0";getModuleData(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(_.get("udemyModuleArgsNotFound")),{})}getLectureId(){return/learn\/lecture\/([^/]+)/.exec(window.location.pathname)?.[1]}async getLectureData(t,e){const o=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}/lectures/${e}/?`+new URLSearchParams({"fields[lecture]":"title,description,asset","fields[asset]":"length,media_sources,captions"}));return await o.json()}async getCourseLang(t){const e=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}?`+new URLSearchParams({"fields[course]":"locale"}));return await e.json()}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>R(t.locale_id)===e));return o||(o=t?.find((t=>"en"===R(t.locale_id)))??t?.[0]),o?.url}async getVideoData(t){const{courseId:e}=this.getModuleData();if(!e)return;const o=this.getLectureId();if(C.log(`[Udemy] courseId: ${e}, lectureId: ${o}`),!o)return;const{title:n,description:i,asset:a}=await this.getLectureData(e,o),{length:r,media_sources:s,captions:l}=a,d=this.findVideoUrl(s);if(!d)return void console.log("Failed to find .mp4 video file in media_sources",s);const u=await this.getCourseLang(e);let{locale:{locale:c}}=u;c=c?R(c):"en",nt.includes(c)||(c="en");const h=this.findSubtitleUrl(l,c);return h||console.log("Failed to find subtitle file in captions",l),{...h?{url:A.find((t=>t.host===k.udemy)).url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:h},{target:"video_file_url",targetUrl:d}],detectedLanguage:c}:{url:d,translationHelp:null},duration:r,title:n,description:i}}async getVideoId(t){return t.pathname.slice(1)}}class rt{static[k.mailru]=new U;static[k.weverse]=new G;static[k.kodik]=new W;static[k.patreon]=new j;static[k.reddit]=new Y;static[k.bannedvideo]=new J;static[k.kick]=new K;static[k.appledeveloper]=new Z;static[k.epicgames]=new Q;static[k.nineanimetv]=new X;static[k.odysee]=new tt;static[k.twitch]=new ot;static[k.coursehunter]=new et;static[k.udemy]=new at}class st extends Error{constructor(t){super(t),this.name="VideoDataError",this.message=t}}async function lt(t,e){const o=new URL(window.location.href),n=t.host;if(Object.getOwnPropertyDescriptor(rt,n))return await rt[n].getVideoId(o);switch(n){case k.custom:return o.href;case k.piped:case k.poketube:case k.invidious:case k.youtube:return"youtu.be"===o.hostname&&(o.search=`?v=${o.pathname.replace("/","")}`,o.pathname="/watch"),/(?:watch|embed|shorts|live)\/([^/]+)/.exec(o.pathname)?.[1]??o.searchParams.get("v");case k.vk:{const t=/^\/(video|clip)-?\d{8,9}_\d{9}$/.exec(o.pathname),n=o.searchParams.get("z"),i=o.searchParams.get("oid"),a=o.searchParams.get("id");if(t)return t[0].slice(1);if(n)return n.split("/")[0];if(i&&a)return`video-${Math.abs(parseInt(i))}_${a}`;const r=e.parentElement?.closest(".video_box_wrap");return r?r.id.replace("video_box_wrap","video"):null}case k.nine_gag:case k.gag:return/gag\/([^/]+)/.exec(o.pathname)?.[1];case k.proxitok:case k.tiktok:return/([^/]+)\/video\/([^/]+)/.exec(o.pathname)?.[0];case k.vimeo:{const t=o.searchParams.get("app_id"),e=/[^/]+\/[^/]+$/.exec(o.pathname)?.[0]??/[^/]+$/.exec(o.pathname)?.[0];return t?`${e}?app_id=${t}`:e}case k.xvideos:return/[^/]+\/[^/]+$/.exec(o.pathname)?.[0];case k.pornhub:return o.searchParams.get("viewkey")??/embed\/([^/]+)/.exec(o.pathname)?.[1];case k.twitter:return/status\/([^/]+)/.exec(o.pathname)?.[1];case k.rumble:case k.facebook:return o.pathname.slice(1);case k.rutube:return/(?:video|embed)\/([^/]+)/.exec(o.pathname)?.[1];case k.bilibili:{const t=o.searchParams.get("bvid");if(t)return t;let e=/video\/([^/]+)/.exec(o.pathname)?.[1];return e&&null!==o.searchParams.get("p")&&(e+=`/?p=${o.searchParams.get("p")}`),e}case k.bitchute:return/(video|embed)\/([^/]+)/.exec(o.pathname)?.[2];case k.eporner:return/video-([^/]+)\/([^/]+)/.exec(o.pathname)?.[0];case k.peertube:return/\/w\/([^/]+)/.exec(o.pathname)?.[0];case k.dailymotion:{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));let e=t?.[1]?.lastChild?.src;if(!e)return;return/\/video\/(\w+)\.m3u8/.exec(e)?.[1]}case k.trovo:{const t=o.searchParams.get("vid");if(!t)return null;const e=/([^/]+)\/([\d]+)/.exec(o.pathname)?.[0];return e?`${e}?vid=${t}`:null}case k.yandexdisk:return/\/i\/([^/]+)/.exec(o.pathname)?.[1];case k.okru:return/\/video\/(\d+)/.exec(o.pathname)?.[1];case k.googledrive:return o.searchParams.get("docid");case k.newgrounds:return/([^/]+)\/(view)\/([^/]+)/.exec(o.pathname)?.[0];case k.egghead:return o.pathname.slice(1);case k.youku:return/v_show\/id_[\w=]+/.exec(o.pathname)?.[0];case k.archive:return/(details|embed)\/([^/]+)/.exec(o.pathname)?.[2];default:return}}async function dt(t,e){const o=await lt(t,e);if(!o)throw new st(`Entered unsupported link: "${t.host}"`);if(t.host===k.peertube&&(t.url=window.location.origin),t.rawResult)return{url:o,videoId:o,host:t.host,duration:void 0};if(!t.needExtraData)return{url:t.url+o,videoId:o,host:t.host,duration:void 0};const n=await rt[t.host].getVideoData(o);if(!n)throw new st(`Failed to get video raw url for ${t.host}`);return{...n,videoId:o,host:t.host}}class ut extends Error{constructor(t){super(_.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=_.get(t)}}const{rE:ct}={rE:"1.1.0"};class ht extends Error{data;constructor(t,e=void 0){super(t),this.data=e,this.name="VOTJSError",this.message=t}}class pt{host;hostVOT;schema;schemaVOT;fetch;fetchOpts;getVideoDataFn;sessions={};requestLang;responseLang;userAgent=y.userAgent;componentVersion=y.componentVersion;paths={videoTranslation:"/video-translation/translate",videoSubtitles:"/video-subtitles/get-subtitles",streamPing:"/stream-translation/ping-stream",streamTranslation:"/stream-translation/translate-stream",createSession:"/session/create"};isCustomLink(t){return!!(/\.(m3u8|m4(a|v)|mpd)/.exec(t)??/^https:\/\/cdn\.qstv\.on\.epicgames\.com/.exec(t))}headers={"User-Agent":this.userAgent,Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf",Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors"};headersVOT={"User-Agent":`vot.js/${ct}`,"Content-Type":"application/json",Pragma:"no-cache","Cache-Control":"no-cache"};constructor({host:t=y.host,hostVOT:e=y.hostVOT,fetchFn:o=V,fetchOpts:n={},getVideoDataFn:i=dt,requestLang:a="en",responseLang:r="ru",headers:s={}}={}){const l=/(http(s)?):\/\//,d=l.exec(t)?.[1];this.host=d?t.replace(`${d}://`,""):t,this.schema=d??"https";const u=l.exec(e)?.[1];this.hostVOT=u?e.replace(`${u}://`,""):e,this.schemaVOT=u??"https",this.fetch=o,this.fetchOpts=n,this.getVideoDataFn=i,this.requestLang=a,this.responseLang=r,this.headers={...this.headers,...s}}getOpts(t,e={}){return{method:"POST",headers:{...this.headers,...e},body:t,...this.fetchOpts}}async request(t,e,o={}){const n=this.getOpts(new Blob([e]),o);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,n),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestVOT(t,e,o={}){const n=this.getOpts(JSON.stringify(e),{...this.headersVOT,...o});try{const e=await this.fetch(`${this.schemaVOT}://${this.hostVOT}${t}`,n),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async getSession(t){const e=Math.floor(Date.now()/1e3),o=this.sessions[t];if(o&&o.timestamp+o.expires>e)return o;const{secretKey:n,expires:i,uuid:a}=await this.createSession(t);return this.sessions[t]={secretKey:n,expires:i,timestamp:e,uuid:a},this.sessions[t]}async translateVideoYAImpl({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:n=null,headers:i={}}){const{url:a,duration:r=y.defaultDuration}=t,{secretKey:s,uuid:l}=await this.getSession("video-translation"),d=f.encodeTranslationRequest(a,r,e,o,n),u=await S(d),c=await this.request(this.paths.videoTranslation,d,{"Vtrans-Signature":u,"Sec-Vtrans-Sk":s,"Sec-Vtrans-Token":`${u}:${l}:${this.paths.videoTranslation}:${this.componentVersion}`,...i});if(!c.success)throw new ut("requestTranslationFailed");const h=f.decodeTranslationResponse(c.data);switch(C.log("requestTranslation",h),h.status){case T.FAILED:throw h?.message?new ht("Yandex couldn't translate video",h):new ut("requestTranslationFailed");case T.FINISHED:case T.PART_CONTENT:if(!h.url)throw new ut("audioNotReceived");return{translated:!0,url:h.url,remainingTime:h.remainingTime??-1};case T.WAITING:return{translated:!1,remainingTime:h.remainingTime};case T.LONG_WAITING:case T.LONG_WAITING_2:return{translated:!1,remainingTime:h.remainingTime??-1};default:throw console.error("[vot.js] Unknown response",h),new ht("Unknown response from Yandex",h)}}async translateVideoVOTImpl({url:t,videoId:e,service:o,requestLang:n=this.requestLang,responseLang:i=this.responseLang,headers:a={}}){const r=function(t,e,o){return t===k.patreon?{service:"mux",videoId:new URL(o).pathname.slice(1)}:{service:t,videoId:e}}(o,e,t),s=await this.requestVOT(this.paths.videoTranslation,{provider:"yandex",service:r.service,videoId:r.videoId,fromLang:n,toLang:i,rawVideo:t},a);if(!s.success)throw new ut("requestTranslationFailed",s);const l=s.data;switch(l.status){case"failed":throw new ht("Yandex couldn't translate video",l);case"success":if(!l.translatedUrl)throw new ut("audioNotReceived");return{translated:!0,url:l.translatedUrl,remainingTime:-1};case"waiting":return{translated:!1,remainingTime:l.remainingTime,message:l.message}}}async translateVideo({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:n=null,headers:i={}}){const{url:a,videoId:r,host:s}=t;return this.isCustomLink(a)?await this.translateVideoVOTImpl({url:a,videoId:r,service:s,requestLang:e,responseLang:o,headers:i}):await this.translateVideoYAImpl({videoData:t,requestLang:e,responseLang:o,translationHelp:n,headers:i})}async getSubtitles({videoData:t,requestLang:e=this.requestLang,headers:o={}}){const{url:n}=t;if(this.isCustomLink(n))throw new ut("VOTSubtitlesNotSupportedUrl");const{secretKey:i,uuid:a}=await this.getSession("video-translation"),r=f.encodeSubtitlesRequest(n,e),s=await S(r),l=await this.request(this.paths.videoSubtitles,r,{"Vsubs-Signature":await S(r),"Sec-Vsubs-Sk":i,"Sec-Vsubs-Token":`${s}:${a}:${this.paths.videoSubtitles}:${this.componentVersion}`,...o});if(!l.success)throw new ht("Failed to request video subtitles",l);return f.decodeSubtitlesResponse(l.data)}async pingStream({pingId:t,headers:e={}}){const{secretKey:o,uuid:n}=await this.getSession("video-translation"),i=f.encodeStreamPingRequest(t),a=await S(i),r=await this.request(this.paths.streamPing,i,{"Vtrans-Signature":await S(i),"Sec-Vtrans-Sk":o,"Sec-Vtrans-Token":`${a}:${n}:${this.paths.streamPing}:${this.componentVersion}`,...e});if(!r.success)throw new ht("Failed to request stream ping",r);return!0}async translateStream({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,headers:i={}}){const{url:a}=t;if(this.isCustomLink(a))throw new ut("VOTStreamNotSupportedUrl");const{secretKey:r,uuid:s}=await this.getSession("video-translation"),l=f.encodeStreamRequest(a,e,o),d=await S(l),u=await this.request(this.paths.streamTranslation,l,{"Vtrans-Signature":await S(l),"Sec-Vtrans-Sk":r,"Sec-Vtrans-Token":`${d}:${s}:${this.paths.streamTranslation}:${this.componentVersion}`,...i});if(!u.success)throw new ht("Failed to request stream translation",u);const c=f.decodeStreamResponse(u.data),h=c.interval;switch(h){case n.NO_CONNECTION:case n.TRANSLATING:return{translated:!1,interval:h,message:h===n.NO_CONNECTION?"streamNoConnectionToServer":"translationTakeFewMinutes"};case n.STREAMING:return{translated:!0,interval:h,pingId:c.pingId,result:c.translatedInfo};default:throw console.error("[vot.js] Unknown response",c),new ht("Unknown response from Yandex",c)}}async createSession(t){const e=function(){let t="";for(let e=0;e<32;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t}(),o=f.encodeYandexSessionRequest(e,t),n=await this.request(this.paths.createSession,o,{"Vtrans-Signature":await S(o)});if(!n.success)throw new ht("Failed to request create session",n);return{...f.decodeYandexSessionResponse(n.data),uuid:e}}}class gt extends pt{async request(t,e,o={}){const n=this.getOpts(JSON.stringify({headers:{...this.headers,...o},body:Array.from(e)}),{"Content-Type":"application/json"});try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,n),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}}var vt;function mt(t){const e=Math.floor(t/3600),o=Math.floor(t%3600/60),n=Math.floor(t%60),i=Math.floor(t%1*1e3);return`${e.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")},${i.toString().padStart(3,"0")}`}!function(t){t.Channel="Channel",t.Video="Video"}(vt||(vt={}));const bt=globalThis,ft=bt.trustedTypes,yt=ft?ft.createPolicy("lit-html",{createHTML:t=>t}):void 0,wt="$lit$",xt=`lit$${Math.random().toFixed(9).slice(2)}$`,St="?"+xt,kt=`<${St}>`,Tt=document,Vt=()=>Tt.createComment(""),Lt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Mt=Array.isArray,At=t=>Mt(t)||"function"==typeof t?.[Symbol.iterator],Ot="[ \t\n\f\r]",It=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ct=/-->/g,Pt=/>/g,Et=RegExp(`>|${Ot}(?:([^\\s"'>=/]+)(${Ot}*=${Ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),_t=/'/g,Nt=/"/g,$t=/^(?:script|style|textarea|title)$/i,Rt=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),Bt=Rt(1),Dt=Rt(2),Ft=(Rt(3),Symbol.for("lit-noChange")),qt=Symbol.for("lit-nothing"),Ht=new WeakMap,zt=Tt.createTreeWalker(Tt,129);function Ut(t,e){if(!Mt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==yt?yt.createHTML(e):e}const Gt=(t,e)=>{const o=t.length-1,n=[];let i,a=2===e?"":3===e?"":"",r=It;for(let e=0;e"===l[0]?(r=i??It,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,s=l[1],r=void 0===l[3]?Et:'"'===l[3]?Nt:_t):r===Nt||r===_t?r=Et:r===Ct||r===Pt?r=It:(r=Et,i=void 0);const c=r===Et&&t[e+1].startsWith("/>")?" ":"";a+=r===It?o+kt:d>=0?(n.push(s),o.slice(0,d)+wt+o.slice(d)+xt+c):o+xt+(-2===d?e:c)}return[Ut(t,a+(t[o]||"")+(2===e?"":3===e?"":"")),n]};class Wt{constructor({strings:t,_$litType$:e},o){let n;this.parts=[];let i=0,a=0;const r=t.length-1,s=this.parts,[l,d]=Gt(t,e);if(this.el=Wt.createElement(l,o),zt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=zt.nextNode())&&s.length0){n.textContent=ft?ft.emptyScript:"";for(let o=0;o2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=qt}_$AI(t,e=this,o,n){const i=this.strings;let a=!1;if(void 0===i)t=jt(this,t,e,0),a=!Lt(t)||t!==this._$AH&&t!==Ft,a&&(this._$AH=t);else{const n=t;let r,s;for(t=i[0],r=0;r{const n=o?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=o?.renderBefore??null;n._$litPart$=i=new Jt(e.insertBefore(Vt(),t),t,void 0,o??{})}return i._$AI(t),i},ne="m3u8-proxy.toil.cc",ie="vot-worker.toil.cc",ae="https://vot-api.toil.cc/v1",re=.15,se="yandex",le="yandex",de={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},ue={yandex:"https://translate.toil.cc/translate",deepl:"https://translate-deepl.toil.cc/translate"};o("./src/styles/main.scss");const ce="#UNDEFINED",he=Dt`{var t={"./src/styles/main.scss":()=>{GM_addStyle('.vot-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;border:none;border-radius:4px;outline:none;min-width:64px;height:36px;padding:0 16px;font-size:14px;font-weight:500;line-height:36px;transition:box-shadow .2s;display:inline-block;position:relative;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.vot-button[hidden]{display:none!important}.vot-button::-moz-focus-inner{border:none}.vot-button:before,.vot-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-button:before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.vot-button:hover:before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.vot-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size}.vot-button[disabled=true]{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.12);color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);box-shadow:none;cursor:initial}.vot-button[disabled=true]:before,.vot-button[disabled=true]:after{opacity:0}.vot-outlined-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;border:1px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.24);vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border-radius:4px;outline:none;min-width:64px;height:36px;margin:0;padding:0 16px;font-size:14px;font-weight:500;line-height:34px;display:inline-block;position:relative}.vot-outlined-button[hidden]{display:none!important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button:before,.vot-outlined-button:after{content:"";opacity:0;border-radius:3px;position:absolute;inset:0}.vot-outlined-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover:before{opacity:.04}.vot-outlined-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-outlined-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-outlined-button[disabled=true]:before,.vot-outlined-button[disabled=true]:after{opacity:0}.vot-text-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:4px;outline:none;min-width:64px;height:36px;margin:0;padding:0 8px;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-text-button[hidden]{display:none!important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button:before,.vot-text-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-text-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover:before{opacity:.04}.vot-text-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-text-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-text-button[disabled=true]:before,.vot-text-button[disabled=true]:after{opacity:0}.vot-icon-button{--vot-helper-onsurface:rgba(var(--vot-onsurface-rgb,0,0,0),.87);box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:50%;outline:none;width:36px;height:36px;margin:0;padding:0;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-icon-button[hidden]{display:none!important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button:before,.vot-icon-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-icon-button:before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover:before{opacity:.04}.vot-icon-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size,opacity}.vot-icon-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);fill:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-icon-button[disabled=true]:before,.vot-icon-button[disabled=true]:after{opacity:0}.vot-textfield{display:inline-block;--vot-helper-theme:rgb(var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243)))!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari3:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;padding-top:6px!important;font-size:16px!important;line-height:1.5!important;position:relative!important}.vot-textfield[hidden]{display:none!important}.vot-textfield>input,.vot-textfield>textarea{box-sizing:border-box!important;border-style:solid!important;border-width:1px!important;border-color:transparent var(--vot-helper-safari2)var(--vot-helper-safari2)!important;height:inherit!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;-webkit-text-fill-color:currentColor!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;caret-color:var(--vot-helper-theme)!important;background-color:#0000!important;border-radius:4px!important;width:100%!important;margin:0!important;padding:15px 13px!important;transition:border .2s,box-shadow .2s!important;box-shadow:inset 1px 0 #0000,inset -1px 0 #0000,inset 0 -1px #0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2)!important}.vot-textfield>input+span,.vot-textfield>textarea+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;cursor:text!important;pointer-events:none!important;width:100%!important;max-height:100%!important;font-size:75%!important;line-height:15px!important;transition:color .2s,font-size .2s,line-height .2s!important;display:flex!important;position:absolute!important;top:0!important;left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit!important;line-height:68px!important}.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{content:""!important;box-sizing:border-box!important;border-top:solid 1px var(--vot-helper-safari2)!important;pointer-events:none!important;min-width:10px!important;height:8px!important;margin-top:6px!important;transition:border .2s,box-shadow .2s!important;display:block!important;box-shadow:inset 0 1px #0000!important}.vot-textfield>input+span:before,.vot-textfield>textarea+span:before{border-left:1px solid #0000!important;border-radius:4px 0!important;margin-right:4px!important}.vot-textfield>input+span:after,.vot-textfield>textarea+span:after{border-right:1px solid #0000!important;border-radius:0 4px!important;flex-grow:1!important;margin-left:4px!important}.vot-textfield>input.vot-show-placeholer+span:before,.vot-textfield>textarea.vot-show-placeholer+span:before{margin-right:0!important}.vot-textfield>input.vot-show-placeholer+span:after,.vot-textfield>textarea.vot-show-placeholer+span:after{margin-left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span:before,.vot-textfield>input:not(:focus):placeholder-shown+span:after,.vot-textfield>textarea:not(:focus):placeholder-shown+span:before,.vot-textfield>textarea:not(:focus):placeholder-shown+span:after{border-top-color:#0000!important}.vot-textfield:hover>input:not(:disabled),.vot-textfield:hover>textarea:not(:disabled){border-color:transparent var(--vot-helper-safari3)var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled)+span:before,.vot-textfield:hover>input:not(:disabled)+span:after,.vot-textfield:hover>textarea:not(:disabled)+span:before,.vot-textfield:hover>textarea:not(:disabled)+span:after{border-top-color:var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled):not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:disabled):not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3)!important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:transparent var(--vot-helper-theme)var(--vot-helper-theme)!important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme)!important;outline:none!important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme)!important}.vot-textfield>input:focus+span:before,.vot-textfield>input:focus+span:after,.vot-textfield>textarea:focus+span:before,.vot-textfield>textarea:focus+span:after{border-top-color:var(--vot-helper-theme)!important;box-shadow:inset 0 1px var(--vot-helper-theme)!important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:transparent var(--vot-helper-safari1)var(--vot-helper-safari1)!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;pointer-events:none!important}.vot-textfield>input:disabled+span:before,.vot-textfield>input:disabled+span:after,.vot-textfield>textarea:disabled+span:before,.vot-textfield>textarea:disabled+span:after,.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1)!important}.vot-textfield>input:disabled:placeholder-shown+span:before,.vot-textfield>input:disabled:placeholder-shown+span:after,.vot-textfield>textarea:disabled:placeholder-shown+span:before,.vot-textfield>textarea:disabled:placeholder-shown+span:after{border-top-color:#0000!important}@media not all and (-webkit-min-device-pixel-ratio:.0000264583),not all and (min-resolution:.001dpcm){@supports ((-webkit-appearance:none)){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{transition-duration:.1s!important}}}.vot-checkbox{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));z-index:0;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-size:16px;line-height:1.5;display:inline-block;position:relative}.vot-checkbox[hidden]{display:none!important}.vot-checkbox>input{appearance:none;z-index:10000;box-sizing:border-box;border:2px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);cursor:pointer;background:0 0;border-radius:2px;outline:none;width:18px;height:18px;margin:3px 1px;transition:border-color .2s,background-color .2s;display:block;position:absolute}.vot-checkbox>input+span{box-sizing:border-box;width:inherit;cursor:pointer;padding-left:30px;font-weight:400;display:inline-block}.vot-checkbox>input+span:before{content:"";background-color:rgb(var(--vot-onsurface-rgb,0,0,0));opacity:0;pointer-events:none;border-radius:50%;width:40px;height:40px;transition:opacity .3s,transform .2s;display:block;position:absolute;top:-8px;left:-10px;transform:scale(1)}.vot-checkbox>input+span:after{content:"";z-index:10000;pointer-events:none;border:0 solid #0000;border-width:0 0 2px 2px;width:10px;height:5px;transition:border-color .2s;display:block;position:absolute;top:3px;left:1px;transform:translate(3px,4px)rotate(-45deg);box-sizing:content-box!important}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:before,.vot-checkbox>input:indeterminate+span:before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:after,.vot-checkbox>input:indeterminate+span:after{border-color:rgb(var(--vot-helper-ontheme,255,255,255))}.vot-checkbox>input:indeterminate+span:after{border-left-width:0;transform:translate(4px,3px)}.vot-checkbox:hover>input+span:before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input{border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);border-color:#0000}.vot-checkbox:active>input+span:before{opacity:1;transition:transform,opacity;transform:scale(0)}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);border-color:#0000}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled+span:before{opacity:0;transform:scale(0)}.vot-slider{display:inline-block;--vot-safari-helper1:rgba(var(--vot-primary-rgb,33,150,243),.04)!important;--vot-safari-helper2:rgba(var(--vot-primary-rgb,33,150,243),.12)!important;--vot-safari-helper3:rgba(var(--vot-primary-rgb,33,150,243),.16)!important;--vot-safari-helper4:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;width:100%!important;font-size:16px!important;line-height:1.5!important}.vot-slider[hidden]{display:none!important}.vot-slider>input{appearance:none!important;cursor:pointer!important;background-color:#0000!important;width:100%!important;height:36px!important;margin:0 0 -36px!important;display:block!important;position:relative!important;top:24px!important}.vot-slider>input:last-child{margin:0!important;position:static!important}.vot-slider>span{margin-bottom:36px!important;display:inline-block!important}.vot-slider>input:disabled{cursor:default!important;opacity:.38!important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input::-webkit-slider-runnable-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-webkit-slider-thumb{appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;margin:0!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1)!important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4)!important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;color:rgb(var(--vot-surface-rgb,255,255,255))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input::-moz-range-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-moz-range-thumb{appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-moz-range-progress{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input::-moz-focus-outer{border:none!important}.vot-slider>input:focus{outline:none!important}.vot-slider>input::-ms-track{box-sizing:border-box!important;background-color:#0000!important;border:none!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important;padding:0 17px!important}.vot-slider>input::-ms-fill-lower{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-fill-upper{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-thumb{appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;margin:0 17px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;opacity:.38!important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:before{content:""!important;width:calc(100%*var(--vot-progress,0))!important;background:rgb(var(--vot-primary-rgb,33,150,243))!important;height:2px!important;display:block!important;position:absolute!important;top:calc(50% - 1px)!important}.vot-select{font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;font-size:14px;font-weight:400;line-height:1.5;display:flex;--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0)!important;--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87)!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-select[hidden]{display:none!important}.vot-select-label{font-size:16px}.vot-select-outer{cursor:pointer;justify-content:space-between;align-items:center;width:120px;max-width:120px;padding:0 5px;display:flex;border-style:solid!important;border-width:1px!important;border-color:var(--vot-helper-safari1)!important;border-radius:4px!important;transition:border .2s!important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2)!important}.vot-select-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vot-select-arrow-icon{justify-content:center;align-items:center;width:20px;height:32px;display:flex}.vot-select-content-list{flex-direction:column;display:flex}.vot-select-content-list .vot-select-content-item{cursor:pointer;border-radius:8px;padding:5px 10px}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb,33,150,243));background-color:rgba(var(--vot-primary-rgb,33,150,243),.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb,33,150,243),.1)!important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none!important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-weight:700;line-height:1.5}.vot-header[hidden]{display:none!important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-size:16px;line-height:1.5;display:flex}.vot-info[hidden]{display:none!important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb),.5);flex:1;margin-left:8px}.vot-details{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;cursor:pointer;border-radius:.5em;justify-content:space-between;align-items:center;margin:0 -.5em;padding:.5em;font-size:16px;line-height:1.5;transition:background .5s;display:flex}.vot-details[hidden]{display:none!important}.vot-details-arrow-icon{fill:rgba(var(--vot-helper-onsurface-rgb),.87);justify-content:center;align-items:center;width:20px;height:32px;display:flex;transform:scale(1.25)rotate(-90deg)}.vot-details:hover{background:rgba(var(--vot-onsurface-rgb,0,0,0),.04)}.vot-lang-select{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;display:flex}.vot-lang-select[hidden]{display:none!important}.vot-lang-select-icon{justify-content:center;align-items:center;width:32px;height:32px;display:flex}.vot-segmented-button{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);-webkit-user-select:none;user-select:none;background:rgb(var(--vot-surface-rgb,255,255,255));color:var(--vot-helper-theme);fill:var(--vot-helper-theme);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;border-radius:4px;align-items:center;max-width:100vw;height:32px;font-size:16px;line-height:1.5;transition:opacity .5s;display:flex;position:absolute;top:5rem;left:50%;overflow:hidden;transform:translate(-50%)}.vot-segmented-button[hidden]{display:none!important}.vot-segmented-button *{box-sizing:border-box!important}.vot-segmented-button .vot-separator{background:rgba(var(--vot-helper-theme-rgb),.1);width:1px;height:50%}.vot-segmented-button .vot-separator[hidden]{display:none!important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{color:inherit;background-color:#0000;border:none;justify-content:center;align-items:center;height:100%;padding:0 8px;transition:background-color .1s ease-in-out;display:flex;position:relative;overflow:hidden}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none!important}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before,.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{content:"";border-radius:inherit;opacity:0;position:absolute;inset:0}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover:before,.vot-segmented-button .vot-segment-only-icon:hover:before{opacity:.04}.vot-segmented-button .vot-segment:active:after,.vot-segmented-button .vot-segment-only-icon:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{white-space:nowrap;color:inherit;margin-left:8px}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb,33,150,243));fill:rgb(var(--vot-primary-rgb,33,150,243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button[data-loading=true] #vot-loading-icon{display:block!important}.vot-segmented-button[data-loading=true] #vot-translate-icon{display:none!important}.vot-segmented-button[data-direction=column]{flex-direction:column;height:fit-content}.vot-segmented-button[data-direction=column] .vot-segment-label{display:none}.vot-segmented-button[data-direction=column]>.vot-segment-only-icon,.vot-segmented-button[data-direction=column]>.vot-segment{padding:8px}.vot-segmented-button[data-direction=column] .vot-separator{width:50%;height:1px}.vot-segmented-button[data-position=left]{top:12.5vh;left:50px}.vot-segmented-button[data-position=right]{top:12.5vh;left:auto;right:0}.vot-segmented-button svg{width:fit-content}.vot-menu{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);-webkit-user-select:none;user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;visibility:visible;opacity:1;transform-origin:top;border-radius:8px;min-width:300px;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;position:absolute;top:calc(5rem + 48px);left:50%;overflow:hidden;transform:translate(-50%)scale(1)}.vot-menu *{box-sizing:border-box!important}.vot-menu[hidden]{pointer-events:none;visibility:hidden;opacity:0;transform:translate(-50%)scale(0);display:block!important}.vot-menu-content-wrapper{max-height:calc(var(--vot-container-height,75vh) - (5rem + 32px + 16px)*2);flex-direction:column;min-height:100px;display:flex;overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-menu-header-container:empty{padding:0 0 16px}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{font-size:inherit;font-weight:inherit;text-align:start;outline:0;flex:1;margin:0;display:flex}.vot-menu-title{padding-bottom:16px;padding-inline:16px;flex:1;padding-top:16px;font-size:16px;line-height:1}.vot-menu-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:8px;min-height:1.375rem;padding:0 16px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-menu-footer-container{padding-bottom:16px;padding-inline:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-menu-footer-container:empty{padding:16px 0 0}.vot-menu[data-position=left]{top:12.5vh;left:240px}.vot-menu[data-position=right]{top:12.5vh;left:auto;right:-80px}.vot-dialog{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);max-width:initial;max-height:initial;width:min(var(--vot-dialog-width,512px),100%);top:50%;bottom:50%;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);-webkit-user-select:none;user-select:none;visibility:visible;opacity:1;transform-origin:50%;border-radius:8px;height:fit-content;margin:auto;padding:0;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;display:block;position:fixed;inset-block:0;inset-inline:0;overflow:auto hidden;transform:scale(1);box-shadow:0 0 16px #0000001f,0 16px 16px #0000003d}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transition:opacity .1s,transform .2s;transform:scale(.5)}.vot-dialog-container{visibility:visible;z-index:2147483647;position:absolute}.vot-dialog-container[hidden]{pointer-events:none;visibility:hidden;display:block!important}.vot-dialog-container *{box-sizing:border-box!important}.vot-dialog-backdrop{opacity:1;background-color:#0009;transition:opacity .3s;position:fixed;inset:0}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog-content-wrapper{flex-direction:column;max-height:75vh;display:flex;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-dialog-header-container:empty{padding:0 0 20px}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{font-size:inherit;font-weight:inherit;outline:0;flex:1;margin:0;display:flex}.vot-dialog-title{padding-bottom:16px;padding-inline:20px;flex:1;padding-top:20px;font-size:115.385%;font-weight:700;line-height:1}.vot-dialog-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:16px;min-height:1.375rem;padding:0 20px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-dialog-footer-container{padding-bottom:16px;padding-inline:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-dialog-footer-container:empty{padding:20px 0 0}.vot-subtitles-widget{z-index:2147483647;pointer-events:none;justify-content:center;align-items:center;width:50%;min-height:20%;max-height:100%;display:flex;position:absolute;top:75%;left:25%}.vot-subtitles{--vot-subtitles-background:rgba(var(--vot-surface-rgb,46,47,52),var(--vot-subtitles-opacity,.8));background:var(--vot-subtitles-background,#2e2f34cc);color:var(--vot-subtitles-color,#e3e3e3);pointer-events:all;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:.5em;width:max-content;max-width:100%;max-height:100%;padding:.5em;font-size:20px;line-height:normal;position:relative}.vot-subtitles span{-webkit-user-select:text;user-select:text}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color,#2196f3)}:root{--vot-font-family:"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system;--vot-primary-rgb:139,180,245;--vot-onprimary-rgb:32,33,36;--vot-surface-rgb:32,33,36;--vot-onsurface-rgb:227,227,227;--vot-subtitles-color:rgb(var(--vot-onsurface-rgb,227,227,227));--vot-subtitles-passed-color:rgb(var(--vot-primary-rgb,33,150,243))}vot-block{display:block;visibility:visible!important}')},"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n=o(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,n){void 0===n&&(n=!1);var i=t.getVersionPrecision(e),a=t.getVersionPrecision(o),r=Math.max(i,a),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),n=e+new Array(o+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(s=r-Math.min(i,a)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?i-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var u=s.default.find(r,(function(t){return e.isPlatform(t)}));if(u){var c=this.satisfies(o[u]);if(void 0!==c)return c}}if(a>0){var h=Object.keys(i),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),i=s.default.getBrowserTypeByAlias(n);return e&&i&&(n=i.toLowerCase()),n===o},e.compareVersion=function(t){var e=[0],o=t,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(n=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(n=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(i,o,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=i.default.getFirstMatch(a,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=i.default.getFirstMatch(a,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:a.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=i.default.getWindowsVersionName(e);return{name:a.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:a.OS_MAP.iOS},o=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=i.default.getMacOSVersionName(e),n={name:a.OS_MAP.MacOS,version:e};return o&&(n.versionName=o),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=i.default.getAndroidVersionName(e),n={name:a.OS_MAP.Android,version:e};return o&&(n.versionName=o),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:a.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:a.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:a.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,i=(n=o(17))&&n.__esModule?n:{default:n},a=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:a.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:a.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:a.ENGINE_MAP.Trident},o=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:a.ENGINE_MAP.Presto},o=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:a.ENGINE_MAP.Gecko},o=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:a.ENGINE_MAP.WebKit},o=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,o),a.exports}(()=>{"use strict";var t=o("./node_modules/bowser/es5.js");const e=protobuf;var n;function i(t){switch(t){case 0:case"NO_CONNECTION":return n.NO_CONNECTION;case 10:case"TRANSLATING":return n.TRANSLATING;case 20:case"STREAMING":return n.STREAMING;default:return n.UNRECOGNIZED}}!function(t){t[t.NO_CONNECTION=0]="NO_CONNECTION",t[t.TRANSLATING=10]="TRANSLATING",t[t.STREAMING=20]="STREAMING",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(n||(n={}));const a={encode:(t,o=e.Writer.create())=>(""!==t.target&&o.uint32(10).string(t.target),""!==t.targetUrl&&o.uint32(18).string(t.targetUrl),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={target:"",targetUrl:""};for(;n.pos>>3){case 1:if(10!==t)break;a.target=n.string();continue;case 2:if(18!==t)break;a.targetUrl=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({target:b(t.target)?globalThis.String(t.target):"",targetUrl:b(t.targetUrl)?globalThis.String(t.targetUrl):""}),toJSON(t){const e={};return""!==t.target&&(e.target=t.target),""!==t.targetUrl&&(e.targetUrl=t.targetUrl),e},create:t=>a.fromPartial(t??{}),fromPartial(t){const e={target:"",targetUrl:""};return e.target=t.target??"",e.targetUrl=t.targetUrl??"",e}};const r={encode(t,o=e.Writer.create()){""!==t.url&&o.uint32(26).string(t.url),void 0!==t.deviceId&&o.uint32(34).string(t.deviceId),!1!==t.firstRequest&&o.uint32(40).bool(t.firstRequest),0!==t.duration&&o.uint32(49).double(t.duration),0!==t.unknown0&&o.uint32(56).int32(t.unknown0),""!==t.language&&o.uint32(66).string(t.language),!1!==t.forceSourceLang&&o.uint32(72).bool(t.forceSourceLang),0!==t.unknown1&&o.uint32(80).int32(t.unknown1);for(const e of t.translationHelp)a.encode(e,o.uint32(90).fork()).ldelim();return""!==t.responseLanguage&&o.uint32(114).string(t.responseLanguage),0!==t.unknown2&&o.uint32(120).int32(t.unknown2),0!==t.unknown3&&o.uint32(128).int32(t.unknown3),!1!==t.bypassCache&&o.uint32(136).bool(t.bypassCache),o},decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const r={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1};for(;n.pos>>3){case 3:if(26!==t)break;r.url=n.string();continue;case 4:if(34!==t)break;r.deviceId=n.string();continue;case 5:if(40!==t)break;r.firstRequest=n.bool();continue;case 6:if(49!==t)break;r.duration=n.double();continue;case 7:if(56!==t)break;r.unknown0=n.int32();continue;case 8:if(66!==t)break;r.language=n.string();continue;case 9:if(72!==t)break;r.forceSourceLang=n.bool();continue;case 10:if(80!==t)break;r.unknown1=n.int32();continue;case 11:if(90!==t)break;r.translationHelp.push(a.decode(n,n.uint32()));continue;case 14:if(114!==t)break;r.responseLanguage=n.string();continue;case 15:if(120!==t)break;r.unknown2=n.int32();continue;case 16:if(128!==t)break;r.unknown3=n.int32();continue;case 17:if(136!==t)break;r.bypassCache=n.bool();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return r},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",deviceId:b(t.deviceId)?globalThis.String(t.deviceId):void 0,firstRequest:!!b(t.firstRequest)&&globalThis.Boolean(t.firstRequest),duration:b(t.duration)?globalThis.Number(t.duration):0,unknown0:b(t.unknown0)?globalThis.Number(t.unknown0):0,language:b(t.language)?globalThis.String(t.language):"",forceSourceLang:!!b(t.forceSourceLang)&&globalThis.Boolean(t.forceSourceLang),unknown1:b(t.unknown1)?globalThis.Number(t.unknown1):0,translationHelp:globalThis.Array.isArray(t?.translationHelp)?t.translationHelp.map((t=>a.fromJSON(t))):[],responseLanguage:b(t.responseLanguage)?globalThis.String(t.responseLanguage):"",unknown2:b(t.unknown2)?globalThis.Number(t.unknown2):0,unknown3:b(t.unknown3)?globalThis.Number(t.unknown3):0,bypassCache:!!b(t.bypassCache)&&globalThis.Boolean(t.bypassCache)}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),void 0!==t.deviceId&&(e.deviceId=t.deviceId),!1!==t.firstRequest&&(e.firstRequest=t.firstRequest),0!==t.duration&&(e.duration=t.duration),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.language&&(e.language=t.language),!1!==t.forceSourceLang&&(e.forceSourceLang=t.forceSourceLang),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),t.translationHelp?.length&&(e.translationHelp=t.translationHelp.map((t=>a.toJSON(t)))),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),0!==t.unknown3&&(e.unknown3=Math.round(t.unknown3)),!1!==t.bypassCache&&(e.bypassCache=t.bypassCache),e},create:t=>r.fromPartial(t??{}),fromPartial(t){const e={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1};return e.url=t.url??"",e.deviceId=t.deviceId??void 0,e.firstRequest=t.firstRequest??!1,e.duration=t.duration??0,e.unknown0=t.unknown0??0,e.language=t.language??"",e.forceSourceLang=t.forceSourceLang??!1,e.unknown1=t.unknown1??0,e.translationHelp=t.translationHelp?.map((t=>a.fromPartial(t)))||[],e.responseLanguage=t.responseLanguage??"",e.unknown2=t.unknown2??0,e.unknown3=t.unknown3??0,e.bypassCache=t.bypassCache??!1,e}};const s={encode:(t,o=e.Writer.create())=>(void 0!==t.url&&o.uint32(10).string(t.url),void 0!==t.duration&&o.uint32(17).double(t.duration),0!==t.status&&o.uint32(32).int32(t.status),void 0!==t.remainingTime&&o.uint32(40).int32(t.remainingTime),void 0!==t.unknown0&&o.uint32(48).int32(t.unknown0),""!==t.translationId&&o.uint32(58).string(t.translationId),void 0!==t.language&&o.uint32(66).string(t.language),void 0!==t.message&&o.uint32(74).string(t.message),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(17!==t)break;a.duration=n.double();continue;case 4:if(32!==t)break;a.status=n.int32();continue;case 5:if(40!==t)break;a.remainingTime=n.int32();continue;case 6:if(48!==t)break;a.unknown0=n.int32();continue;case 7:if(58!==t)break;a.translationId=n.string();continue;case 8:if(66!==t)break;a.language=n.string();continue;case 9:if(74!==t)break;a.message=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):void 0,duration:b(t.duration)?globalThis.Number(t.duration):void 0,status:b(t.status)?globalThis.Number(t.status):0,remainingTime:b(t.remainingTime)?globalThis.Number(t.remainingTime):void 0,unknown0:b(t.unknown0)?globalThis.Number(t.unknown0):void 0,translationId:b(t.translationId)?globalThis.String(t.translationId):"",language:b(t.language)?globalThis.String(t.language):void 0,message:b(t.message)?globalThis.String(t.message):void 0}),toJSON(t){const e={};return void 0!==t.url&&(e.url=t.url),void 0!==t.duration&&(e.duration=t.duration),0!==t.status&&(e.status=Math.round(t.status)),void 0!==t.remainingTime&&(e.remainingTime=Math.round(t.remainingTime)),void 0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translationId&&(e.translationId=t.translationId),void 0!==t.language&&(e.language=t.language),void 0!==t.message&&(e.message=t.message),e},create:t=>s.fromPartial(t??{}),fromPartial(t){const e={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};return e.url=t.url??void 0,e.duration=t.duration??void 0,e.status=t.status??0,e.remainingTime=t.remainingTime??void 0,e.unknown0=t.unknown0??void 0,e.translationId=t.translationId??"",e.language=t.language??void 0,e.message=t.message??void 0,e}};const l={encode:(t,o=e.Writer.create())=>(""!==t.language&&o.uint32(10).string(t.language),""!==t.url&&o.uint32(18).string(t.url),0!==t.unknown0&&o.uint32(24).int32(t.unknown0),""!==t.translatedLanguage&&o.uint32(34).string(t.translatedLanguage),""!==t.translatedUrl&&o.uint32(42).string(t.translatedUrl),0!==t.unknown1&&o.uint32(48).int32(t.unknown1),0!==t.unknown2&&o.uint32(56).int32(t.unknown2),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};for(;n.pos>>3){case 1:if(10!==t)break;a.language=n.string();continue;case 2:if(18!==t)break;a.url=n.string();continue;case 3:if(24!==t)break;a.unknown0=n.int32();continue;case 4:if(34!==t)break;a.translatedLanguage=n.string();continue;case 5:if(42!==t)break;a.translatedUrl=n.string();continue;case 6:if(48!==t)break;a.unknown1=n.int32();continue;case 7:if(56!==t)break;a.unknown2=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({language:b(t.language)?globalThis.String(t.language):"",url:b(t.url)?globalThis.String(t.url):"",unknown0:b(t.unknown0)?globalThis.Number(t.unknown0):0,translatedLanguage:b(t.translatedLanguage)?globalThis.String(t.translatedLanguage):"",translatedUrl:b(t.translatedUrl)?globalThis.String(t.translatedUrl):"",unknown1:b(t.unknown1)?globalThis.Number(t.unknown1):0,unknown2:b(t.unknown2)?globalThis.Number(t.unknown2):0}),toJSON(t){const e={};return""!==t.language&&(e.language=t.language),""!==t.url&&(e.url=t.url),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translatedLanguage&&(e.translatedLanguage=t.translatedLanguage),""!==t.translatedUrl&&(e.translatedUrl=t.translatedUrl),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),e},create:t=>l.fromPartial(t??{}),fromPartial(t){const e={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};return e.language=t.language??"",e.url=t.url??"",e.unknown0=t.unknown0??0,e.translatedLanguage=t.translatedLanguage??"",e.translatedUrl=t.translatedUrl??"",e.unknown1=t.unknown1??0,e.unknown2=t.unknown2??0,e}};const d={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:"",language:""};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(18!==t)break;a.language=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",language:b(t.language)?globalThis.String(t.language):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),e},create:t=>d.fromPartial(t??{}),fromPartial(t){const e={url:"",language:""};return e.url=t.url??"",e.language=t.language??"",e}};const u={encode(t,o=e.Writer.create()){!1!==t.waiting&&o.uint32(8).bool(t.waiting);for(const e of t.subtitles)l.encode(e,o.uint32(18).fork()).ldelim();return o},decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={waiting:!1,subtitles:[]};for(;n.pos>>3){case 1:if(8!==t)break;a.waiting=n.bool();continue;case 2:if(18!==t)break;a.subtitles.push(l.decode(n,n.uint32()));continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({waiting:!!b(t.waiting)&&globalThis.Boolean(t.waiting),subtitles:globalThis.Array.isArray(t?.subtitles)?t.subtitles.map((t=>l.fromJSON(t))):[]}),toJSON(t){const e={};return!1!==t.waiting&&(e.waiting=t.waiting),t.subtitles?.length&&(e.subtitles=t.subtitles.map((t=>l.toJSON(t)))),e},create:t=>u.fromPartial(t??{}),fromPartial(t){const e={waiting:!1,subtitles:[]};return e.waiting=t.waiting??!1,e.subtitles=t.subtitles?.map((t=>l.fromPartial(t)))||[],e}};const c={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.timestamp&&o.uint32(18).string(t.timestamp),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:"",timestamp:""};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(18!==t)break;a.timestamp=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",timestamp:b(t.timestamp)?globalThis.String(t.timestamp):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.timestamp&&(e.timestamp=t.timestamp),e},create:t=>c.fromPartial(t??{}),fromPartial(t){const e={url:"",timestamp:""};return e.url=t.url??"",e.timestamp=t.timestamp??"",e}};const h={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),""!==t.responseLanguage&&o.uint32(26).string(t.responseLanguage),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={url:"",language:"",responseLanguage:""};for(;n.pos>>3){case 1:if(10!==t)break;a.url=n.string();continue;case 2:if(18!==t)break;a.language=n.string();continue;case 3:if(26!==t)break;a.responseLanguage=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({url:b(t.url)?globalThis.String(t.url):"",language:b(t.language)?globalThis.String(t.language):"",responseLanguage:b(t.responseLanguage)?globalThis.String(t.responseLanguage):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),e},create:t=>h.fromPartial(t??{}),fromPartial(t){const e={url:"",language:"",responseLanguage:""};return e.url=t.url??"",e.language=t.language??"",e.responseLanguage=t.responseLanguage??"",e}};const p={encode:(t,o=e.Writer.create())=>(0!==t.interval&&o.uint32(8).int32(t.interval),void 0!==t.translatedInfo&&c.encode(t.translatedInfo,o.uint32(18).fork()).ldelim(),void 0!==t.pingId&&o.uint32(24).int32(t.pingId),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={interval:0,translatedInfo:void 0,pingId:void 0};for(;n.pos>>3){case 1:if(8!==t)break;a.interval=n.int32();continue;case 2:if(18!==t)break;a.translatedInfo=c.decode(n,n.uint32());continue;case 3:if(24!==t)break;a.pingId=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({interval:b(t.interval)?i(t.interval):0,translatedInfo:b(t.translatedInfo)?c.fromJSON(t.translatedInfo):void 0,pingId:b(t.pingId)?globalThis.Number(t.pingId):void 0}),toJSON(t){const e={};return 0!==t.interval&&(e.interval=function(t){switch(t){case n.NO_CONNECTION:return"NO_CONNECTION";case n.TRANSLATING:return"TRANSLATING";case n.STREAMING:return"STREAMING";case n.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(t.interval)),void 0!==t.translatedInfo&&(e.translatedInfo=c.toJSON(t.translatedInfo)),void 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>p.fromPartial(t??{}),fromPartial(t){const e={interval:0,translatedInfo:void 0,pingId:void 0};return e.interval=t.interval??0,e.translatedInfo=void 0!==t.translatedInfo&&null!==t.translatedInfo?c.fromPartial(t.translatedInfo):void 0,e.pingId=t.pingId??void 0,e}};const g={encode:(t,o=e.Writer.create())=>(0!==t.pingId&&o.uint32(8).int32(t.pingId),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={pingId:0};for(;n.pos>>3){case 1:if(8!==t)break;a.pingId=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({pingId:b(t.pingId)?globalThis.Number(t.pingId):0}),toJSON(t){const e={};return 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>g.fromPartial(t??{}),fromPartial(t){const e={pingId:0};return e.pingId=t.pingId??0,e}};const v={encode:(t,o=e.Writer.create())=>(""!==t.uuid&&o.uint32(10).string(t.uuid),""!==t.module&&o.uint32(18).string(t.module),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={uuid:"",module:""};for(;n.pos>>3){case 1:if(10!==t)break;a.uuid=n.string();continue;case 2:if(18!==t)break;a.module=n.string();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({uuid:b(t.uuid)?globalThis.String(t.uuid):"",module:b(t.module)?globalThis.String(t.module):""}),toJSON(t){const e={};return""!==t.uuid&&(e.uuid=t.uuid),""!==t.module&&(e.module=t.module),e},create:t=>v.fromPartial(t??{}),fromPartial(t){const e={uuid:"",module:""};return e.uuid=t.uuid??"",e.module=t.module??"",e}};const m={encode:(t,o=e.Writer.create())=>(""!==t.secretKey&&o.uint32(10).string(t.secretKey),0!==t.expires&&o.uint32(16).int32(t.expires),o),decode(t,o){const n=t instanceof e.Reader?t:e.Reader.create(t);let i=void 0===o?n.len:n.pos+o;const a={secretKey:"",expires:0};for(;n.pos>>3){case 1:if(10!==t)break;a.secretKey=n.string();continue;case 2:if(16!==t)break;a.expires=n.int32();continue}if(4==(7&t)||0===t)break;n.skipType(7&t)}return a},fromJSON:t=>({secretKey:b(t.secretKey)?globalThis.String(t.secretKey):"",expires:b(t.expires)?globalThis.Number(t.expires):0}),toJSON(t){const e={};return""!==t.secretKey&&(e.secretKey=t.secretKey),0!==t.expires&&(e.expires=Math.round(t.expires)),e},create:t=>m.fromPartial(t??{}),fromPartial(t){const e={secretKey:"",expires:0};return e.secretKey=t.secretKey??"",e.expires=t.expires??0,e}};function b(t){return null!=t}const f={encodeTranslationRequest:(t,e,o,n,i)=>r.encode({url:t,firstRequest:!0,duration:e,unknown0:1,language:o,forceSourceLang:!1,unknown1:0,translationHelp:i||[],responseLanguage:n,unknown2:0,unknown3:1,bypassCache:!1}).finish(),decodeTranslationResponse:t=>s.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>d.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>u.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>g.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>h.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>p.decode(new Uint8Array(t)),encodeYandexSessionRequest:(t,e)=>v.encode({uuid:t,module:e}).finish(),decodeYandexSessionResponse:t=>m.decode(new Uint8Array(t))},y={host:"api.browser.yandex.ru",hostVOT:"vot-api.toil.cc/v1",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 YaBrowser/24.7.0.0 Safari/537.36",componentVersion:"24.7.0.2377",hmac:"bt8xH3VOlb4mqf0nqAibnDOoiPlXsisf",defaultDuration:343},w=new TextEncoder;async function x(t,e,o){const n=await crypto.subtle.importKey("raw",w.encode(e),{name:"HMAC",hash:{name:t}},!1,["sign","verify"]);return await crypto.subtle.sign("HMAC",n,o)}async function S(t){const e=await x("SHA-256",y.hmac,t);return new Uint8Array(e).reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),"")}var k,T;async function V(t,e={headers:{"User-Agent":y.userAgent}}){const{timeout:o=3e3,...n}=e,i=new AbortController,a=setTimeout((()=>i.abort()),o),r=await fetch(t,{signal:i.signal,...n});return clearTimeout(a),r}!function(t){t.custom="custom",t.directlink="custom",t.youtube="youtube",t.piped="piped",t.invidious="invidious",t.vk="vk",t.nine_gag="nine_gag",t.gag="nine_gag",t.twitch="twitch",t.proxitok="proxitok",t.tiktok="tiktok",t.vimeo="vimeo",t.xvideos="xvideos",t.pornhub="pornhub",t.twitter="twitter",t.rumble="rumble",t.facebook="facebook",t.rutube="rutube",t.coub="coub",t.bilibili="bilibili",t.mail_ru="mailru",t.mailru="mailru",t.bitchute="bitchute",t.eporner="eporner",t.peertube="peertube",t.dailymotion="dailymotion",t.trovo="trovo",t.yandexdisk="yandexdisk",t.ok_ru="okru",t.okru="okru",t.googledrive="googledrive",t.bannedvideo="bannedvideo",t.weverse="weverse",t.newgrounds="newgrounds",t.egghead="egghead",t.youku="youku",t.archive="archive",t.kodik="kodik",t.patreon="patreon",t.reddit="reddit",t.kick="kick",t.apple_developer="apple_developer",t.appledeveloper="apple_developer",t.poketube="poketube",t.epicgames="epicgames",t.nineanimetv="nineanimetv",t.odysee="odysee",t.coursehunter="coursehunter",t.udemy="udemy",t.coursera="coursera"}(k||(k={})),function(t){t[t.FAILED=0]="FAILED",t[t.FINISHED=1]="FINISHED",t[t.WAITING=2]="WAITING",t[t.LONG_WAITING=3]="LONG_WAITING",t[t.PART_CONTENT=5]="PART_CONTENT",t[t.LONG_WAITING_2=6]="LONG_WAITING_2"}(T||(T={}));const L=["yewtu.be","yt.artemislena.eu","invidious.flokinet.to","iv.melmac.space","inv.nadeko.net","inv.tux.pizza","invidious.private.coffee","yt.drgnz.club","vid.puffyan.us","invidious.dhusch.de"],M=["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],A=[{additionalData:"mobile",host:k.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:k.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:".player-container"},{host:k.youtube,url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:k.invidious,url:"https://youtu.be/",match:L,selector:"#player"},{host:k.piped,url:"https://youtu.be/",match:M,selector:".shaka-video-container"},{host:k.poketube,url:"https://youtu.be/",match:["poketube.fun","pt.sudovanilla.org","poke.ggtyler.dev","poke.uk2.littlekai.co.uk","poke.blahai.gay"],selector:".video-player-container"},{additionalData:"mobile",host:k.vk,url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{additionalData:"clips",host:k.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:'div[data-testid="clipcontainer-video"]'},{host:k.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:k.nine_gag,url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:k.twitch,url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^(www.)?twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:k.proxitok,url:"https://www.tiktok.com/",match:["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],selector:".column.has-text-centered"},{host:k.tiktok,url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:k.vimeo,url:"https://vimeo.com/",match:/^vimeo.com$/,selector:".player"},{host:k.vimeo,url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,selector:".player"},{host:k.xvideos,url:"https://www.xvideos.com/",match:/^(www.)?(xvideos|xv-ru).com$/,selector:".video-bg-pic"},{host:k.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div"},{additionalData:"embed",host:k.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{host:k.twitter,url:"https://twitter.com/i/status/",match:/^(twitter|x).com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div'},{host:k.rumble,url:"https://rumble.com/",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:k.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[role="main"] div[data-pagelet$="video" i]'},{additionalData:"reels",host:k.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]'},{host:k.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:k.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:k.bilibili,url:"https://www.bilibili.com/video/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:k.bilibili,url:"https://www.bilibili.com/video/",match:/^(www|m).bilibili.com$/,selector:null},{host:k.mailru,url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:k.bitchute,url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:".video-js"},{host:k.eporner,url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:k.peertube,url:"stub",match:["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf","peertube.su","video.blender.org","videos.viorsan.com","tube-sciences-technologies.apps.education.fr","tube-numerique-educatif.apps.education.fr","tube-arts-lettres-sciences-humaines.apps.education.fr","beetoons.tv","comics.peertube.biz","makertube.net"],selector:".vjs-v7"},{host:k.dailymotion,url:"https://dai.ly/",match:/^geo([\d]+)?.dailymotion.com$/,selector:".player"},{host:k.trovo,url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:k.yandexdisk,url:"https://yadi.sk/i/",match:/^disk.yandex.ru$/,selector:".video-player__player > div:nth-child(1)"},{host:k.okru,url:"https://ok.ru/video/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:k.googledrive,url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:k.bannedvideo,url:"https://madmaxworld.tv/watch?id=",match:/^(www.)?banned.video|madmaxworld.tv$/,selector:".vjs-v7",needExtraData:!0},{host:k.weverse,url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper",needExtraData:!0},{host:k.newgrounds,url:"https://www.newgrounds.com/",match:/^(www.)?newgrounds.com$/,selector:".ng-video-player"},{host:k.egghead,url:"https://egghead.io/",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:k.youku,url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"},{host:k.archive,url:"https://archive.org/details/",match:/^archive.org$/,selector:".jw-media"},{host:k.kodik,url:"stub",match:/^kodik.(info|biz|cc)$/,selector:".fp-player",needExtraData:!0},{host:k.patreon,url:"stub",match:/^(www.)?patreon.com$/,selector:'div[data-tag="post-card"] div[elevation="subtle"] > div > div > div > div',needExtraData:!0},{host:k.reddit,url:"stub",match:/^(www.|new.|old.)?reddit.com$/,selector:".reddit-video-player-root",needExtraData:!0},{host:k.kick,url:"https://kick.com/",match:/^kick.com$/,selector:".vjs-v8",needExtraData:!0},{host:k.appledeveloper,url:"https://developer.apple.com/",match:/^developer.apple.com$/,selector:".developer-video-player",needExtraData:!0},{host:k.epicgames,url:"https://dev.epicgames.com/community/learning/",match:/^dev.epicgames.com$/,selector:".vjs-v7",needExtraData:!0},{host:k.nineanimetv,url:"https://9animetv.to/watch/",match:/^rapid-cloud.co$/,selector:".jw-media",needExtraData:!0},{host:k.odysee,url:"stub",match:/^odysee.com$/,selector:".vjs-v7",needExtraData:!0},{host:k.coursehunter,url:"https://coursehunter.net/course/",match:/^coursehunter.net$/,selector:"#oframeplayer > pjsdiv:nth-of-type(1)",needExtraData:!0},{host:k.udemy,url:"https://www.udemy.com/",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)',needExtraData:!0},{host:k.coursera,url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v6",needExtraData:!0},{host:k.custom,url:"stub",match:t=>/([^.]+).mp4/.test(t.pathname),rawResult:!0}],O=JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTMediaCSPError":"Failed to load audio (media csp error)","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})"}'),I={log:(...t)=>{}},C=I,P=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,C.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0,o=!1){if(this.gmSupport)return GM_getValue(t,e);const n=window.localStorage.getItem(t)??e;return o?Number(n):n}async get(t,e=void 0,o=!1){return this.gmSupport?await GM_getValue(t,e):Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):window.localStorage.setItem(t,e)}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","autoVolume","buttonPos","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","audioProxy","showPiPButton","translateAPIErrors","translationService","detectService","m3u8ProxyHost","translateProxyEnabled","hotkeyButton","proxyWorkerHost","audioBooster","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}},E=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],_=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-version","locale-lang-override"];constructor(){const t=P.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(P.syncGet("locale-phrases",""))}reset(){for(let t=0;t{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale(O,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale(O,t)??t}},N=navigator.language||navigator.userLanguage,$=N?.substr(0,2)?.toLowerCase()??"en";function R(t){return t.toLowerCase().split(/[_;-]/)[0].trim()}function B(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function D(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}const F=new RegExp([/(?:https?|ftp):\/\/\S+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/0x[a-fA-F0-9]{40}/g,/[13][a-km-zA-HJ-NP-Z1-9]{25,34}/g,/4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}/g,/Paypal/g].map((t=>t.source)).join("|"));async function q(t,e={}){const{timeout:o=15e3,...n}=e,i=new AbortController,a=setTimeout((()=>i.abort()),o);try{if(t.includes("api.browser.yandex.ru"))throw new Error("Preventing yandex cors");const e=await fetch(t,{signal:i.signal,...n});return clearTimeout(a),e}catch(e){return C.log("GM_fetch preventing cors by GM_xmlhttpRequest",e.message),new Promise(((e,i)=>{clearTimeout(a),GM_xmlhttpRequest({method:n.method||"GET",url:t,responseType:"blob",...n,data:n.body,timeout:o,onload:t=>{const o=Object.fromEntries(t.responseHeaders.trim().split(/\r?\n/).map((t=>t.split(/: (.+)/))).filter((([t])=>t&&/^[\w-]+$/.test(t))));e(new Response(t.response,{status:t.status,headers:o}))},ontimeout:()=>i(new Error("Timeout")),onerror:t=>i(t),onabort:()=>i(new Error("AbortError"))})}))}}class H extends Error{constructor(t){super(t),this.name="VideoHelper",this.message=t}}class z{API_ORIGIN="https://example.com";fetch;constructor({fetchFn:t=q}={}){this.fetch=t}async getVideoData(t){}async getVideoId(t){}}class U extends z{API_ORIGIN="https://my.mail.ru";async getVideoMeta(t){try{const e=await this.fetch(`${this.API_ORIGIN}/+/video/meta/${t}?xemail=&ajax_call=1&func_name=&mna=&mnb=&ext=1&_=${(new Date).getTime()}`);return await e.json()}catch(t){return void console.error("Failed to get mail.ru video data",t.message)}}async getVideoId(t){const e=t.pathname;if(/\/(v|mail|bk|inbox)\//.exec(e))return e.slice(1);const o=/video\/embed\/([^/]+)/.exec(e)?.[1];if(!o)return;const n=await this.getVideoMeta(o);return n?n.meta.url.replace("//my.mail.ru/",""):void 0}}class G extends z{API_ORIGIN="https://global.apis.naver.com/weverse/wevweb";API_APP_ID="be4d79eb8fc7bd008ee82c8ec4ff6fd4";API_HMAC_KEY="1b9cb6378d959b45714bec49971ade22e6e24e42";HEADERS={Accept:"application/json, text/plain, */*",Origin:"https://weverse.io",Referer:"https://weverse.io/"};getURLData(){return{appId:this.API_APP_ID,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}async createHash(t){const e=Date.now(),o=t.substring(0,Math.min(255,t.length))+e,n=await async function(t,e){try{const o=w.encode(e),n=await x("SHA-1",t,o);return btoa(String.fromCharCode(...new Uint8Array(n)))}catch(t){return console.error(t),!1}}(this.API_HMAC_KEY,o);if(!n)throw new H("Failed to get weverse HMAC signature");return{wmsgpad:e.toString(),wmd:n}}async getHashURLParams(t){const e=await this.createHash(t);return new URLSearchParams(e).toString()}async getPostPreview(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{headers:this.HEADERS});return await o.json()}catch(e){return console.error(`Failed to get weverse post preview by postId: ${t}`,e.message),!1}}async getVideoInKey(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{method:"POST",headers:this.HEADERS});return await o.json()}catch(e){return console.error(`Failed to get weverse InKey by videoId: ${t}`,e.message),!1}}async getVideoInfo(t,e,o){const n=Date.now();try{const i=new URLSearchParams({key:e,sid:o,nonce:n.toString(),devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:JSON.stringify([{adSystem:null}]),adu:"/"}).toString(),a=await this.fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+i,{headers:this.HEADERS});return await a.json()}catch(n){return console.error(`Failed to get weverse video info (infraVideoId: ${t}, inkey: ${e}, serviceId: ${o}`,n.message),!1}}extractVideoInfo(t){return t.find((t=>!1===t.useP2P&&t.source.includes(".mp4")))}async getVideoData(t){const e=await this.getPostPreview(t);if(!e)return;const{videoId:o,serviceId:n,infraVideoId:i}=e.extension.video;if(!(o&&n&&i))return;const a=await this.getVideoInKey(o);if(!a)return;const r=await this.getVideoInfo(i,a.inKey,n);if(!r)return;const s=this.extractVideoInfo(r.videos.list);return s?{url:s.source,duration:s.duration}:void 0}async getVideoId(t){return/([^/]+)\/(live|media)\/([^/]+)/.exec(t.pathname)?.[3]}}class W extends z{API_ORIGIN=window.location.origin;async getSecureData(t){try{const e=await this.fetch(`${this.API_ORIGIN}${t}`,{headers:{"User-Agent":y.userAgent,Origin:this.API_ORIGIN,Referer:this.API_ORIGIN}}),o=await e.text(),[n,i,a]=t.split("/").filter((t=>t)),r=(new DOMParser).parseFromString(o,"text/html"),s=Array.from(r.getElementsByTagName("script")).filter((t=>t.innerHTML.includes(`videoId = "${i}"`)));if(!s.length)throw new H("Failed to find secure script");const l=/'{[^']+}'/.exec(s[0].textContent.trim())?.[0];if(!l)throw new H("Secure json wasn't found in secure script");const d=JSON.parse(l.replaceAll("'",""));return{videoType:n,videoId:i,hash:a,...d}}catch(e){return console.error(`Failed to get kodik secure data by videoPath: ${t}.`,e.message),!1}}async getFtor(t){const{videoType:e,videoId:o,hash:n,d:i,d_sign:a,pd:r,pd_sign:s,ref:l,ref_sign:d}=t;try{const t=await this.fetch(this.API_ORIGIN+"/ftor",{method:"POST",headers:{"User-Agent":y.userAgent,Origin:this.API_ORIGIN,Referer:`${this.API_ORIGIN}/${e}/${o}/${n}/360p`},body:new URLSearchParams({d:i,d_sign:a,pd:r,pd_sign:s,ref:decodeURIComponent(l),ref_sign:d,bad_user:"false",cdn_is_working:"true",info:"{}",type:e,hash:n,id:o})});return await t.json()}catch(t){return console.error(`Failed to get kodik video data (type: ${e}, id: ${o}, hash: ${n})`,t.message),!1}}decryptUrl(t){return"https:"+atob(t.replace(/[a-zA-Z]/g,(function(t){const e=t.charCodeAt(0)+13;return String.fromCharCode((t<="Z"?90:122)>=e?e:e-26)})))}async getVideoData(t){const e=await this.getSecureData(t);if(!e)return;const o=await this.getFtor(e);if(!o)return;const n=Object.entries(o.links[o.default.toString()]),i=n.find((([t,e])=>"application/x-mpegURL"===e.type))?.[1];return i?{url:this.decryptUrl(i.src)}:void 0}async getVideoId(t){return/\/(seria|video)\/([^/]+)\/([^/]+)\/([\d]+)p/.exec(t.pathname)?.[0]}}class j extends z{API_ORIGIN="https://www.patreon.com/api";async getPosts(t){try{const e=await this.fetch(`${this.API_ORIGIN}/posts/${t}?json-api-use-default-includes=false`);return await e.json()}catch(e){return console.error(`Failed to get patreon posts by postId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPosts(t);if(!e)return;const o=e.data.attributes.post_file.url;return o?{url:o}:void 0}async getVideoId(t){const e=/posts\/([^/]+)/.exec(t.pathname)?.[1];if(e)return e.replace(/[^\d.]/g,"")}}class Y extends z{API_ORIGIN="https://www.reddit.com";async getVideoData(t){const e=document.querySelector("[data-hls-url]")?.dataset.hlsUrl.replaceAll("&","&");if(e)return{url:decodeURIComponent(e)}}async getVideoId(t){return/\/r\/(([^/]+)\/([^/]+)\/([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}}class J extends z{API_ORIGIN="https://api.banned.video";async getVideoInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/graphql`,{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n title\n description: summary\n duration: videoDuration\n videoUrl: directUrl\n isStream: live\n }\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}});return await e.json()}catch(e){return console.error(`Failed to get bannedvideo video info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getVideoInfo(t);if(!e)return;const{videoUrl:o,duration:n,isStream:i,description:a,title:r}=e.data.getVideo;return{url:o,duration:n,isStream:i,title:r,description:a}}async getVideoId(t){return t.searchParams.get("id")??void 0}}class K extends z{API_ORIGIN="https://kick.com/api/v2";async getClipInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/clips/${t}`);return await e.json()}catch(e){return console.error(`Failed to get kick clip info by clipId: ${t}.`,e.message),!1}}async getVideoData(t){if(!t.startsWith("clip_"))return{url:A.find((t=>t.host===k.kick)).url+t};const e=await this.getClipInfo(t);if(!e)return;const{clip_url:o,duration:n,title:i}=e.clip;return{url:o,duration:n,title:i}}async getVideoId(t){const e=/video\/([^/]+)/.exec(t.pathname)?.[0];if(e)return e;const o=t.searchParams.get("clip");if(o)return o;const n=document.getElementById("clip-video-player");return/clip_([^/]+)/.exec(n?.getAttribute("poster"))?.[0]}}class Z extends z{API_ORIGIN="https://developer.apple.com";async getVideoData(t){const e=document.querySelector("meta[property='og:video']")?.content;if(e)return{url:e}}async getVideoId(t){return/videos\/play\/([^/]+)\/([\d]+)/.exec(t.pathname)?.[0]}}class Q extends z{API_ORIGIN="https://dev.epicgames.com/community/api/learning";async getPostInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/post.json?hash_id=${t}`);return await e.json()}catch(e){return console.error(`Failed to get epicgames post info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPostInfo(t);if(!e)return;const o=e.blocks.find((t=>"video"===t.type))?.video_url?.replace("qsep://","https://");return o?{url:o}:void 0}async getVideoId(t){return/\/(\w{3,5})\/[^/]+$/.exec(t.pathname)?.[1]}}class X extends z{API_ORIGIN="https://9animetv.to/ajax/episode";RAPID_CLOUD_ORIGIN="https://rapid-cloud.co/ajax/embed-6-v2";async getSourceId(t){try{const e=await this.fetch(`${this.API_ORIGIN}/servers?episodeId=${t}`),o=await e.json();return!!o.html&&/data-id="(\d+)"/.exec(o.html)?.[1]}catch(e){return console.error(`Failed to get 9animetv servers info by episodeId: ${t}.`,e.message),!1}}async getPlayerLink(t){try{const e=await this.fetch(`${this.API_ORIGIN}/sources?id=${t}`),o=await e.json();return!!o.link.includes("rapid-cloud.co")&&o.link}catch(e){return console.error(`Failed to get player link by sourceId: ${t}.`,e.message),!1}}async getRapidCloudData(t){try{const e=await this.fetch(`${this.RAPID_CLOUD_ORIGIN}/getSources?id=${t}`),o=await e.json();return o.encrypted?(console.warn("Encrypted RapidCloud data found. Let us know about it",o),!1):o}catch(e){return console.error(`Failed to get rapid cloud data by rapidId: ${t}.`,e.message),!1}}async getVideoData(t){const e=t.split("?ep=")[1],o=await this.getSourceId(e);if(!o)return;const n=await this.getPlayerLink(o);if(!n)return;const i=/\/([^/?]+)\?/.exec(n)?.[1];if(!i)return;const a=await this.getRapidCloudData(i);if(!a)return;const r=a.sources.find((t=>"hls"===t.type))?.file;return r?{url:r}:void 0}async getVideoId(t){return new Promise((t=>{const e="https://9animetv.to";window.addEventListener("message",(o=>{o.origin===e&&o.data?.startsWith("getVideoId:")&&t(o.data.replace("getVideoId:",""))})),window.top.postMessage("getVideoId",e)}))}}class tt extends z{API_ORIGIN="https://odysee.com";async getVideoData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/${t}`),o=await e.text();return{url:/"contentUrl":(\s)?"([^"]+)"/.exec(o)?.[2]}}catch(t){return void console.error("Failed to get odysee video data",t.message)}}async getVideoId(t){return t.pathname.slice(1)}}class et extends z{API_ORIGIN="https://coursehunter.net/api/v1";getCourseId(t){return window.course_id??+document.querySelector('input[name="course_id"]')?.value}async getLessonsData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/course/${t}/lessons`);return await e.json()}catch(e){return console.error(`Failed to get Coursehunter lessons data by courseId: ${t}`,e.message),!1}}async getVideoData(t){const e=this.getCourseId(t);if(!e)return;const o=window.lessons??await this.getLessonsData(e);if(!o)return;const n=+(t.split("?lesson=")?.[1]??document.querySelector(".lessons-item_active")?.dataset?.index??1),i=o?.[n-1],{file:a,duration:r,title:s}=i;return a?{url:a,duration:r,title:s}:void 0}async getVideoId(t){const e=/\/course\/([^/]+)/.exec(t.pathname)?.[1];return e?e+t.search:void 0}}class ot extends z{API_ORIGIN="https://clips.twitch.tv";async getClipLink(t,e){const o=document.querySelector("script[type='application/ld+json']"),n=t.slice(1);if(o){const t=JSON.parse(o.innerText),e=t["@graph"].find((t=>"VideoObject"===t["@type"]))?.creator.url;return`${e.replace("https://www.twitch.tv/","")}/clip/${n}`}const i="embed"===n,a=document.querySelector(i?".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']":".clips-player a:not([class])");if(!a)return;return`${a.href.replace("https://www.twitch.tv/","")}/clip/${i?e:n}`}async getVideoId(t){const e=t.pathname;if(/^m\.twitch\.tv$/.test(e))return/videos\/([^/]+)/.exec(t.href)?.[0]??e.slice(1);if(/^player\.twitch\.tv$/.test(t.hostname))return`videos/${t.searchParams.get("video")}`;const o=/([^/]+)\/(?:clip)\/([^/]+)/.exec(e);if(o)return o[0];return/^clips\.twitch\.tv$/.test(t.hostname)?await this.getClipLink(e,t.searchParams.get("clip")):/(?:videos)\/([^/]+)/.exec(e)?.[0]}}const nt=["auto","ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],it=["ru","en","kk"];class at extends z{API_ORIGIN="https://www.udemy.com/api-2.0";getModuleData(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(_.get("udemyModuleArgsNotFound")),{})}getLectureId(){return/learn\/lecture\/([^/]+)/.exec(window.location.pathname)?.[1]}async getLectureData(t,e){const o=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}/lectures/${e}/?`+new URLSearchParams({"fields[lecture]":"title,description,asset","fields[asset]":"length,media_sources,captions"}));return await o.json()}async getCourseLang(t){const e=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}?`+new URLSearchParams({"fields[course]":"locale"}));return await e.json()}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>R(t.locale_id)===e));return o||(o=t?.find((t=>"en"===R(t.locale_id)))??t?.[0]),o?.url}async getVideoData(t){const{courseId:e}=this.getModuleData();if(!e)return;const o=this.getLectureId();if(C.log(`[Udemy] courseId: ${e}, lectureId: ${o}`),!o)return;const{title:n,description:i,asset:a}=await this.getLectureData(e,o),{length:r,media_sources:s,captions:l}=a,d=this.findVideoUrl(s);if(!d)return void console.log("Failed to find .mp4 video file in media_sources",s);const u=await this.getCourseLang(e);let{locale:{locale:c}}=u;c=c?R(c):"en",nt.includes(c)||(c="en");const h=this.findSubtitleUrl(l,c);return h||console.log("Failed to find subtitle file in captions",l),{...h?{url:A.find((t=>t.host===k.udemy)).url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:h},{target:"video_file_url",targetUrl:d}],detectedLanguage:c}:{url:d,translationHelp:null},duration:r,title:n,description:i}}async getVideoId(t){return t.pathname.slice(1)}}class rt extends z{API_ORIGIN="https://www.coursera.org/api";async getCourseData(t){const e=await this.fetch(`${this.API_ORIGIN}/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}getPlayer(){return document.querySelector(".vjs-v6")}getPlayerData(){return this.getPlayer()?.player}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>R(t.srclang)===e));return o||(o=t?.find((t=>"en"===R(t.srclang)))||t?.[0]),o?.src}async getVideoData(t){const e=this.getPlayerData(),{duration:o}=e?.cache_||{},{courseId:n,tracks:i,sources:a}=e?.options_||{},r=this.findVideoUrl(a);if(!r)return void console.log("Failed to find .mp4 video file in sources",a);const{primaryLanguageCodes:s}=await this.getCourseData(n);let l=s?.[0];l=l?R(l):"en",nt.includes(l)||(l="en");const d=this.findSubtitleUrl(i,l);return d||console.log("Failed to find subtitle file in tracks",i),{...d?{url:A.find((t=>t.host===k.coursera)).url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:d},{target:"video_file_url",targetUrl:r}],detectedLanguage:l}:{url:r,translationHelp:null},duration:o}}async getVideoId(t){return/learn\/([^/]+)\/lecture\/([^/]+)/.exec(t.pathname)?.[0]}}class st{static[k.mailru]=new U;static[k.weverse]=new G;static[k.kodik]=new W;static[k.patreon]=new j;static[k.reddit]=new Y;static[k.bannedvideo]=new J;static[k.kick]=new K;static[k.appledeveloper]=new Z;static[k.epicgames]=new Q;static[k.nineanimetv]=new X;static[k.odysee]=new tt;static[k.twitch]=new ot;static[k.coursehunter]=new et;static[k.udemy]=new at;static[k.coursera]=new rt}class lt extends Error{constructor(t){super(t),this.name="VideoDataError",this.message=t}}async function dt(t,e){const o=new URL(window.location.href),n=t.host;if(Object.getOwnPropertyDescriptor(st,n))return await st[n].getVideoId(o);switch(n){case k.custom:return o.href;case k.piped:case k.poketube:case k.invidious:case k.youtube:return"youtu.be"===o.hostname&&(o.search=`?v=${o.pathname.replace("/","")}`,o.pathname="/watch"),/(?:watch|embed|shorts|live)\/([^/]+)/.exec(o.pathname)?.[1]??o.searchParams.get("v");case k.vk:{const t=/^\/(video|clip)-?\d{8,9}_\d{9}$/.exec(o.pathname),n=o.searchParams.get("z"),i=o.searchParams.get("oid"),a=o.searchParams.get("id");if(t)return t[0].slice(1);if(n)return n.split("/")[0];if(i&&a)return`video-${Math.abs(parseInt(i))}_${a}`;const r=e.parentElement?.closest(".video_box_wrap");return r?r.id.replace("video_box_wrap","video"):null}case k.nine_gag:case k.gag:return/gag\/([^/]+)/.exec(o.pathname)?.[1];case k.proxitok:case k.tiktok:return/([^/]+)\/video\/([^/]+)/.exec(o.pathname)?.[0];case k.vimeo:{const t=o.searchParams.get("app_id"),e=/[^/]+\/[^/]+$/.exec(o.pathname)?.[0]??/[^/]+$/.exec(o.pathname)?.[0];return t?`${e}?app_id=${t}`:e}case k.xvideos:return/[^/]+\/[^/]+$/.exec(o.pathname)?.[0];case k.pornhub:return o.searchParams.get("viewkey")??/embed\/([^/]+)/.exec(o.pathname)?.[1];case k.twitter:return/status\/([^/]+)/.exec(o.pathname)?.[1];case k.rumble:case k.facebook:return o.pathname.slice(1);case k.rutube:return/(?:video|embed)\/([^/]+)/.exec(o.pathname)?.[1];case k.bilibili:{const t=o.searchParams.get("bvid");if(t)return t;let e=/video\/([^/]+)/.exec(o.pathname)?.[1];return e&&null!==o.searchParams.get("p")&&(e+=`/?p=${o.searchParams.get("p")}`),e}case k.bitchute:return/(video|embed)\/([^/]+)/.exec(o.pathname)?.[2];case k.eporner:return/video-([^/]+)\/([^/]+)/.exec(o.pathname)?.[0];case k.peertube:return/\/w\/([^/]+)/.exec(o.pathname)?.[0];case k.dailymotion:{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));let e=t?.[1]?.lastChild?.src;if(!e)return;return/\/video\/(\w+)\.m3u8/.exec(e)?.[1]}case k.trovo:{const t=o.searchParams.get("vid");if(!t)return null;const e=/([^/]+)\/([\d]+)/.exec(o.pathname)?.[0];return e?`${e}?vid=${t}`:null}case k.yandexdisk:return/\/i\/([^/]+)/.exec(o.pathname)?.[1];case k.okru:return/\/video\/(\d+)/.exec(o.pathname)?.[1];case k.googledrive:return o.searchParams.get("docid");case k.newgrounds:return/([^/]+)\/(view)\/([^/]+)/.exec(o.pathname)?.[0];case k.egghead:return o.pathname.slice(1);case k.youku:return/v_show\/id_[\w=]+/.exec(o.pathname)?.[0];case k.archive:return/(details|embed)\/([^/]+)/.exec(o.pathname)?.[2];default:return}}async function ut(t,e){const o=await dt(t,e);if(!o)throw new lt(`Entered unsupported link: "${t.host}"`);if(t.host===k.peertube&&(t.url=window.location.origin),t.rawResult)return{url:o,videoId:o,host:t.host,duration:void 0};if(!t.needExtraData)return{url:t.url+o,videoId:o,host:t.host,duration:void 0};const n=await st[t.host].getVideoData(o);if(!n)throw new lt(`Failed to get video raw url for ${t.host}`);return{...n,videoId:o,host:t.host}}class ct extends Error{constructor(t){super(_.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=_.get(t)}}const{rE:ht}={rE:"1.1.0"};class pt extends Error{data;constructor(t,e=void 0){super(t),this.data=e,this.name="VOTJSError",this.message=t}}class gt{host;hostVOT;schema;schemaVOT;fetch;fetchOpts;getVideoDataFn;sessions={};requestLang;responseLang;userAgent=y.userAgent;componentVersion=y.componentVersion;paths={videoTranslation:"/video-translation/translate",videoSubtitles:"/video-subtitles/get-subtitles",streamPing:"/stream-translation/ping-stream",streamTranslation:"/stream-translation/translate-stream",createSession:"/session/create"};isCustomLink(t){return!!(/\.(m3u8|m4(a|v)|mpd)/.exec(t)??/^https:\/\/cdn\.qstv\.on\.epicgames\.com/.exec(t))}headers={"User-Agent":this.userAgent,Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf",Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors"};headersVOT={"User-Agent":`vot.js/${ht}`,"Content-Type":"application/json",Pragma:"no-cache","Cache-Control":"no-cache"};constructor({host:t=y.host,hostVOT:e=y.hostVOT,fetchFn:o=V,fetchOpts:n={},getVideoDataFn:i=ut,requestLang:a="en",responseLang:r="ru",headers:s={}}={}){const l=/(http(s)?):\/\//,d=l.exec(t)?.[1];this.host=d?t.replace(`${d}://`,""):t,this.schema=d??"https";const u=l.exec(e)?.[1];this.hostVOT=u?e.replace(`${u}://`,""):e,this.schemaVOT=u??"https",this.fetch=o,this.fetchOpts=n,this.getVideoDataFn=i,this.requestLang=a,this.responseLang=r,this.headers={...this.headers,...s}}getOpts(t,e={}){return{method:"POST",headers:{...this.headers,...e},body:t,...this.fetchOpts}}async request(t,e,o={}){const n=this.getOpts(new Blob([e]),o);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,n),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestVOT(t,e,o={}){const n=this.getOpts(JSON.stringify(e),{...this.headersVOT,...o});try{const e=await this.fetch(`${this.schemaVOT}://${this.hostVOT}${t}`,n),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async getSession(t){const e=Math.floor(Date.now()/1e3),o=this.sessions[t];if(o&&o.timestamp+o.expires>e)return o;const{secretKey:n,expires:i,uuid:a}=await this.createSession(t);return this.sessions[t]={secretKey:n,expires:i,timestamp:e,uuid:a},this.sessions[t]}async translateVideoYAImpl({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:n=null,headers:i={}}){const{url:a,duration:r=y.defaultDuration}=t,{secretKey:s,uuid:l}=await this.getSession("video-translation"),d=f.encodeTranslationRequest(a,r,e,o,n),u=await S(d),c=await this.request(this.paths.videoTranslation,d,{"Vtrans-Signature":u,"Sec-Vtrans-Sk":s,"Sec-Vtrans-Token":`${u}:${l}:${this.paths.videoTranslation}:${this.componentVersion}`,...i});if(!c.success)throw new ct("requestTranslationFailed");const h=f.decodeTranslationResponse(c.data);switch(C.log("requestTranslation",h),h.status){case T.FAILED:throw h?.message?new pt("Yandex couldn't translate video",h):new ct("requestTranslationFailed");case T.FINISHED:case T.PART_CONTENT:if(!h.url)throw new ct("audioNotReceived");return{translated:!0,url:h.url,remainingTime:h.remainingTime??-1};case T.WAITING:return{translated:!1,remainingTime:h.remainingTime};case T.LONG_WAITING:case T.LONG_WAITING_2:return{translated:!1,remainingTime:h.remainingTime??-1};default:throw console.error("[vot.js] Unknown response",h),new pt("Unknown response from Yandex",h)}}async translateVideoVOTImpl({url:t,videoId:e,service:o,requestLang:n=this.requestLang,responseLang:i=this.responseLang,headers:a={}}){const r=function(t,e,o){return t===k.patreon?{service:"mux",videoId:new URL(o).pathname.slice(1)}:{service:t,videoId:e}}(o,e,t),s=await this.requestVOT(this.paths.videoTranslation,{provider:"yandex",service:r.service,videoId:r.videoId,fromLang:n,toLang:i,rawVideo:t},a);if(!s.success)throw new ct("requestTranslationFailed",s);const l=s.data;switch(l.status){case"failed":throw new pt("Yandex couldn't translate video",l);case"success":if(!l.translatedUrl)throw new ct("audioNotReceived");return{translated:!0,url:l.translatedUrl,remainingTime:-1};case"waiting":return{translated:!1,remainingTime:l.remainingTime,message:l.message}}}async translateVideo({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:n=null,headers:i={}}){const{url:a,videoId:r,host:s}=t;return this.isCustomLink(a)?await this.translateVideoVOTImpl({url:a,videoId:r,service:s,requestLang:e,responseLang:o,headers:i}):await this.translateVideoYAImpl({videoData:t,requestLang:e,responseLang:o,translationHelp:n,headers:i})}async getSubtitles({videoData:t,requestLang:e=this.requestLang,headers:o={}}){const{url:n}=t;if(this.isCustomLink(n))throw new ct("VOTSubtitlesNotSupportedUrl");const{secretKey:i,uuid:a}=await this.getSession("video-translation"),r=f.encodeSubtitlesRequest(n,e),s=await S(r),l=await this.request(this.paths.videoSubtitles,r,{"Vsubs-Signature":await S(r),"Sec-Vsubs-Sk":i,"Sec-Vsubs-Token":`${s}:${a}:${this.paths.videoSubtitles}:${this.componentVersion}`,...o});if(!l.success)throw new pt("Failed to request video subtitles",l);return f.decodeSubtitlesResponse(l.data)}async pingStream({pingId:t,headers:e={}}){const{secretKey:o,uuid:n}=await this.getSession("video-translation"),i=f.encodeStreamPingRequest(t),a=await S(i),r=await this.request(this.paths.streamPing,i,{"Vtrans-Signature":await S(i),"Sec-Vtrans-Sk":o,"Sec-Vtrans-Token":`${a}:${n}:${this.paths.streamPing}:${this.componentVersion}`,...e});if(!r.success)throw new pt("Failed to request stream ping",r);return!0}async translateStream({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,headers:i={}}){const{url:a}=t;if(this.isCustomLink(a))throw new ct("VOTStreamNotSupportedUrl");const{secretKey:r,uuid:s}=await this.getSession("video-translation"),l=f.encodeStreamRequest(a,e,o),d=await S(l),u=await this.request(this.paths.streamTranslation,l,{"Vtrans-Signature":await S(l),"Sec-Vtrans-Sk":r,"Sec-Vtrans-Token":`${d}:${s}:${this.paths.streamTranslation}:${this.componentVersion}`,...i});if(!u.success)throw new pt("Failed to request stream translation",u);const c=f.decodeStreamResponse(u.data),h=c.interval;switch(h){case n.NO_CONNECTION:case n.TRANSLATING:return{translated:!1,interval:h,message:h===n.NO_CONNECTION?"streamNoConnectionToServer":"translationTakeFewMinutes"};case n.STREAMING:return{translated:!0,interval:h,pingId:c.pingId,result:c.translatedInfo};default:throw console.error("[vot.js] Unknown response",c),new pt("Unknown response from Yandex",c)}}async createSession(t){const e=function(){let t="";for(let e=0;e<32;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t}(),o=f.encodeYandexSessionRequest(e,t),n=await this.request(this.paths.createSession,o,{"Vtrans-Signature":await S(o)});if(!n.success)throw new pt("Failed to request create session",n);return{...f.decodeYandexSessionResponse(n.data),uuid:e}}}class vt extends gt{async request(t,e,o={}){const n=this.getOpts(JSON.stringify({headers:{...this.headers,...o},body:Array.from(e)}),{"Content-Type":"application/json"});try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,n),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}}var mt;function bt(t){const e=Math.floor(t/3600),o=Math.floor(t%3600/60),n=Math.floor(t%60),i=Math.floor(t%1*1e3);return`${e.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")},${i.toString().padStart(3,"0")}`}!function(t){t.Channel="Channel",t.Video="Video"}(mt||(mt={}));const ft=globalThis,yt=ft.trustedTypes,wt=yt?yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,xt="$lit$",St=`lit$${Math.random().toFixed(9).slice(2)}$`,kt="?"+St,Tt=`<${kt}>`,Vt=document,Lt=()=>Vt.createComment(""),Mt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,At=Array.isArray,Ot=t=>At(t)||"function"==typeof t?.[Symbol.iterator],It="[ \t\n\f\r]",Ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Et=/>/g,_t=RegExp(`>|${It}(?:([^\\s"'>=/]+)(${It}*=${It}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Nt=/'/g,$t=/"/g,Rt=/^(?:script|style|textarea|title)$/i,Bt=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),Dt=Bt(1),Ft=Bt(2),qt=(Bt(3),Symbol.for("lit-noChange")),Ht=Symbol.for("lit-nothing"),zt=new WeakMap,Ut=Vt.createTreeWalker(Vt,129);function Gt(t,e){if(!At(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==wt?wt.createHTML(e):e}const Wt=(t,e)=>{const o=t.length-1,n=[];let i,a=2===e?"":3===e?"":"",r=Ct;for(let e=0;e"===l[0]?(r=i??Ct,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,s=l[1],r=void 0===l[3]?_t:'"'===l[3]?$t:Nt):r===$t||r===Nt?r=_t:r===Pt||r===Et?r=Ct:(r=_t,i=void 0);const c=r===_t&&t[e+1].startsWith("/>")?" ":"";a+=r===Ct?o+Tt:d>=0?(n.push(s),o.slice(0,d)+xt+o.slice(d)+St+c):o+St+(-2===d?e:c)}return[Gt(t,a+(t[o]||"")+(2===e?"":3===e?"":"")),n]};class jt{constructor({strings:t,_$litType$:e},o){let n;this.parts=[];let i=0,a=0;const r=t.length-1,s=this.parts,[l,d]=Wt(t,e);if(this.el=jt.createElement(l,o),Ut.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=Ut.nextNode())&&s.length0){n.textContent=yt?yt.emptyScript:"";for(let o=0;o2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=Ht}_$AI(t,e=this,o,n){const i=this.strings;let a=!1;if(void 0===i)t=Yt(this,t,e,0),a=!Mt(t)||t!==this._$AH&&t!==qt,a&&(this._$AH=t);else{const n=t;let r,s;for(t=i[0],r=0;r{const n=o?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=o?.renderBefore??null;n._$litPart$=i=new Kt(e.insertBefore(Lt(),t),t,void 0,o??{})}return i._$AI(t),i},ie="m3u8-proxy.toil.cc",ae="vot-worker.toil.cc",re="https://vot-api.toil.cc/v1",se=.15,le="yandex",de="yandex",ue={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},ce={yandex:"https://translate.toil.cc/translate",deepl:"https://translate-deepl.toil.cc/translate"};o("./src/styles/main.scss");const he="#UNDEFINED",pe=Ft` -`;function pe(t){const e=document.createElement("vot-block");return e.classList.add("vot-icon-button"),oe(t,e),e}function ge(t){const e=+t.value,o=+t.min,n=(e-o)/(+t.max-o);t.parentElement.setAttribute("style",`--vot-progress: ${n}`)}function ve(t,e="",o=" ",n=!1){const i=document.createElement("vot-block");i.classList.add("vot-textfield");const a=document.createElement(n?"textarea":"input");a.placeholder=o,a.value=e,t||a.classList.add("vot-show-placeholer");const r=document.createElement("span");return r.append(t),i.append(a,r),{container:i,input:a,label:r}}function me(t){const e=document.createElement("vot-block");e.classList.add("vot-dialog-container"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-dialog-backdrop");const n=document.createElement("vot-block");n.classList.add("vot-dialog");const i=document.createElement("vot-block");i.classList.add("vot-dialog-content-wrapper");const a=document.createElement("vot-block");a.classList.add("vot-dialog-header-container");const r=document.createElement("vot-block");r.classList.add("vot-dialog-body-container");const s=document.createElement("vot-block");s.classList.add("vot-dialog-footer-container");const l=document.createElement("vot-block");l.classList.add("vot-dialog-title-container");const d=pe(Dt``;function ge(t){const e=document.createElement("vot-block");return e.classList.add("vot-icon-button"),ne(t,e),e}function ve(t){const e=+t.value,o=+t.min,n=(e-o)/(+t.max-o);t.parentElement.setAttribute("style",`--vot-progress: ${n}`)}function me(t,e="",o=" ",n=!1){const i=document.createElement("vot-block");i.classList.add("vot-textfield");const a=document.createElement(n?"textarea":"input");a.placeholder=o,a.value=e,t||a.classList.add("vot-show-placeholer");const r=document.createElement("span");return r.append(t),i.append(a,r),{container:i,input:a,label:r}}function be(t){const e=document.createElement("vot-block");e.classList.add("vot-dialog-container"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-dialog-backdrop");const n=document.createElement("vot-block");n.classList.add("vot-dialog");const i=document.createElement("vot-block");i.classList.add("vot-dialog-content-wrapper");const a=document.createElement("vot-block");a.classList.add("vot-dialog-header-container");const r=document.createElement("vot-block");r.classList.add("vot-dialog-body-container");const s=document.createElement("vot-block");s.classList.add("vot-dialog-footer-container");const l=document.createElement("vot-block");l.classList.add("vot-dialog-title-container");const d=ge(Ft` - `);d.classList.add("vot-dialog-close-button"),o.onclick=d.onclick=()=>{e.hidden=!0};const u=document.createElement("vot-block");return u.classList.add("vot-dialog-title"),u.append(t),e.append(o,n),n.append(i),i.append(a,r,s),a.append(l,d),l.append(u),{container:e,backdrop:o,dialog:n,contentWrapper:i,headerContainer:a,bodyContainer:r,footerContainer:s,titleContainer:l,closeButton:d,title:u}}function be(t,e,o,n={}){const{onSelectCb:i=function(){},labelElement:a=""}=n;let r=[];const s=document.createElement("vot-block");s.classList.add("vot-select"),a&&s.append(a);const l=document.createElement("vot-block");l.classList.add("vot-select-outer");const d=document.createElement("span");d.classList.add("vot-select-title"),d.textContent=t,void 0===t&&(d.textContent=o.find((t=>!0===t.selected))?.label);const u=document.createElement("vot-block");u.classList.add("vot-select-arrow-icon"),oe(he,u),l.append(d,u),l.onclick=()=>{const t=me(e);t.container.classList.add("vot-dialog-temp"),t.container.hidden=!1,document.documentElement.appendChild(t.container);const n=document.createElement("vot-block");n.classList.add("vot-select-content-list");for(const t of o){const e=document.createElement("vot-block");e.classList.add("vot-select-content-item"),e.textContent=t.label,e.dataset.votSelected=t.selected,e.dataset.votValue=t.value,t.disabled&&(e.inert=!0),e.onclick=async a=>{if(a.target.inert)return;const r=n.childNodes;for(let t of r)t.dataset.votSelected=!1;for(let e of o)e.selected=e.value===t.value;e.dataset.votSelected=!0,d.textContent=t.label,await i(a)},n.appendChild(e)}const a=ve(_.get("searchField"));a.input.oninput=t=>{const e=t.target.value.toLowerCase();for(let t=0;t{t.container.remove(),r=[]}},s.append(l);return{container:s,title:d,arrowIcon:u,labelElement:a,setTitle:t=>{d.textContent=t},setSelected:t=>{const e=Array.from(r).filter((t=>!t.inert));for(let o=0;o{o=t}}}const fe={createHeader:function(t,e=4){const o=document.createElement("vot-block");return o.classList.add("vot-header"),o.classList.add(`vot-header-level-${e}`),o.append(t),o},createInformation:function(t,e){const o=document.createElement("vot-block");o.classList.add("vot-info");const n=document.createElement("vot-block");n.append(t);const i=document.createElement("vot-block");return i.append(e),o.append(n,i),{container:o,header:n,value:i}},createButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-button"),e.append(t),e},createTextButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-text-button"),e.append(t),e},createOutlinedButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-outlined-button"),e.append(t),e},createIconButton:pe,createCheckbox:function(t,e=!1){const o=document.createElement("label");o.classList.add("vot-checkbox");const n=document.createElement("input");n.type="checkbox",n.checked=Boolean(e);const i=document.createElement("span");return i.append(t),o.append(n,i),{container:o,input:n,label:i}},createSlider:function(t,e=50,o=0,n=100){const i=document.createElement("vot-block");i.classList.add("vot-slider");const a=document.createElement("input");a.type="range",a.min=o,a.max=n,a.value=e;const r=document.createElement("span");return oe(t,r),i.append(a,r),a.addEventListener("input",(t=>ge(t.target))),ge(a),{container:i,input:a,label:r}},createTextfield:ve,createDialog:me,createVOTButton:function(t){const e=document.createElement("vot-block");e.classList.add("vot-segmented-button");const o=document.createElement("vot-block");o.classList.add("vot-segment"),o.classList.add("vot-translate-button"),oe(Dt``);d.classList.add("vot-dialog-close-button"),o.onclick=d.onclick=()=>{e.hidden=!0};const u=document.createElement("vot-block");return u.classList.add("vot-dialog-title"),u.append(t),e.append(o,n),n.append(i),i.append(a,r,s),a.append(l,d),l.append(u),{container:e,backdrop:o,dialog:n,contentWrapper:i,headerContainer:a,bodyContainer:r,footerContainer:s,titleContainer:l,closeButton:d,title:u}}function fe(t,e,o,n={}){const{onSelectCb:i=function(){},labelElement:a=""}=n;let r=[];const s=document.createElement("vot-block");s.classList.add("vot-select"),a&&s.append(a);const l=document.createElement("vot-block");l.classList.add("vot-select-outer");const d=document.createElement("span");d.classList.add("vot-select-title"),d.textContent=t,void 0===t&&(d.textContent=o.find((t=>!0===t.selected))?.label);const u=document.createElement("vot-block");u.classList.add("vot-select-arrow-icon"),ne(pe,u),l.append(d,u),l.onclick=()=>{const t=be(e);t.container.classList.add("vot-dialog-temp"),t.container.hidden=!1,document.documentElement.appendChild(t.container);const n=document.createElement("vot-block");n.classList.add("vot-select-content-list");for(const t of o){const e=document.createElement("vot-block");e.classList.add("vot-select-content-item"),e.textContent=t.label,e.dataset.votSelected=t.selected,e.dataset.votValue=t.value,t.disabled&&(e.inert=!0),e.onclick=async a=>{if(a.target.inert)return;const r=n.childNodes;for(let t of r)t.dataset.votSelected=!1;for(let e of o)e.selected=e.value===t.value;e.dataset.votSelected=!0,d.textContent=t.label,await i(a)},n.appendChild(e)}const a=me(_.get("searchField"));a.input.oninput=t=>{const e=t.target.value.toLowerCase();for(let t=0;t{t.container.remove(),r=[]}},s.append(l);return{container:s,title:d,arrowIcon:u,labelElement:a,setTitle:t=>{d.textContent=t},setSelected:t=>{const e=Array.from(r).filter((t=>!t.inert));for(let o=0;o{o=t}}}const ye={createHeader:function(t,e=4){const o=document.createElement("vot-block");return o.classList.add("vot-header"),o.classList.add(`vot-header-level-${e}`),o.append(t),o},createInformation:function(t,e){const o=document.createElement("vot-block");o.classList.add("vot-info");const n=document.createElement("vot-block");n.append(t);const i=document.createElement("vot-block");return i.append(e),o.append(n,i),{container:o,header:n,value:i}},createButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-button"),e.append(t),e},createTextButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-text-button"),e.append(t),e},createOutlinedButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-outlined-button"),e.append(t),e},createIconButton:ge,createCheckbox:function(t,e=!1){const o=document.createElement("label");o.classList.add("vot-checkbox");const n=document.createElement("input");n.type="checkbox",n.checked=Boolean(e);const i=document.createElement("span");return i.append(t),o.append(n,i),{container:o,input:n,label:i}},createSlider:function(t,e=50,o=0,n=100){const i=document.createElement("vot-block");i.classList.add("vot-slider");const a=document.createElement("input");a.type="range",a.min=o,a.max=n,a.value=e;const r=document.createElement("span");return ne(t,r),i.append(a,r),a.addEventListener("input",(t=>ve(t.target))),ve(a),{container:i,input:a,label:r}},createTextfield:me,createDialog:be,createVOTButton:function(t){const e=document.createElement("vot-block");e.classList.add("vot-segmented-button");const o=document.createElement("vot-block");o.classList.add("vot-segment"),o.classList.add("vot-translate-button"),ne(Ft` - `,o);const n=document.createElement("vot-block");n.classList.add("vot-separator");const i=document.createElement("vot-block");i.classList.add("vot-segment-only-icon"),oe(Dt``,o);const n=document.createElement("vot-block");n.classList.add("vot-separator");const i=document.createElement("vot-block");i.classList.add("vot-segment-only-icon"),ne(Ft` - `,i);const a=document.createElement("vot-block");a.classList.add("vot-separator");const r=document.createElement("vot-block");r.classList.add("vot-segment-only-icon"),oe(Dt``,i);const a=document.createElement("vot-block");a.classList.add("vot-separator");const r=document.createElement("vot-block");r.classList.add("vot-segment-only-icon"),ne(Ft` - `,r);const s=document.createElement("span");return s.classList.add("vot-segment-label"),s.append(t),e.append(o,n,i,a,r),o.append(s),{container:e,translateButton:o,separator:n,pipButton:i,separator2:a,menuButton:r,label:s}},createVOTMenu:function(t){const e=document.createElement("vot-block");e.classList.add("vot-menu"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-menu-content-wrapper");const n=document.createElement("vot-block");n.classList.add("vot-menu-header-container");const i=document.createElement("vot-block");i.classList.add("vot-menu-body-container");const a=document.createElement("vot-block");a.classList.add("vot-menu-footer-container");const r=document.createElement("vot-block");r.classList.add("vot-menu-title-container");const s=document.createElement("vot-block");return s.classList.add("vot-menu-title"),s.append(t),e.append(o),o.append(n,i,a),n.append(r),r.append(s),{container:e,contentWrapper:o,headerContainer:n,bodyContainer:i,footerContainer:a,titleContainer:r,title:s}},createVOTSelectLabel:function(t){const e=document.createElement("span");return e.classList.add("vot-select-label"),e.textContent=t,e},createVOTSelect:be,createVOTLanguageSelect:function(t){const{fromTitle:e=ce,fromDialogTitle:o=ce,fromItems:n=[],fromOnSelectCB:i=null,toTitle:a=ce,toDialogTitle:r=ce,toItems:s=[],toOnSelectCB:l=null}=t,d=document.createElement("vot-block");d.classList.add("vot-lang-select");const u=be(e,o,n,{onSelectCb:i}),c=document.createElement("vot-block");c.classList.add("vot-lang-select-icon"),oe(Dt``,r);const s=document.createElement("span");return s.classList.add("vot-segment-label"),s.append(t),e.append(o,n,i,a,r),o.append(s),{container:e,translateButton:o,separator:n,pipButton:i,separator2:a,menuButton:r,label:s}},createVOTMenu:function(t){const e=document.createElement("vot-block");e.classList.add("vot-menu"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-menu-content-wrapper");const n=document.createElement("vot-block");n.classList.add("vot-menu-header-container");const i=document.createElement("vot-block");i.classList.add("vot-menu-body-container");const a=document.createElement("vot-block");a.classList.add("vot-menu-footer-container");const r=document.createElement("vot-block");r.classList.add("vot-menu-title-container");const s=document.createElement("vot-block");return s.classList.add("vot-menu-title"),s.append(t),e.append(o),o.append(n,i,a),n.append(r),r.append(s),{container:e,contentWrapper:o,headerContainer:n,bodyContainer:i,footerContainer:a,titleContainer:r,title:s}},createVOTSelectLabel:function(t){const e=document.createElement("span");return e.classList.add("vot-select-label"),e.textContent=t,e},createVOTSelect:fe,createVOTLanguageSelect:function(t){const{fromTitle:e=he,fromDialogTitle:o=he,fromItems:n=[],fromOnSelectCB:i=null,toTitle:a=he,toDialogTitle:r=he,toItems:s=[],toOnSelectCB:l=null}=t,d=document.createElement("vot-block");d.classList.add("vot-lang-select");const u=fe(e,o,n,{onSelectCb:i}),c=document.createElement("vot-block");c.classList.add("vot-lang-select-icon"),ne(Ft` - `,c);const h=be(a,r,s,{onSelectCb:l});return d.append(u.container,c,h.container),{container:d,fromSelect:u,icon:c,toSelect:h}},updateSlider:ge,createDetails:function(t){const e=document.createElement("vot-block");e.classList.add("vot-details");const o=document.createElement("vot-block");o.append(t);const n=document.createElement("vot-block");return n.classList.add("vot-details-arrow-icon"),oe(he,n),e.append(o,n),{container:e,header:o,arrowIcon:n}}};const ye={async translate(t,e){try{const o=await q(`${ue.yandex}?${new URLSearchParams({text:t,lang:e})}`,{timeout:3e3});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t){try{const e=await q(`${de.yandex}?${new URLSearchParams({text:t})}`,{timeout:3e3});if(e instanceof Error)throw e;const o=await e.json();if(200!==o.code)throw o.message;return o.lang??"en"}catch(t){return console.error("Error getting lang from text:",t),"en"}}},we={async detect(t){try{const e=await q(de.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}},xe={async translate(t,e="auto",o="ru"){try{const n=await q(ue.deepl,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({text:t,source_lang:e,target_lang:o})});if(n instanceof Error)throw n;const i=await n.json();if(200!==i.code)throw i.message;return i.data}catch(e){return console.error("Error translating text:",e),t}}};const Se=Object.keys(ue),ke=Object.keys(de).map((t=>"rustServer"===t?"rust-server":t));async function Te(t,e,o,n){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return R(o.id.split(".")[0])}const i=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(i?.length){const t=i.find((t=>"asr"===t.kind));if(t&&t.languageCode)return R(t.languageCode)}const a=function(t,e){return`${t} ${e?e.split("\n").filter((t=>!F.test(t))).join(" "):""}`.slice(0,450).replace(/[^\p{L}\s]+|\s+/gu," ").trim()}(o,n);return C.log(`Detecting language text: ${a}`),async function(t){switch(await P.get("detectService",le)){case"yandex":return await ye.detect(t);case"rust-server":return await we.detect(t);default:return"en"}}(a)}function Ve(){return/^m\.youtube\.com$/.test(window.location.hostname)}function Le(){return window.location.pathname.startsWith("/shorts/")?Ve()?document.querySelector("#movie_player"):document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function Me(){const t=Le();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function Ae(){const t=Le();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const Oe={isMobile:Ve,getPlayer:Le,getPlayerResponse:Me,getPlayerData:Ae,getVideoVolume:function(){const t=Le();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=Me();let e=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks??[];return e=e.reduce(((t,e)=>{if("languageCode"in e){const o=e?.languageCode?R(e?.languageCode):void 0,n=e?.url||e?.baseUrl;o&&n&&t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:`${n.startsWith("http")?n:`${window.location.origin}/${n}`}&fmt=json3`})}return t}),[]),C.log("youtube subtitles:",e),e},getVideoData:async function(){const t=Le(),e=Me(),o=Ae(),{title:n}=o??{},{shortDescription:i,isLive:a}=e?.videoDetails??{};let r=n?await Te(t,e,n,i):"en";r=nt.includes(r)?r:"en";const s={isLive:!!a,title:n,description:i,detectedLanguage:r};return C.log("youtube video data:",s),console.log("[VOT] Detected language: ",s.detectedLanguage),s},setVideoVolume:function(t){const e=Le();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){C.log("videoSeek",e);const o=(Le()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o},isMuted:function(){const t=Le();return!!t?.isMuted&&t.isMuted.call()},isMusic:function(){const t=Ae().author,e=Ae().title.toUpperCase(),o=e.match(/\w+/g),n=document.body.querySelector("ytd-watch-flexy")?.playerData;return[e,document.URL,t,n?.microformat?.playerMicroformatRenderer.category,n?.title].some((t=>t?.toUpperCase().includes("MUSIC")))||document.body.querySelector("#upload-info #channel-name .badge-style-type-verified-artist")||t&&/(VEVO|Topic|Records|RECORDS|Recordings|AMV)$/.test(t)||t&&/(MUSIC|ROCK|SOUNDS|SONGS)/.test(t.toUpperCase())||o?.length&&["🎵","♫","SONG","SONGS","SOUNDTRACK","LYRIC","LYRICS","AMBIENT","MIX","VEVO","CLIP","KARAOKE","OPENING","COVER","COVERED","VOCAL","INSTRUMENTAL","ORCHESTRAL","DUBSTEP","DJ","DNB","BASS","BEAT","ALBUM","PLAYLIST","DUBSTEP","CHILL","RELAX","CLASSIC","CINEMATIC"].some((t=>o.includes(t)))||["OFFICIAL VIDEO","OFFICIAL AUDIO","FEAT.","FT.","LIVE RADIO","DANCE VER","HIP HOP","ROCK N ROLL","HOUR VER","HOURS VER","INTRO THEME"].some((t=>e.includes(t)))||o?.length&&["OP","ED","MV","OST","NCS","BGM","EDM","GMV","AMV","MMD","MAD"].some((t=>o.includes(t)))}};function Ie(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,n,i)=>{const a=t.tokens[i+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+n.text.length;if(n.alignRange={start:s,end:l},o.push(n),a){const t=n.startMs+n.durationMs,i=a.startMs?a.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:i,alignRange:{start:l,end:l+1}})}return o}),[])}function Ce(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const n=t[t.length-1]??e,i=n?.alignRange?.end??0,a=i+o.length;t.push({text:o,alignRange:{start:i,end:a}})}return t}),[]),n=Math.floor(t.durationMs/o.length),i=t.startMs+t.durationMs;return o.map(((e,a)=>{const r=a===o.length-1,s=t.startMs+n*a;return{...e,startMs:s,durationMs:r?i-s:n}}))}async function Pe(t){const e=(async()=>{try{const e=await q(t.url,{timeout:5e3});return await e.json()}catch(t){return console.error("[VOT] Failed to fetch subtitles.",t),{containsTokens:!1,subtitles:[]}}})();let o=await e;return"youtube"===t.source&&(o=function(t){const e={containsTokens:!1,subtitles:[]};if("object"!=typeof t||!("events"in t)||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),e;for(let o=0;ot.utf8.replace(/^( +| +)$/g,""))).join("");let i=t.events[o].dDurationMs;t.events[o+1]&&t.events[o].tStartMs+t.events[o].dDurationMs>t.events[o+1].tStartMs&&(i=t.events[o+1].tStartMs-t.events[o].tStartMs),"\n"!==n&&e.subtitles.push({text:n,startMs:t.events[o].tStartMs,durationMs:i})}return e}(o)),o.subtitles=function(t,e){const o=[];let n;for(let i=0;isetTimeout((()=>e(new Error("Timeout"))),5e3)));try{const e=await Promise.race([t.getSubtitles({videoData:{host:o,url:n,videoId:a,duration:r},requestLang:i}),l]);console.log("[VOT] Subtitles response: ",e),e.waiting&&console.error("[VOT] Failed to get yandex subtitles");let d=e.subtitles??[];return d=d.reduce(((t,e)=>(e.language&&!t.find((t=>"yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),[...d,...s].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===$||e.language===$))return t.language===$?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===i?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===i?-1:1}return"youtube"===t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}))}catch(t){throw"Timeout"===t.message?console.error("[VOT] Failed to get yandex subtitles. Reason: timeout"):console.error("[VOT] Error in getSubtitles function",t),t}}class _e{constructor(t,e,o){this.video=t,this.container="youtube"===o.host&&"mobile"!==o.additionalData?e.parentElement:e,this.site=o,this.subtitlesContainer=this.createSubtitlesContainer(),this.position={left:25,top:75},this.dragging={active:!1,offset:{x:0,y:0}},this.subtitles=null,this.lastContent=null,this.highlightWords=!1,this.fontSize=20,this.opacity=.2,this.maxLength=300,this.maxLengthRegexp=/.{1,300}(?:\s|$)/g,this.bindEvents(),this.updateContainerRect()}createSubtitlesContainer(){const t=document.createElement("vot-block");return t.classList.add("vot-subtitles-widget"),this.container.appendChild(t),t}bindEvents(){this.onMouseDownBound=t=>this.onMouseDown(t),this.onMouseUpBound=()=>this.onMouseUp(),this.onMouseMoveBound=t=>this.onMouseMove(t),this.onTimeUpdateBound=this.debounce((()=>this.update()),100),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this.container)}onMouseDown(t){if(this.subtitlesContainer.contains(t.target)){const e=this.subtitlesContainer.getBoundingClientRect(),o=this.container.getBoundingClientRect();this.dragging={active:!0,offset:{x:t.clientX-e.left,y:t.clientY-e.top},containerOffset:{x:o.left,y:o.top}}}}onMouseUp(){this.dragging.active=!1}onMouseMove(t){if(this.dragging.active){t.preventDefault();const{width:e,height:o}=this.container.getBoundingClientRect(),n=this.dragging.containerOffset;this.position={left:(t.clientX-this.dragging.offset.x-n.x)/e*100,top:(t.clientY-this.dragging.offset.y-n.y)/o*100},this.applySubtitlePosition()}}onResize(){this.updateContainerRect()}updateContainerRect(){this.containerRect=this.container.getBoundingClientRect(),this.applySubtitlePosition()}applySubtitlePosition(){const{width:t,height:e}=this.containerRect,{offsetWidth:o,offsetHeight:n}=this.subtitlesContainer,i=(t-o)/t*100,a=(e-n)/e*100;this.position.left=Math.max(0,Math.min(this.position.left,i)),this.position.top=Math.max(0,Math.min(this.position.top,a)),this.subtitlesContainer.style.left=`${this.position.left}%`,this.subtitlesContainer.style.top=`${this.position.top}%`}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,oe(null,this.subtitlesContainer))}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords=Boolean(t),this.update()}setFontSize(t){this.fontSize=t;const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&(e.style.fontSize=`${this.fontSize}px`)}setOpacity(t){this.opacity=((100-+t)/100).toFixed(2);const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&e.style.setProperty("--vot-subtitles-opacity",this.opacity)}update(){if(!this.video||!this.subtitles)return;const t=1e3*this.video.currentTime,e=this.subtitles.subtitles?.findLast((e=>e.startMs`,c);const h=fe(a,r,s,{onSelectCb:l});return d.append(u.container,c,h.container),{container:d,fromSelect:u,icon:c,toSelect:h}},updateSlider:ve,createDetails:function(t){const e=document.createElement("vot-block");e.classList.add("vot-details");const o=document.createElement("vot-block");o.append(t);const n=document.createElement("vot-block");return n.classList.add("vot-details-arrow-icon"),ne(pe,n),e.append(o,n),{container:e,header:o,arrowIcon:n}}};const we={async translate(t,e){try{const o=await q(`${ce.yandex}?${new URLSearchParams({text:t,lang:e})}`,{timeout:3e3});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t){try{const e=await q(`${ue.yandex}?${new URLSearchParams({text:t})}`,{timeout:3e3});if(e instanceof Error)throw e;const o=await e.json();if(200!==o.code)throw o.message;return o.lang??"en"}catch(t){return console.error("Error getting lang from text:",t),"en"}}},xe={async detect(t){try{const e=await q(ue.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}},Se={async translate(t,e="auto",o="ru"){try{const n=await q(ce.deepl,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({text:t,source_lang:e,target_lang:o})});if(n instanceof Error)throw n;const i=await n.json();if(200!==i.code)throw i.message;return i.data}catch(e){return console.error("Error translating text:",e),t}}};const ke=Object.keys(ce),Te=Object.keys(ue).map((t=>"rustServer"===t?"rust-server":t));async function Ve(t,e,o,n){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return R(o.id.split(".")[0])}const i=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(i?.length){const t=i.find((t=>"asr"===t.kind));if(t&&t.languageCode)return R(t.languageCode)}const a=function(t,e){return`${t} ${e?e.split("\n").filter((t=>!F.test(t))).join(" "):""}`.slice(0,450).replace(/[^\p{L}\s]+|\s+/gu," ").trim()}(o,n);return C.log(`Detecting language text: ${a}`),async function(t){switch(await P.get("detectService",de)){case"yandex":return await we.detect(t);case"rust-server":return await xe.detect(t);default:return"en"}}(a)}function Le(){return/^m\.youtube\.com$/.test(window.location.hostname)}function Me(){return window.location.pathname.startsWith("/shorts/")&&!Le()?document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function Ae(){const t=Me();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function Oe(){const t=Me();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const Ie={isMobile:Le,getPlayer:Me,getPlayerResponse:Ae,getPlayerData:Oe,getVideoVolume:function(){const t=Me();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=Ae();let e=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks??[];return e=e.reduce(((t,e)=>{if("languageCode"in e){const o=e?.languageCode?R(e?.languageCode):void 0,n=e?.url||e?.baseUrl;o&&n&&t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:`${n.startsWith("http")?n:`${window.location.origin}/${n}`}&fmt=json3`})}return t}),[]),C.log("youtube subtitles:",e),e},getVideoData:async function(){const t=Me(),e=Ae(),o=Oe(),{title:n}=o??{},{shortDescription:i,isLive:a}=e?.videoDetails??{};let r=n?await Ve(t,e,n,i):"en";r=nt.includes(r)?r:"en";const s={isLive:!!a,title:n,description:i,detectedLanguage:r};return C.log("youtube video data:",s),console.log("[VOT] Detected language: ",s.detectedLanguage),s},setVideoVolume:function(t){const e=Me();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){C.log("videoSeek",e);const o=(Me()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o},isMuted:function(){const t=Me();return!!t?.isMuted&&t.isMuted.call()},isMusic:function(){const t=Oe().author,e=Oe().title.toUpperCase(),o=e.match(/\w+/g),n=document.body.querySelector("ytd-watch-flexy")?.playerData;return[e,document.URL,t,n?.microformat?.playerMicroformatRenderer.category,n?.title].some((t=>t?.toUpperCase().includes("MUSIC")))||document.body.querySelector("#upload-info #channel-name .badge-style-type-verified-artist")||t&&/(VEVO|Topic|Records|RECORDS|Recordings|AMV)$/.test(t)||t&&/(MUSIC|ROCK|SOUNDS|SONGS)/.test(t.toUpperCase())||o?.length&&["🎵","♫","SONG","SONGS","SOUNDTRACK","LYRIC","LYRICS","AMBIENT","MIX","VEVO","CLIP","KARAOKE","OPENING","COVER","COVERED","VOCAL","INSTRUMENTAL","ORCHESTRAL","DUBSTEP","DJ","DNB","BASS","BEAT","ALBUM","PLAYLIST","DUBSTEP","CHILL","RELAX","CLASSIC","CINEMATIC"].some((t=>o.includes(t)))||["OFFICIAL VIDEO","OFFICIAL AUDIO","FEAT.","FT.","LIVE RADIO","DANCE VER","HIP HOP","ROCK N ROLL","HOUR VER","HOURS VER","INTRO THEME"].some((t=>e.includes(t)))||o?.length&&["OP","ED","MV","OST","NCS","BGM","EDM","GMV","AMV","MMD","MAD"].some((t=>o.includes(t)))}};function Ce(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,n,i)=>{const a=t.tokens[i+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+n.text.length;if(n.alignRange={start:s,end:l},o.push(n),a){const t=n.startMs+n.durationMs,i=a.startMs?a.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:i,alignRange:{start:l,end:l+1}})}return o}),[])}function Pe(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const n=t[t.length-1]??e,i=n?.alignRange?.end??0,a=i+o.length;t.push({text:o,alignRange:{start:i,end:a}})}return t}),[]),n=Math.floor(t.durationMs/o.length),i=t.startMs+t.durationMs;return o.map(((e,a)=>{const r=a===o.length-1,s=t.startMs+n*a;return{...e,startMs:s,durationMs:r?i-s:n}}))}async function Ee(t){const e=(async()=>{try{const e=await q(t.url,{timeout:5e3});return await e.json()}catch(t){return console.error("[VOT] Failed to fetch subtitles.",t),{containsTokens:!1,subtitles:[]}}})();let o=await e;return"youtube"===t.source&&(o=function(t){const e={containsTokens:!1,subtitles:[]};if("object"!=typeof t||!("events"in t)||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),e;for(let o=0;ot.utf8.replace(/^( +| +)$/g,""))).join("");let i=t.events[o].dDurationMs;t.events[o+1]&&t.events[o].tStartMs+t.events[o].dDurationMs>t.events[o+1].tStartMs&&(i=t.events[o+1].tStartMs-t.events[o].tStartMs),"\n"!==n&&e.subtitles.push({text:n,startMs:t.events[o].tStartMs,durationMs:i})}return e}(o)),o.subtitles=function(t,e){const o=[];let n;for(let i=0;isetTimeout((()=>e(new Error("Timeout"))),5e3)));try{const e=await Promise.race([t.getSubtitles({videoData:{host:o,url:n,videoId:a,duration:r},requestLang:i}),l]);console.log("[VOT] Subtitles response: ",e),e.waiting&&console.error("[VOT] Failed to get yandex subtitles");let d=e.subtitles??[];return d=d.reduce(((t,e)=>(e.language&&!t.find((t=>"yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),[...d,...s].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===$||e.language===$))return t.language===$?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===i?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===i?-1:1}return"youtube"===t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}))}catch(t){throw"Timeout"===t.message?console.error("[VOT] Failed to get yandex subtitles. Reason: timeout"):console.error("[VOT] Error in getSubtitles function",t),t}}class Ne{constructor(t,e,o){this.video=t,this.container="youtube"===o.host&&"mobile"!==o.additionalData?e.parentElement:e,this.site=o,this.subtitlesContainer=this.createSubtitlesContainer(),this.position={left:25,top:75},this.dragging={active:!1,offset:{x:0,y:0}},this.subtitles=null,this.lastContent=null,this.highlightWords=!1,this.fontSize=20,this.opacity=.2,this.maxLength=300,this.maxLengthRegexp=/.{1,300}(?:\s|$)/g,this.bindEvents(),this.updateContainerRect()}createSubtitlesContainer(){const t=document.createElement("vot-block");return t.classList.add("vot-subtitles-widget"),this.container.appendChild(t),t}bindEvents(){this.onMouseDownBound=t=>this.onMouseDown(t),this.onMouseUpBound=()=>this.onMouseUp(),this.onMouseMoveBound=t=>this.onMouseMove(t),this.onTimeUpdateBound=this.debounce((()=>this.update()),100),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this.container)}onMouseDown(t){if(this.subtitlesContainer.contains(t.target)){const e=this.subtitlesContainer.getBoundingClientRect(),o=this.container.getBoundingClientRect();this.dragging={active:!0,offset:{x:t.clientX-e.left,y:t.clientY-e.top},containerOffset:{x:o.left,y:o.top}}}}onMouseUp(){this.dragging.active=!1}onMouseMove(t){if(this.dragging.active){t.preventDefault();const{width:e,height:o}=this.container.getBoundingClientRect(),n=this.dragging.containerOffset;this.position={left:(t.clientX-this.dragging.offset.x-n.x)/e*100,top:(t.clientY-this.dragging.offset.y-n.y)/o*100},this.applySubtitlePosition()}}onResize(){this.updateContainerRect()}updateContainerRect(){this.containerRect=this.container.getBoundingClientRect(),this.applySubtitlePosition()}applySubtitlePosition(){const{width:t,height:e}=this.containerRect,{offsetWidth:o,offsetHeight:n}=this.subtitlesContainer,i=(t-o)/t*100,a=(e-n)/e*100;this.position.left=Math.max(0,Math.min(this.position.left,i)),this.position.top=Math.max(0,Math.min(this.position.top,a)),this.subtitlesContainer.style.left=`${this.position.left}%`,this.subtitlesContainer.style.top=`${this.position.top}%`}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,ne(null,this.subtitlesContainer))}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords=Boolean(t),this.update()}setFontSize(t){this.fontSize=t;const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&(e.style.fontSize=`${this.fontSize}px`)}setOpacity(t){this.opacity=((100-+t)/100).toFixed(2);const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&e.style.setProperty("--vot-subtitles-opacity",this.opacity)}update(){if(!this.video||!this.subtitles)return;const t=1e3*this.video.currentTime,e=this.subtitles.subtitles?.findLast((e=>e.startMs${n}`,this.subtitlesContainer))}processTokens(t){if(t.at(-1).alignRange.end<=this.maxLength)return t;let e=[],o=[],n=0;for(const i of t)n+=i.text.length,o.push(i),n>this.maxLength&&(e.push(this.trimChunk(o)),o=[],n=0);o.length&&e.push(this.trimChunk(o));const i=1e3*this.video.currentTime;return e.find((t=>t[0].startMs{const o=this.highlightWords&&(e>t.startMs+t.durationMs/2||e>t.startMs-100&&t.startMs+t.durationMs/2-e<275);return Bt``,this.subtitlesContainer))}processTokens(t){if(t.at(-1).alignRange.end<=this.maxLength)return t;let e=[],o=[],n=0;for(const i of t)n+=i.text.length,o.push(i),n>this.maxLength&&(e.push(this.trimChunk(o)),o=[],n=0);o.length&&e.push(this.trimChunk(o));const i=1e3*this.video.currentTime;return e.find((t=>t[0].startMs{const o=this.highlightWords&&(e>t.startMs+t.durationMs/2||e>t.startMs-100&&t.startMs+t.durationMs/2-e<275);return Dt`${t.text.replace("\\n","
")}
`}))}debounce(t,e){let o;return(...n)=>{clearTimeout(o),o=setTimeout((()=>t.apply(this,n)),e)}}release(){document.removeEventListener("mousedown",this.onMouseDownBound),document.removeEventListener("mouseup",this.onMouseUpBound),document.removeEventListener("mousemove",this.onMouseMoveBound),this.video?.removeEventListener("timeupdate",this.onTimeUpdateBound),this.resizeObserver.disconnect(),this.subtitlesContainer.remove()}}o("./node_modules/requestidlecallback-polyfill/index.js");class Ne{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}const $e=new Set(["advertise","promo","sponsor","banner","commercial","preroll","midroll","postroll","ad-container","sponsored"]),Re=(()=>{const t=Array.from($e).join("|");return new RegExp(t,"i")})(),Be=t=>{const e=[];for(let o=0;o({label:_.get("langs")[t]??t.toUpperCase(),value:t,selected:e===t})))}const ze=t=>t?_.get("VOTChangeHotkeyWithCurrent").replace("{0}",t.replace("Key","")):_.get("VOTCreateTranslationHotkey");class Ue{translateFromLang="en";translateToLang=$;timer;videoData="";firstPlay=!0;audio=new Audio;audioContext=function(){const t=window.AudioContext||window.webkitAudioContext;return t?new t:void 0}();hls=D();votClient;videoTranslations=[];videoTranslationTTL=7200;cachedTranslation;downloadTranslationUrl=null;autoRetry;streamPing;votOpts;volumeOnStart;tempOriginalVolume;tempVolume;firstSyncVolume=!0;subtitlesList=[];subtitlesListVideoId=null;dragging;constructor(t,e,o){C.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.init()}async translateVideoImpl(t,e,o,n=null){if(clearTimeout(this.autoRetry),C.log(t,`Translate video (requestLang: ${e}, responseLang: ${o})`),await lt(this.site,this.video)!==t.videoId)return null;try{const i=await this.votClient.translateVideo({videoData:t,requestLang:e,responseLang:o,translationHelp:n});if(C.log("Translate video result",i),i.translated&&i.remainingTime<1)return C.log("Video translation finished with this data: ",i),i;await this.updateTranslationErrorMsg(i.remainingTime>0?function(t){const e=Math.floor(t/60),o=Math.floor(t%60);return e>=60?_.get("translationTakeMoreThanHour"):1===e||0===e&&o>0?_.get("translationTakeAboutMinute"):11!==e&&e%10==1?_.get("translationTakeApproximatelyMinute2").replace("{0}",e):![12,13,14].includes(e)&&[2,3,4].includes(e%10)?_.get("translationTakeApproximatelyMinute").replace("{0}",e):_.get("translationTakeApproximatelyMinutes").replace("{0}",e)}(i.remainingTime):i.message??_.get("translationTakeFewMinutes"))}catch(t){return console.error("[VOT] Failed to translate video",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}return new Promise((i=>{const a=this.subtitlesList.some((t=>"yandex"===t.source))?2e4:3e4;this.autoRetry=setTimeout((async()=>{const a=await this.translateVideoImpl(t,e,o,n);(!a||a.translated&&a.remainingTime<1)&&i(a)}),a)}))}async translateStreamImpl(t,e,o){if(clearTimeout(this.autoRetry),C.log(t,`Translate stream (requestLang: ${e}, responseLang: ${o})`),await lt(this.site,this.video)!==t.videoId)return null;try{const n=await this.votClient.translateStream({videoData:t,requestLang:e,responseLang:o});if(C.log("Translate stream result",n),!n.translated&&10===n.interval)return await this.updateTranslationErrorMsg(_.get("translationTakeFewMinutes")),new Promise((i=>{this.autoRetry=setTimeout((async()=>{const n=await this.translateStreamImpl(t,e,o);n&&!n.translated&&10===n.interval||i(n)}),1e3*n.interval)}));if(n.message)throw C.log(`Stream translation aborted! Message: ${n.message}`),new ut("streamNoConnectionToServer");if(!n.result)throw C.log("Failed to find translation result! Data:",n),new ut("audioNotReceived");return C.log("Stream translated successfully. Running...",n),this.streamPing=setInterval((async()=>{C.log("Ping stream translation",n.pingId),this.votClient.pingStream({pingId:n.pingId})}),1e3*n.interval),n}catch(t){return console.error("[VOT] Failed to translate stream",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}}async autoTranslate(){if(this.firstPlay&&1===this.data.autoTranslate&&this.videoData.videoId){this.firstPlay=!1;try{await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),this.transformBtn("error","VOTLocalizedError"===t?.name?t.localizedMessage:t)}}}async init(){if(this.initialized)return;const t={autoTranslate:P.get("autoTranslate",0,!0),dontTranslateLanguage:P.get("dontTranslateLanguage",$),dontTranslateYourLang:P.get("dontTranslateYourLang",1,!0),autoSetVolumeYandexStyle:P.get("autoSetVolumeYandexStyle",1,!0),autoVolume:P.get("autoVolume",re,!0),buttonPos:P.get("buttonPos","default"),showVideoSlider:P.get("showVideoSlider",1,!0),syncVolume:P.get("syncVolume",0,!0),subtitlesMaxLength:P.get("subtitlesMaxLength",300,!0),highlightWords:P.get("highlightWords",0,!0),subtitlesFontSize:P.get("subtitlesFontSize",20,!0),subtitlesOpacity:P.get("subtitlesOpacity",20,!0),responseLanguage:P.get("responseLanguage",$),defaultVolume:P.get("defaultVolume",100,!0),audioProxy:P.get("audioProxy",0,!0),showPiPButton:P.get("showPiPButton",0,!0),translateAPIErrors:P.get("translateAPIErrors",1,!0),translationService:P.get("translationService",se),detectService:P.get("detectService",le),hotkeyButton:P.get("hotkeyButton",null,!0),m3u8ProxyHost:P.get("m3u8ProxyHost",ne),translateProxyEnabled:P.get("translateProxyEnabled",0,!0),proxyWorkerHost:P.get("proxyWorkerHost",ie),audioBooster:P.get("audioBooster",0,!0)};this.data=Object.fromEntries(await Promise.all(Object.entries(t).map((async([t,e])=>[t,await e])))),console.log("[db] data from db: ",this.data),!this.data.translateProxyEnabled&&GM_info?.scriptHandler&&Fe.includes(GM_info.scriptHandler)&&(this.data.translateProxyEnabled=1,await P.set("translateProxyEnabled",1),C.log("translateProxyEnabled",this.data.translateProxyEnabled)),C.log("Extension compatibility passed..."),this.votOpts={headers:this.data.translateProxyEnabled?{}:{"sec-ch-ua":null,"sec-ch-ua-mobile":null,"sec-ch-ua-platform":null},fetchFn:q,hostVOT:ae,host:this.data.translateProxyEnabled?this.data.proxyWorkerHost:"api.browser.yandex.ru"},this.votClient=new(this.data.translateProxyEnabled?gt:pt)(this.votOpts),this.subtitlesWidget=new _e(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize),this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity),this.initUI(),this.initUIEvents(),this.initAudioBooster(),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),await Promise.all([this.updateSubtitles(),this.autoTranslate()]),this.initialized=!0}transformBtn(t="none",e){this.votButton.container.dataset.status=t;const o="error"===t&&e.includes(_.get("translationTake"));this.setLoadingBtn(o),this.votButton.label.textContent=e,this.votButton.container.title="error"===t?e:""}setLoadingBtn(t=!1){this.votButton.container.dataset.loading=t}initAudioBooster(){this.audio.crossOrigin="anonymous",this.audioContext&&(this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination),this.audioSource=this.audioContext.createMediaElementSource(this.audio),this.audioSource.connect(this.gainNode))}initUI(){this.votButton=fe.createVOTButton(_.get("translateVideo")),this.votButton.container.style.opacity=0,this.data?.buttonPos&&"default"!==this.data?.buttonPos&&this.container.clientWidth&&this.container.clientWidth>550?(this.votButton.container.dataset.direction="column",this.votButton.container.dataset.position=this.data?.buttonPos):(this.votButton.container.dataset.direction="row",this.votButton.container.dataset.position="default"),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!B()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!B()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=fe.createVOTMenu(_.get("VOTSettings")),this.votMenu.container.dataset.position=this.container.clientWidth&&this.container.clientWidth>550?this.data?.buttonPos:"default",this.container.appendChild(this.votMenu.container),this.votDownloadButton=fe.createIconButton(Dt``}))}debounce(t,e){let o;return(...n)=>{clearTimeout(o),o=setTimeout((()=>t.apply(this,n)),e)}}release(){document.removeEventListener("mousedown",this.onMouseDownBound),document.removeEventListener("mouseup",this.onMouseUpBound),document.removeEventListener("mousemove",this.onMouseMoveBound),this.video?.removeEventListener("timeupdate",this.onTimeUpdateBound),this.resizeObserver.disconnect(),this.subtitlesContainer.remove()}}o("./node_modules/requestidlecallback-polyfill/index.js");class $e{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}const Re=new Set(["advertise","promo","sponsor","banner","commercial","preroll","midroll","postroll","ad-container","sponsored"]),Be=(()=>{const t=Array.from(Re).join("|");return new RegExp(t,"i")})(),De=t=>{const e=[];for(let o=0;o({label:_.get("langs")[t]??t.toUpperCase(),value:t,selected:e===t})))}const Ue=t=>t?_.get("VOTChangeHotkeyWithCurrent").replace("{0}",t.replace("Key","")):_.get("VOTCreateTranslationHotkey");class Ge{translateFromLang="en";translateToLang=$;timer;videoData="";firstPlay=!0;audio=new Audio;audioContext=function(){const t=window.AudioContext||window.webkitAudioContext;return t?new t:void 0}();hls=D();votClient;videoTranslations=[];videoTranslationTTL=7200;cachedTranslation;downloadTranslationUrl=null;autoRetry;streamPing;votOpts;volumeOnStart;tempOriginalVolume;tempVolume;firstSyncVolume=!0;subtitlesList=[];subtitlesListVideoId=null;dragging;constructor(t,e,o){C.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.init()}async translateVideoImpl(t,e,o,n=null){if(clearTimeout(this.autoRetry),C.log(t,`Translate video (requestLang: ${e}, responseLang: ${o})`),await dt(this.site,this.video)!==t.videoId)return null;try{const i=await this.votClient.translateVideo({videoData:t,requestLang:e,responseLang:o,translationHelp:n});if(C.log("Translate video result",i),i.translated&&i.remainingTime<1)return C.log("Video translation finished with this data: ",i),i;await this.updateTranslationErrorMsg(i.remainingTime>0?function(t){const e=Math.floor(t/60),o=Math.floor(t%60);return e>=60?_.get("translationTakeMoreThanHour"):1===e||0===e&&o>0?_.get("translationTakeAboutMinute"):11!==e&&e%10==1?_.get("translationTakeApproximatelyMinute2").replace("{0}",e):![12,13,14].includes(e)&&[2,3,4].includes(e%10)?_.get("translationTakeApproximatelyMinute").replace("{0}",e):_.get("translationTakeApproximatelyMinutes").replace("{0}",e)}(i.remainingTime):i.message??_.get("translationTakeFewMinutes"))}catch(t){return console.error("[VOT] Failed to translate video",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}return new Promise((i=>{const a=this.subtitlesList.some((t=>"yandex"===t.source))?2e4:3e4;this.autoRetry=setTimeout((async()=>{const a=await this.translateVideoImpl(t,e,o,n);(!a||a.translated&&a.remainingTime<1)&&i(a)}),a)}))}async translateStreamImpl(t,e,o){if(clearTimeout(this.autoRetry),C.log(t,`Translate stream (requestLang: ${e}, responseLang: ${o})`),await dt(this.site,this.video)!==t.videoId)return null;try{const n=await this.votClient.translateStream({videoData:t,requestLang:e,responseLang:o});if(C.log("Translate stream result",n),!n.translated&&10===n.interval)return await this.updateTranslationErrorMsg(_.get("translationTakeFewMinutes")),new Promise((i=>{this.autoRetry=setTimeout((async()=>{const n=await this.translateStreamImpl(t,e,o);n&&!n.translated&&10===n.interval||i(n)}),1e3*n.interval)}));if(n.message)throw C.log(`Stream translation aborted! Message: ${n.message}`),new ct("streamNoConnectionToServer");if(!n.result)throw C.log("Failed to find translation result! Data:",n),new ct("audioNotReceived");return C.log("Stream translated successfully. Running...",n),this.streamPing=setInterval((async()=>{C.log("Ping stream translation",n.pingId),this.votClient.pingStream({pingId:n.pingId})}),1e3*n.interval),n}catch(t){return console.error("[VOT] Failed to translate stream",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}}async autoTranslate(){if(this.firstPlay&&1===this.data.autoTranslate&&this.videoData.videoId){this.firstPlay=!1;try{await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),this.transformBtn("error","VOTLocalizedError"===t?.name?t.localizedMessage:t)}}}async init(){if(this.initialized)return;const t={autoTranslate:P.get("autoTranslate",0,!0),dontTranslateLanguage:P.get("dontTranslateLanguage",$),dontTranslateYourLang:P.get("dontTranslateYourLang",1,!0),autoSetVolumeYandexStyle:P.get("autoSetVolumeYandexStyle",1,!0),autoVolume:P.get("autoVolume",se,!0),buttonPos:P.get("buttonPos","default"),showVideoSlider:P.get("showVideoSlider",1,!0),syncVolume:P.get("syncVolume",0,!0),subtitlesMaxLength:P.get("subtitlesMaxLength",300,!0),highlightWords:P.get("highlightWords",0,!0),subtitlesFontSize:P.get("subtitlesFontSize",20,!0),subtitlesOpacity:P.get("subtitlesOpacity",20,!0),responseLanguage:P.get("responseLanguage",$),defaultVolume:P.get("defaultVolume",100,!0),audioProxy:P.get("audioProxy",0,!0),showPiPButton:P.get("showPiPButton",0,!0),translateAPIErrors:P.get("translateAPIErrors",1,!0),translationService:P.get("translationService",le),detectService:P.get("detectService",de),hotkeyButton:P.get("hotkeyButton",null,!0),m3u8ProxyHost:P.get("m3u8ProxyHost",ie),translateProxyEnabled:P.get("translateProxyEnabled",0,!0),proxyWorkerHost:P.get("proxyWorkerHost",ae),audioBooster:P.get("audioBooster",0,!0)};this.data=Object.fromEntries(await Promise.all(Object.entries(t).map((async([t,e])=>[t,await e])))),console.log("[db] data from db: ",this.data),!this.data.translateProxyEnabled&&GM_info?.scriptHandler&&qe.includes(GM_info.scriptHandler)&&(this.data.translateProxyEnabled=1,await P.set("translateProxyEnabled",1),C.log("translateProxyEnabled",this.data.translateProxyEnabled)),C.log("Extension compatibility passed..."),this.votOpts={headers:this.data.translateProxyEnabled?{}:{"sec-ch-ua":null,"sec-ch-ua-mobile":null,"sec-ch-ua-platform":null},fetchFn:q,hostVOT:re,host:this.data.translateProxyEnabled?this.data.proxyWorkerHost:"api.browser.yandex.ru"},this.votClient=new(this.data.translateProxyEnabled?vt:gt)(this.votOpts),this.subtitlesWidget=new Ne(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize),this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity),this.initUI(),this.initUIEvents(),this.initAudioBooster(),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),await Promise.all([this.updateSubtitles(),this.autoTranslate()]),this.initialized=!0}transformBtn(t="none",e){this.votButton.container.dataset.status=t;const o="error"===t&&e.includes(_.get("translationTake"));this.setLoadingBtn(o),this.votButton.label.textContent=e,this.votButton.container.title="error"===t?e:""}setLoadingBtn(t=!1){this.votButton.container.dataset.loading=t}initAudioBooster(){this.audio.crossOrigin="anonymous",this.audioContext&&(this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination),this.audioSource=this.audioContext.createMediaElementSource(this.audio),this.audioSource.connect(this.gainNode))}initUI(){this.votButton=ye.createVOTButton(_.get("translateVideo")),this.votButton.container.style.opacity=0,this.data?.buttonPos&&"default"!==this.data?.buttonPos&&this.container.clientWidth&&this.container.clientWidth>550?(this.votButton.container.dataset.direction="column",this.votButton.container.dataset.position=this.data?.buttonPos):(this.votButton.container.dataset.direction="row",this.votButton.container.dataset.position="default"),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!B()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!B()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=ye.createVOTMenu(_.get("VOTSettings")),this.votMenu.container.dataset.position=this.container.clientWidth&&this.container.clientWidth>550?this.data?.buttonPos:"default",this.container.appendChild(this.votMenu.container),this.votDownloadButton=ye.createIconButton(Ft` - `),this.votDownloadButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadButton),this.votDownloadSubtitlesButton=fe.createIconButton(Dt``),this.votDownloadButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadButton),this.votDownloadSubtitlesButton=ye.createIconButton(Ft` - `),this.votDownloadSubtitlesButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadSubtitlesButton),this.votSettingsButton=fe.createIconButton(Dt``),this.votDownloadSubtitlesButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadSubtitlesButton),this.votSettingsButton=ye.createIconButton(Ft` - `),this.votMenu.headerContainer.appendChild(this.votSettingsButton),this.votTranslationLanguageSelect=fe.createVOTLanguageSelect({fromTitle:_.get("langs")[this.video.detectedLanguage],fromDialogTitle:_.get("videoLanguage"),fromItems:He(nt,this.videoData.detectedLanguage),fromOnSelectCB:async t=>{C.log("[fromOnSelectCB] select from language",t.target.dataset.votValue),this.videoData=await this.getVideoData(),this.setSelectMenuValues(t.target.dataset.votValue,this.videoData.responseLanguage)},toTitle:_.get("langs")[this.video.responseLanguage],toDialogTitle:_.get("translationLanguage"),toItems:He(it,this.videoData.responseLanguage),toOnSelectCB:async t=>{const e=t.target.dataset.votValue;C.log("[toOnSelectCB] select to language",e),this.data.responseLanguage=this.translateToLang=e,await P.set("responseLanguage",this.data.responseLanguage),C.log("Response Language value changed. New value: ",this.data.responseLanguage),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage)}}),this.votMenu.bodyContainer.appendChild(this.votTranslationLanguageSelect.container),this.votSubtitlesSelect=fe.createVOTSelect(_.get("VOTSubtitlesDisabled"),_.get("VOTSubtitles"),[{label:_.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1}],{onSelectCb:async t=>{await this.changeSubtitlesLang(t.target.dataset.votValue)},labelElement:fe.createVOTSelectLabel(_.get("VOTSubtitles"))}),this.votMenu.bodyContainer.appendChild(this.votSubtitlesSelect.container),this.votVideoVolumeSlider=fe.createSlider(Bt`${_.get("VOTVolume")}: - ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=fe.createSlider(Bt`${_.get("VOTVolumeTranslation")}: - ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100,0,this.data.audioBooster?900:100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=fe.createDialog(_.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=fe.createHeader(_.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=fe.createCheckbox(_.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=fe.createVOTSelect(_.get("langs")[P.syncGet("dontTranslateLanguage",$)],_.get("VOTDontTranslateYourLang"),He(nt,P.syncGet("dontTranslateLanguage",$)),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await P.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:fe.createCheckbox(_.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.changehotkeyButton=fe.createOutlinedButton(ze(this.data.hotkeyButton)),this.votSettingsDialog.bodyContainer.appendChild(this.changehotkeyButton),this.votAutoSetVolumeCheckbox=fe.createCheckbox(`${_.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=fe.createSlider(Bt`${100*(this.data?.autoVolume??re)}%`,100*(this.data?.autoVolume??re),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=fe.createCheckbox(_.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votAudioBoosterCheckbox=fe.createCheckbox(_.get("VOTAudioBooster"),this.data?.audioBooster??!1),this.votAudioBoosterCheckbox.container.hidden=!this.audioContext,this.votSettingsDialog.bodyContainer.appendChild(this.votAudioBoosterCheckbox.container),this.votSyncVolumeCheckbox=fe.createCheckbox(_.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votTranslationServiceSelect=fe.createVOTSelect(P.syncGet("translationService",se).toUpperCase(),_.get("VOTTranslationService"),He(Se,P.syncGet("translationService",se)),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await P.set("translationService",this.data.translationService)},labelElement:fe.createCheckbox(_.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===_.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=fe.createVOTSelect(P.syncGet("detectService",le).toUpperCase(),_.get("VOTDetectService"),He(ke,P.syncGet("detectService",le)),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await P.set("detectService",this.data.detectService)},labelElement:fe.createVOTSelectLabel(_.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=fe.createHeader(_.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesDetails=fe.createDetails(_.get("VOTSubtitlesDesign")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesDetails.container),this.votProxyHeader=fe.createHeader(_.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=fe.createTextfield(_.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,ne),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=fe.createTextfield(_.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,ie),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=fe.createCheckbox(_.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votAboutHeader=fe.createHeader(_.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=fe.createVOTSelect(_.get("langs")[P.syncGet("locale-lang-override","auto")],_.get("VOTMenuLanguage"),He(E,P.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await P.set("locale-lang-override",t.target.dataset.votValue)},labelElement:fe.createVOTSelectLabel(_.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=fe.createCheckbox(_.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!B(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=fe.createInformation(`${_.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=fe.createInformation(`${_.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=fe.createInformation(`${_.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=fe.createInformation(`${_.get("VOTBrowser")}:`,`${De.browser.name} ${De.browser.version} (${De.os.name} ${De.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votResetSettingsButton=fe.createButton(_.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}async handleTranslationBtnClick(){if(this.audio.src)return C.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return C.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(C.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new ut("VOTNoVideoIDFound");"vk"===this.site.host&&"clips"===this.site.additionalData&&(this.videoData=await this.getVideoData()),await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t)}}initUIEvents(){this.votButton.translateButton.addEventListener("click",(async()=>{await this.handleTranslationBtnClick()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votButton.container.addEventListener("mousedown",(()=>{this.dragging=!0})),this.container.addEventListener("mouseup",(()=>{this.dragging=!1})),this.container.addEventListener("mousemove",(async t=>{if(this.dragging){t.preventDefault();const e=t.clientX/this.container.clientWidth*100;this.data.buttonPos=this.container.clientWidth&&this.container.clientWidth>550?e<=44?"left":e>=66?"right":"default":"default",this.votButton.container.dataset.direction="default"===this.data.buttonPos?"row":"column",this.votButton.container.dataset.position=this.data.buttonPos,this.votMenu.container.dataset.position=this.data.buttonPos,this.container.clientWidth&&this.container.clientWidth>550&&await P.set("buttonPos",this.data.buttonPos)}})),this.votDownloadButton.addEventListener("click",(()=>{this.downloadTranslationUrl&&window.open(this.downloadTranslationUrl,"_blank").focus()})),this.votDownloadSubtitlesButton.addEventListener("click",(async()=>{const t=function(t,e="srt"){const o=t.subtitles.map(((t,o)=>{const n=t.startMs/1e3,i=(t.startMs+t.durationMs)/1e3;return("srt"===e?`${o+1}\n`:"")+`${mt(n)} --\x3e ${mt(i)}\n${t.text}\n\n`})).join("").trim();return"vtt"===e?`WEBVTT\n\n${o}`:o}(this.yandexSubtitles,"srt"),e=new Blob([t],{type:"text/plain"}),o=URL.createObjectURL(e),n=document.createElement("a");n.href=o,n.download=`subtitles_${this.videoData.videoId}.srt`,n.click(),URL.revokeObjectURL(o)})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,this.setVideoVolume(e/100),this.data.syncVolume&&this.syncVolumeWrapper("video",e)})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await P.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").textContent=`${this.data.defaultVolume}%`,this.setAudioVolume(this.data.defaultVolume/100),this.data.syncVolume&&(this.syncVolumeWrapper("translation",this.data.defaultVolume),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.setVideoVolume(this.tempOriginalVolume/100))})()}));{this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await Promise.all([P.set("autoTranslate",this.data.autoTranslate),this.autoTranslate()]),C.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await P.set("dontTranslateYourLang",this.data.dontTranslateYourLang),C.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()}));const t=async t=>{await P.set("hotkeyButton",t),this.data.hotkeyButton=t,this.changehotkeyButton.textContent=ze(t)},e=o=>{const n="Escape"===o.code?null:o.code;t(n),document.removeEventListener("keydown",e)};this.changehotkeyButton.addEventListener("click",(()=>{this.changehotkeyButton.textContent=_.get("VOTPressNewHotkey"),document.addEventListener("keydown",e)})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await P.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),C.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await P.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").textContent=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await P.set("showVideoSlider",this.data.showVideoSlider),C.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votAudioBoosterCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioBooster=Number(t.target.checked),await P.set("audioBooster",this.data.audioBooster),C.log("audioBooster value changed. New value: ",this.data.audioBooster);const e=this.votVideoTranslationVolumeSlider.input.value;this.votVideoTranslationVolumeSlider.input.max=this.data.audioBooster?900:100,this.data.audioBooster||(this.votVideoTranslationVolumeSlider.input.value=e>100?100:e,this.votVideoTranslationVolumeSlider.input.dispatchEvent(new Event("input")))})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await P.set("syncVolume",this.data.syncVolume),C.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await P.set("translateAPIErrors",this.data.translateAPIErrors),C.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesDetails.container.addEventListener("click",(()=>{this.votSubtitlesDialog=fe.createDialog(_.get("VOTSubtitlesDesign")),this.votSubtitlesDialog.container.classList.add("vot-dialog-temp"),this.votSubtitlesDialog.container.hidden=!1,this.votSubtitlesDialog.backdrop.onclick=this.votSubtitlesDialog.closeButton.onclick=()=>{this.votSubtitlesDialog.container.remove()},this.votSubtitlesHighlightWordsCheckbox=fe.createCheckbox(_.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votSubtitlesMaxLengthSlider=fe.createSlider(Bt`${_.get("VOTSubtitlesMaxLength")}: - ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesFontSizeSlider=fe.createSlider(Bt`${_.get("VOTSubtitlesFontSize")}: - ${this.data?.subtitlesFontSize??20}`,this.data?.subtitlesFontSize??20,8,50),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesFontSizeSlider.container),this.votSubtitlesOpacitySlider=fe.createSlider(Bt`${_.get("VOTSubtitlesOpacity")}: - ${this.data?.subtitlesOpacity??20}`,this.data?.subtitlesOpacity??20,0,100),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesOpacitySlider.container),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await P.set("highlightWords",this.data.highlightWords),C.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await P.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").textContent=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesFontSizeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesFontSize=Number(t.target.value),await P.set("subtitlesFontSize",this.data.subtitlesFontSize),this.votSubtitlesFontSizeSlider.label.querySelector("strong").textContent=`${this.data.subtitlesFontSize}`,this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize)})()})),this.votSubtitlesOpacitySlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesOpacity=Number(t.target.value),await P.set("subtitlesOpacity",this.data.subtitlesOpacity),this.votSubtitlesOpacitySlider.label.querySelector("strong").textContent=`${this.data.subtitlesOpacity}`,this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity)})()})),document.documentElement.appendChild(this.votSubtitlesDialog.container)})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await P.set("showPiPButton",this.data.showPiPButton),C.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!B()||!this.data.showPiPButton,this.votButton.separator2.hidden=!B()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||ne,await P.set("m3u8ProxyHost",this.data.m3u8ProxyHost),C.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||ie,await P.set("proxyWorkerHost",this.data.proxyWorkerHost),C.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),this.data.translateProxyEnabled&&(this.votClient.host=this.data.proxyWorkerHost)})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await P.set("audioProxy",this.data.audioProxy),C.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{_.reset();const t=await P.list();for(let e=0;e{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,n)=>{for(const i of o)t(e,i,n)};if(this.resizeObserver=new ResizeObserver((t=>{for(let e=0;e550;this.votButton.container.dataset.position=this.votMenu.container.dataset.position=e?this.data?.buttonPos:"default",this.votButton.container.dataset.direction=this.data?.buttonPos&&"default"!==this.data?.buttonPos&&e?"column":"row"})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{if(this.audio.src&&this.data.syncVolume)for(let e=0;e{const e=t.target,o=this.votButton.container,n=this.votMenu.container,i=this.container,a=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=n.contains(e),d=i.contains(e),u=a.contains(e),c=r?.contains(e)??!1;C.log(`[document click] ${s} ${l} ${d} ${u} ${c}`),s||l||u||c||(d||this.logout(0),this.votMenu.container.hidden=!0)})),document.addEventListener("keydown",(async t=>{const e=t.code,o=document.activeElement;["input","textarea"].includes(o.tagName.toLowerCase())||o.isContentEditable||e!==this.data.hotkeyButton||await this.handleTranslationBtnClick()})),o="pornhub"===this.site.host?"embed"===this.site.additionalData?document.querySelector("#player"):this.container.querySelector(".mgp_eventCatcher"):"twitter"===this.site.host?document.querySelector('div[data-testid="videoPlayer"]'):"yandexdisk"===this.site.host?document.querySelector(".video-player__player"):this.container,o&&e(o,["mousemove","mouseout"],this.resetTimer),t(this.votButton.container,"mousemove",this.changeOpacityOnEvent),t(this.votMenu.container,"mousemove",this.changeOpacityOnEvent),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEvent),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),"googledrive"===this.site.host&&(this.container.style.height="100%"),t(this.video,"canplay",(async()=>{"rutube"===this.site.host&&this.video.src||await lt(this.site,this.video)!==this.videoData.videoId&&(await this.handleSrcChanged(),await this.autoTranslate(),C.log("lipsync mode is canplay"))})),t(this.video,"emptied",(async()=>{this.video.src&&await lt(this.site,this.video)===this.videoData.videoId||(C.log("lipsync mode is emptied"),this.videoData="",this.stopTranslation())})),["rutube","ok"].includes(this.site.host)||t(this.video,"volumechange",(()=>{this.syncVideoVolumeSlider()}))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer=()=>{clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)};changeOpacityOnEvent=t=>{clearTimeout(this.timer),this.logout(1),t.stopPropagation()};async changeSubtitlesLang(t){if(C.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(_.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.yandexSubtitles=null;else{const e=this.subtitlesList.at(parseInt(t));if(1===this.data.audioProxy&&e.url.startsWith("https://brosubs.s3-private.mds.yandex.net/vtrans/")){const t=e.url.replace("https://brosubs.s3-private.mds.yandex.net/vtrans/","");e.url=`https://${this.data.proxyWorkerHost}/video-subtitles/subtitles-proxy/${t}`,console.log(`[VOT] Subs proxied via ${e.url}`)}this.yandexSubtitles=await Pe(e),this.subtitlesWidget.setContent(this.yandexSubtitles),this.votDownloadSubtitlesButton.hidden=!1}}async updateSubtitlesLangSelect(){const t=[{label:_.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(_.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${_.get("VOTTranslatedFrom")} ${_.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?` ${t.source}`:"")+(t.isAutoGenerated?` (${_.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${_.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,this.votButton.container.hidden=!0,void await this.updateSubtitlesLangSelect();if(this.votButton.container.hidden=!1,this.subtitlesListVideoId!==this.videoData.videoId){try{this.subtitlesList=await Ee(this.votClient,this.videoData)}catch(t){if("VOTSubtitlesNotSupportedUrl"===t?.unlocalizedMessage)return this.subtitlesList=[],void await this.updateSubtitlesLangSelect();C.log("Error with yandex server, try auto-fix...",t),this.votOpts={fetchFn:q,hostVOT:ae,host:this.data.proxyWorkerHost},this.votClient=new gt(this.votOpts),this.subtitlesList=await Ee(this.votClient,this.videoData),await P.set("translateProxyEnabled",1)}this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect()}}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=Oe.getVideoVolume()??t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(Oe.setVideoVolume(t))return}this.video.volume=t}getAudioVolume(){return this.gainNode?this.gainNode.gain.value:this.audio.volume}setAudioVolume(t){return this.gainNode?this.gainNode.gain.value=t:this.audio.volume=t}isMuted(){return["youtube","googledrive"].includes(this.site.host)?Oe.isMuted():this.video?.muted}syncVideoVolumeSlider(){const t=this.isMuted()?0:100*this.getVideoVolume(),e=Math.round(t);this.votVideoVolumeSlider.input.value=e,this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,fe.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(e))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(_.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(_.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncVolumeWrapper(t,e){const o="translation"===t?this.votVideoVolumeSlider:this.votVideoTranslationVolumeSlider,n=Number(o.input.value),i=function(t,e,o,n){let i=e;return e>n?(i=o+(e-n),i=i>100?100:Math.max(i,0),t.volume=i/100):e100?100:Math.max(i,0),t.volume=i/100),i}("translation"===t?this.video:this.audio,e,n,"translation"===t?this.tempVolume:this.tempOriginalVolume);o.input.value=i,o.label.querySelector("strong").textContent=`${i}%`,fe.updateSlider(o.input),this.tempOriginalVolume="translation"===t?i:e,this.tempVolume="translation"===t?e:i}async getVideoData(){const{duration:t,url:e,videoId:o,host:n,translationHelp:i,detectedLanguage:a}=await dt(this.site,this.video),r={translationHelp:i??null,isStream:!1,duration:this.video?.duration||t||y.defaultDuration,videoId:o,url:e,host:n,detectedLanguage:a??this.translateFromLang,responseLanguage:this.translateToLang};if("youtube"===this.site.host){const t=await Oe.getVideoData();r.isStream=t.isLive,t.title&&(r.detectedLanguage=t.detectedLanguage)}else if(["rutube","ok.ru","mail_ru"].includes(this.site.host))r.detectedLanguage="ru";else if("youku"===this.site.host)r.detectedLanguage="zh";else if("vk"===this.site.host){const t=document.getElementsByTagName("track")?.[0]?.srclang;r.detectedLanguage=t||"auto"}else"weverse"===this.site.host?r.detectedLanguage="ko":["bilibili","piped","invidious","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunter","archive","nineanimetv","directlink"].includes(this.site.host)&&(r.detectedLanguage="auto");return r}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)&&(C.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage))throw new ut("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new ut("VOTVideoIsTooLong");return!0}lipSync(t=!1){if(C.log("lipsync video",this.video),this.video)if(this.audio.currentTime=this.video.currentTime,this.audio.playbackRate=this.video.playbackRate,t)if("play"!=t)["pause","stop","waiting"].includes(t)&&(C.log(`lipsync mode is ${t}`),this.audio.pause()),"playing"==t&&(C.log("lipsync mode is playing"),this.audio.play());else{C.log("lipsync mode is play");const t=this.audio.play();void 0!==t&&t.catch((async t=>{if(console.error("[VOT]",t),"NotAllowedError"===t.name)throw this.transformBtn("error",_.get("grantPermissionToAutoPlay")),new ut("grantPermissionToAutoPlay")}))}else C.log("lipsync mode is not set")}handleVideoEvent=t=>{C.log(`video ${t.type}`),this.lipSync(t.type)};stopTranslate(){for(const t of qe)this.video.removeEventListener(t,this.handleVideoEvent);this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",_.get("translateVideo")),C.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),this.volumeOnStart="",clearInterval(this.streamPing),clearTimeout(this.autoRetry),this.hls?.destroy(),this.hls=D(),this.firstSyncVolume=!0}async translateExecutor(t){C.log("Run translateFunc",t),await this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=_.get("translationTake"),o=_.lang;if(["Подготавливаем перевод","Видео передано в обработку","Ожидаем перевод видео","Загружаем переведенное аудио"].includes(t)&&this.setLoadingBtn(!0),"VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(t instanceof Error)this.transformBtn("error",t?.message);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===o)this.transformBtn("error",t);else{this.setLoadingBtn(!0);const e=await async function(t,e="",o="ru"){switch(await P.get("translationService",se)){case"yandex":{const n=e&&o?`${e}-${o}`:o;return await ye.translate(t,n)}case"deepl":return await xe.translate(t,e,o);default:return t}}(t,"ru",o);this.transformBtn("error",e)}}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").textContent=100*this.data.autoVolume+"%",fe.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}async updateTranslation(t){if(this.cachedTranslation?.url===this.audio.currentSrc)C.log("[translateFunc] Audio src is the same"),this.audio.src=t;else{try{const e=await q(t,{method:"HEAD",timeout:5e3});if(C.log("Test audio response",e),404===e.status){C.log("Yandex returned not valid audio, trying to fix...");let e=await this.translateVideoImpl(this.videoData,this.videoData.detectedLanguage="auto",this.videoData.responseLanguage,this.videoData.translationHelp);this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage),t=e.url,C.log("Fixed audio audioUrl",t)}else C.log("Valid audioUrl",t)}catch(t){"Timeout"===t.message?(C.log("Request timed out. Handling timeout error..."),this.data.audioProxy=1,await P.set("audioProxy",1)):C.log("Test audio error:",t)}this.audio.src=t;try{await this.audio.play()}catch(t){if(console.error("[VOT]",t),"NotSupportedError"===t.name){if([...L,...M].includes(window.location.hostname))throw new ut("VOTMediaCSPError");this.data.audioProxy=1,await P.set("audioProxy",1)}}}if(1===this.data.audioProxy&&t.startsWith("https://vtrans.s3-private.mds.yandex.net/tts/prod/")){const e=t.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/","");t=`https://${this.data.proxyWorkerHost}/video-translation/audio-proxy/${e}`,console.log(`[VOT] Audio proxied via ${t}`)}if(this.audio.src=t,this.volumeOnStart||(this.volumeOnStart=this.getVideoVolume()),this.setupAudioSettings(),"twitter"===this.site.host)document.querySelector('button[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslation);this.video&&!this.video.paused&&this.lipSync("play");for(const t of qe)this.video.addEventListener(t,this.handleVideoEvent);this.transformBtn("success",_.get("disableTranslate")),this.afterUpdateTranslation(t)}async translateFunc(t,e,o,n,i){if(console.log("[VOT] Video Data: ",this.videoData),C.log("Run videoValidator"),this.videoValidator(),this.setLoadingBtn(!0),e){let t=await this.translateStreamImpl(this.videoData,o,n);if(!t)return void C.log("Skip translation");this.transformBtn("success",_.get("disableTranslate"));const e=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(t.result.url)}`;if(this.hls)this.setupHLS(e);else{if(!this.audio.canPlayType("application/vnd.apple.mpegurl"))throw new ut("audioFormatNotSupported");this.audio.src=e}if("youtube"===this.site.host&&Oe.videoSeek(this.video,10),this.setupAudioSettings(),!this.video.src&&!this.video.currentSrc&&!this.video.srcObject)return this.stopTranslation();this.video&&!this.video.paused&&this.lipSync("play");for(const t of qe)this.video.addEventListener(t,this.handleVideoEvent);return this.afterUpdateTranslation(e)}if(this.cachedTranslation=this.videoTranslations.find((e=>e.videoId===t&&e.expires>Date.now()/1e3&&e.from===o&&e.to===n)),this.cachedTranslation)return await this.updateTranslation(this.cachedTranslation.url),void C.log("[translateFunc] Cached translation was received");let a=await this.translateVideoImpl(this.videoData,o,n,i);C.log("[translateRes]",a),a?(await this.updateTranslation(a.url),[k.kick,k.reddit,k.patreon,k.kodik,k.appledeveloper,k.epicgames,k.nineanimetv].includes(this.site.host)||this.subtitlesList.some((t=>"yandex"===t.source&&t.translatedFromLanguage===this.videoData.detectedLanguage&&t.language===this.videoData.responseLanguage))||(this.subtitlesList=await Ee(this.votClient,this.videoData),await this.updateSubtitlesLangSelect()),this.videoTranslations.push({videoId:t,from:o,to:n,url:this.downloadTranslationUrl,expires:Date.now()/1e3+this.videoTranslationTTL})):C.log("Skip translation")}setupHLS(t){this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){C.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){C.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(t),this.hls.attachMedia(this.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),C.log(this.hls)}setupAudioSettings(){"number"==typeof this.data.defaultVolume&&this.setAudioVolume(this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume)}stopTranslation=()=>{this.stopTranslate(),this.syncVideoVolumeSlider()};async handleSrcChanged(){C.log("[VideoHandler] src changed",this),this.firstPlay=!0;const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||(this.container.appendChild(this.votButton.container),this.container.appendChild(this.votMenu.container)),await Promise.all([this.videoData=await this.getVideoData(),this.updateSubtitles(),this.translateToLang=this.data.responseLanguage??"ru"]),this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage)}async release(){C.log("[VideoHandler] release"),this.initialized=!1,this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Ge=new class{constructor(){this.videoCache=new Set,this.onVideoAdded=new Ne,this.onVideoRemoved=new Ne,this.observer=new MutationObserver(this.handleMutations),this.intersectionObserver=new IntersectionObserver(this.handleIntersections,{threshold:.1})}handleMutations=t=>{window.requestIdleCallback((()=>{for(let e=0;e{for(let e=0;e{if(!t)return;const n=t.querySelectorAll("video");for(let t=0;t{this.videoCache.has(t)||(this.videoCache.add(t),this.intersectionObserver.observe(t))};handleIntersectingVideo=t=>{this.intersectionObserver.unobserve(t),(t=>{if(Re.test(t.className)||Re.test(t.title))return!0;let e=t.parentElement;for(;e;){if(Re.test(e.className)||Re.test(e.id))return!0;e=e.parentElement}return!1})(t)||(t=>t.hasAttribute("muted")&&!t.classList.contains("vjs-tech"))(t)?C.log("The promotional/muted video was ignored",t):((t,e)=>{const o=()=>{(t=>t.readyState>=3)(t)?e(t):requestAnimationFrame(o)};o()})(t,this.handleVideoAdded)};handleVideoAdded=t=>{this.onVideoAdded.dispatch(t)};handleVideoRemoved=t=>{document.contains(t)||(this.videoCache.delete(t),this.onVideoRemoved.dispatch(t))}},We=new WeakMap;function je(t,e){if(t.shadowRoot){let o=t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.shadowRoot.contains(e))):e.parentElement;return o&&o.shadowRoot?o.parentElement:o}const o=De.browser.version.split(".")[0];if(t.selector?.includes(":not")&&t.selector?.includes("*")&&o&&("Chrome"===De.browser.name&&Number(o)<88||"Firefox"===De.browser.name&&Number(o)<84)){const o=t.selector.split(" *")[0];return o?Array.from(document.querySelectorAll(o)).find((t=>t.contains(e))):e.parentElement}return t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.contains(e))):e.parentElement}(async function(){C.log("Loading extension..."),await _.update(),C.log(`Selected menu language: ${_.lang}`),"https://9animetv.to"===window.location.origin&&window.addEventListener("message",(t=>{if("https://rapid-cloud.co"===t.origin&&"getVideoId"===t.data){const t=/[^/]+$/.exec(window.location.href)?.[0],e=document.querySelector("#iframe-embed")?.contentWindow;e.postMessage(`getVideoId:${t}`,"https://rapid-cloud.co/")}})),Ge.onVideoAdded.addListener((t=>{for(const e of function(){if(/(http(s)?:\/\/)(127\.0\.0\.1|localhost)/.exec(window.location.href))return[];const t=window.location.hostname,e=new URL(window.location),o=o=>o instanceof RegExp?o.test(t):"string"==typeof o?t.includes(o):"function"==typeof o&&o(e);return A.filter((t=>(Array.isArray(t.match)?t.match.some(o):o(t.match))&&t.host&&t.url))}()){if(!e)continue;let o=je(e,t);if(o&&(("rumble"!==e.host||t.style.display)&&(["peertube","directlink"].includes(e.host)&&(e.url=window.location.origin),!We.has(t)))){We.set(t,new Ue(t,o,e));break}}})),Ge.onVideoRemoved.addListener((async t=>{We.has(t)&&(await We.get(t).release(),We.delete(t))})),Ge.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file + `),this.votMenu.headerContainer.appendChild(this.votSettingsButton),this.votTranslationLanguageSelect=ye.createVOTLanguageSelect({fromTitle:_.get("langs")[this.video.detectedLanguage],fromDialogTitle:_.get("videoLanguage"),fromItems:ze(nt,this.videoData.detectedLanguage),fromOnSelectCB:async t=>{C.log("[fromOnSelectCB] select from language",t.target.dataset.votValue),this.videoData=await this.getVideoData(),this.setSelectMenuValues(t.target.dataset.votValue,this.videoData.responseLanguage)},toTitle:_.get("langs")[this.video.responseLanguage],toDialogTitle:_.get("translationLanguage"),toItems:ze(it,this.videoData.responseLanguage),toOnSelectCB:async t=>{const e=t.target.dataset.votValue;C.log("[toOnSelectCB] select to language",e),this.data.responseLanguage=this.translateToLang=e,await P.set("responseLanguage",this.data.responseLanguage),C.log("Response Language value changed. New value: ",this.data.responseLanguage),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage)}}),this.votMenu.bodyContainer.appendChild(this.votTranslationLanguageSelect.container),this.votSubtitlesSelect=ye.createVOTSelect(_.get("VOTSubtitlesDisabled"),_.get("VOTSubtitles"),[{label:_.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1}],{onSelectCb:async t=>{await this.changeSubtitlesLang(t.target.dataset.votValue)},labelElement:ye.createVOTSelectLabel(_.get("VOTSubtitles"))}),this.votMenu.bodyContainer.appendChild(this.votSubtitlesSelect.container),this.votVideoVolumeSlider=ye.createSlider(Dt`${_.get("VOTVolume")}: + ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=ye.createSlider(Dt`${_.get("VOTVolumeTranslation")}: + ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100,0,this.data.audioBooster?900:100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=ye.createDialog(_.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=ye.createHeader(_.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=ye.createCheckbox(_.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=ye.createVOTSelect(_.get("langs")[P.syncGet("dontTranslateLanguage",$)],_.get("VOTDontTranslateYourLang"),ze(nt,P.syncGet("dontTranslateLanguage",$)),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await P.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:ye.createCheckbox(_.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.changehotkeyButton=ye.createOutlinedButton(Ue(this.data.hotkeyButton)),this.votSettingsDialog.bodyContainer.appendChild(this.changehotkeyButton),this.votAutoSetVolumeCheckbox=ye.createCheckbox(`${_.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=ye.createSlider(Dt`${100*(this.data?.autoVolume??se)}%`,100*(this.data?.autoVolume??se),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=ye.createCheckbox(_.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votAudioBoosterCheckbox=ye.createCheckbox(_.get("VOTAudioBooster"),this.data?.audioBooster??!1),this.votAudioBoosterCheckbox.container.hidden=!this.audioContext,this.votSettingsDialog.bodyContainer.appendChild(this.votAudioBoosterCheckbox.container),this.votSyncVolumeCheckbox=ye.createCheckbox(_.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votTranslationServiceSelect=ye.createVOTSelect(P.syncGet("translationService",le).toUpperCase(),_.get("VOTTranslationService"),ze(ke,P.syncGet("translationService",le)),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await P.set("translationService",this.data.translationService)},labelElement:ye.createCheckbox(_.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===_.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=ye.createVOTSelect(P.syncGet("detectService",de).toUpperCase(),_.get("VOTDetectService"),ze(Te,P.syncGet("detectService",de)),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await P.set("detectService",this.data.detectService)},labelElement:ye.createVOTSelectLabel(_.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=ye.createHeader(_.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesDetails=ye.createDetails(_.get("VOTSubtitlesDesign")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesDetails.container),this.votProxyHeader=ye.createHeader(_.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=ye.createTextfield(_.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,ie),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=ye.createTextfield(_.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,ae),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=ye.createCheckbox(_.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votAboutHeader=ye.createHeader(_.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=ye.createVOTSelect(_.get("langs")[P.syncGet("locale-lang-override","auto")],_.get("VOTMenuLanguage"),ze(E,P.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await P.set("locale-lang-override",t.target.dataset.votValue)},labelElement:ye.createVOTSelectLabel(_.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=ye.createCheckbox(_.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!B(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=ye.createInformation(`${_.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=ye.createInformation(`${_.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=ye.createInformation(`${_.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=ye.createInformation(`${_.get("VOTBrowser")}:`,`${Fe.browser.name} ${Fe.browser.version} (${Fe.os.name} ${Fe.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votResetSettingsButton=ye.createButton(_.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}async handleTranslationBtnClick(){if(this.audio.src)return C.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return C.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(C.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new ct("VOTNoVideoIDFound");"vk"===this.site.host&&"clips"===this.site.additionalData&&(this.videoData=await this.getVideoData()),await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t)}}initUIEvents(){this.votButton.translateButton.addEventListener("click",(async()=>{await this.handleTranslationBtnClick()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votButton.container.addEventListener("mousedown",(()=>{this.dragging=!0})),this.container.addEventListener("mouseup",(()=>{this.dragging=!1})),this.container.addEventListener("mousemove",(async t=>{if(this.dragging){t.preventDefault();const e=t.clientX/this.container.clientWidth*100;this.data.buttonPos=this.container.clientWidth&&this.container.clientWidth>550?e<=44?"left":e>=66?"right":"default":"default",this.votButton.container.dataset.direction="default"===this.data.buttonPos?"row":"column",this.votButton.container.dataset.position=this.data.buttonPos,this.votMenu.container.dataset.position=this.data.buttonPos,this.container.clientWidth&&this.container.clientWidth>550&&await P.set("buttonPos",this.data.buttonPos)}})),this.votDownloadButton.addEventListener("click",(()=>{this.downloadTranslationUrl&&window.open(this.downloadTranslationUrl,"_blank").focus()})),this.votDownloadSubtitlesButton.addEventListener("click",(async()=>{const t=function(t,e="srt"){const o=t.subtitles.map(((t,o)=>{const n=t.startMs/1e3,i=(t.startMs+t.durationMs)/1e3;return("srt"===e?`${o+1}\n`:"")+`${bt(n)} --\x3e ${bt(i)}\n${t.text}\n\n`})).join("").trim();return"vtt"===e?`WEBVTT\n\n${o}`:o}(this.yandexSubtitles,"srt"),e=new Blob([t],{type:"text/plain"}),o=URL.createObjectURL(e),n=document.createElement("a");n.href=o,n.download=`subtitles_${this.videoData.videoId}.srt`,n.click(),URL.revokeObjectURL(o)})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,this.setVideoVolume(e/100),this.data.syncVolume&&this.syncVolumeWrapper("video",e)})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await P.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").textContent=`${this.data.defaultVolume}%`,this.setAudioVolume(this.data.defaultVolume/100),this.data.syncVolume&&(this.syncVolumeWrapper("translation",this.data.defaultVolume),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.setVideoVolume(this.tempOriginalVolume/100))})()}));{this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await Promise.all([P.set("autoTranslate",this.data.autoTranslate),this.autoTranslate()]),C.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await P.set("dontTranslateYourLang",this.data.dontTranslateYourLang),C.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()}));const t=async t=>{await P.set("hotkeyButton",t),this.data.hotkeyButton=t,this.changehotkeyButton.textContent=Ue(t)},e=o=>{const n="Escape"===o.code?null:o.code;t(n),document.removeEventListener("keydown",e)};this.changehotkeyButton.addEventListener("click",(()=>{this.changehotkeyButton.textContent=_.get("VOTPressNewHotkey"),document.addEventListener("keydown",e)})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await P.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),C.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await P.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").textContent=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await P.set("showVideoSlider",this.data.showVideoSlider),C.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votAudioBoosterCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioBooster=Number(t.target.checked),await P.set("audioBooster",this.data.audioBooster),C.log("audioBooster value changed. New value: ",this.data.audioBooster);const e=this.votVideoTranslationVolumeSlider.input.value;this.votVideoTranslationVolumeSlider.input.max=this.data.audioBooster?900:100,this.data.audioBooster||(this.votVideoTranslationVolumeSlider.input.value=e>100?100:e,this.votVideoTranslationVolumeSlider.input.dispatchEvent(new Event("input")))})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await P.set("syncVolume",this.data.syncVolume),C.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await P.set("translateAPIErrors",this.data.translateAPIErrors),C.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesDetails.container.addEventListener("click",(()=>{this.votSubtitlesDialog=ye.createDialog(_.get("VOTSubtitlesDesign")),this.votSubtitlesDialog.container.classList.add("vot-dialog-temp"),this.votSubtitlesDialog.container.hidden=!1,this.votSubtitlesDialog.backdrop.onclick=this.votSubtitlesDialog.closeButton.onclick=()=>{this.votSubtitlesDialog.container.remove()},this.votSubtitlesHighlightWordsCheckbox=ye.createCheckbox(_.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votSubtitlesMaxLengthSlider=ye.createSlider(Dt`${_.get("VOTSubtitlesMaxLength")}: + ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesFontSizeSlider=ye.createSlider(Dt`${_.get("VOTSubtitlesFontSize")}: + ${this.data?.subtitlesFontSize??20}`,this.data?.subtitlesFontSize??20,8,50),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesFontSizeSlider.container),this.votSubtitlesOpacitySlider=ye.createSlider(Dt`${_.get("VOTSubtitlesOpacity")}: + ${this.data?.subtitlesOpacity??20}`,this.data?.subtitlesOpacity??20,0,100),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesOpacitySlider.container),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await P.set("highlightWords",this.data.highlightWords),C.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await P.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").textContent=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesFontSizeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesFontSize=Number(t.target.value),await P.set("subtitlesFontSize",this.data.subtitlesFontSize),this.votSubtitlesFontSizeSlider.label.querySelector("strong").textContent=`${this.data.subtitlesFontSize}`,this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize)})()})),this.votSubtitlesOpacitySlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesOpacity=Number(t.target.value),await P.set("subtitlesOpacity",this.data.subtitlesOpacity),this.votSubtitlesOpacitySlider.label.querySelector("strong").textContent=`${this.data.subtitlesOpacity}`,this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity)})()})),document.documentElement.appendChild(this.votSubtitlesDialog.container)})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await P.set("showPiPButton",this.data.showPiPButton),C.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!B()||!this.data.showPiPButton,this.votButton.separator2.hidden=!B()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||ie,await P.set("m3u8ProxyHost",this.data.m3u8ProxyHost),C.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||ae,await P.set("proxyWorkerHost",this.data.proxyWorkerHost),C.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),this.data.translateProxyEnabled&&(this.votClient.host=this.data.proxyWorkerHost)})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await P.set("audioProxy",this.data.audioProxy),C.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{_.reset();const t=await P.list();for(let e=0;e{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,n)=>{for(const i of o)t(e,i,n)};if(this.resizeObserver=new ResizeObserver((t=>{for(let e=0;e550;this.votButton.container.dataset.position=this.votMenu.container.dataset.position=e?this.data?.buttonPos:"default",this.votButton.container.dataset.direction=this.data?.buttonPos&&"default"!==this.data?.buttonPos&&e?"column":"row"})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{if(this.audio.src&&this.data.syncVolume)for(let e=0;e{const e=t.target,o=this.votButton.container,n=this.votMenu.container,i=this.container,a=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=n.contains(e),d=i.contains(e),u=a.contains(e),c=r?.contains(e)??!1;C.log(`[document click] ${s} ${l} ${d} ${u} ${c}`),s||l||u||c||(d||this.logout(0),this.votMenu.container.hidden=!0)})),document.addEventListener("keydown",(async t=>{const e=t.code,o=document.activeElement;["input","textarea"].includes(o.tagName.toLowerCase())||o.isContentEditable||e!==this.data.hotkeyButton||await this.handleTranslationBtnClick()})),o="pornhub"===this.site.host?"embed"===this.site.additionalData?document.querySelector("#player"):this.container.querySelector(".mgp_eventCatcher"):"twitter"===this.site.host?document.querySelector('div[data-testid="videoPlayer"]'):"yandexdisk"===this.site.host?document.querySelector(".video-player__player"):this.container,o&&e(o,["mousemove","mouseout"],this.resetTimer),t(this.votButton.container,"mousemove",this.changeOpacityOnEvent),t(this.votMenu.container,"mousemove",this.changeOpacityOnEvent),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEvent),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),"googledrive"===this.site.host&&(this.container.style.height="100%"),t(this.video,"canplay",(async()=>{"rutube"===this.site.host&&this.video.src||await dt(this.site,this.video)!==this.videoData.videoId&&(await this.handleSrcChanged(),await this.autoTranslate(),C.log("lipsync mode is canplay"))})),t(this.video,"emptied",(async()=>{this.video.src&&await dt(this.site,this.video)===this.videoData.videoId||(C.log("lipsync mode is emptied"),this.videoData="",this.stopTranslation())})),["rutube","ok"].includes(this.site.host)||t(this.video,"volumechange",(()=>{this.syncVideoVolumeSlider()}))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer=()=>{clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)};changeOpacityOnEvent=t=>{clearTimeout(this.timer),this.logout(1),t.stopPropagation()};async changeSubtitlesLang(t){if(C.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(_.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.yandexSubtitles=null;else{const e=this.subtitlesList.at(parseInt(t));if(1===this.data.audioProxy&&e.url.startsWith("https://brosubs.s3-private.mds.yandex.net/vtrans/")){const t=e.url.replace("https://brosubs.s3-private.mds.yandex.net/vtrans/","");e.url=`https://${this.data.proxyWorkerHost}/video-subtitles/subtitles-proxy/${t}`,console.log(`[VOT] Subs proxied via ${e.url}`)}this.yandexSubtitles=await Ee(e),this.subtitlesWidget.setContent(this.yandexSubtitles),this.votDownloadSubtitlesButton.hidden=!1}}async updateSubtitlesLangSelect(){const t=[{label:_.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(_.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${_.get("VOTTranslatedFrom")} ${_.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?` ${t.source}`:"")+(t.isAutoGenerated?` (${_.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${_.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,this.votButton.container.hidden=!0,void await this.updateSubtitlesLangSelect();if(this.votButton.container.hidden=!1,this.subtitlesListVideoId!==this.videoData.videoId){try{this.subtitlesList=await _e(this.votClient,this.videoData)}catch(t){if("VOTSubtitlesNotSupportedUrl"===t?.unlocalizedMessage)return this.subtitlesList=[],void await this.updateSubtitlesLangSelect();C.log("Error with yandex server, try auto-fix...",t),this.votOpts={fetchFn:q,hostVOT:re,host:this.data.proxyWorkerHost},this.votClient=new vt(this.votOpts),this.subtitlesList=await _e(this.votClient,this.videoData),await P.set("translateProxyEnabled",1)}this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect()}}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=Ie.getVideoVolume()??t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(Ie.setVideoVolume(t))return}this.video.volume=t}getAudioVolume(){return this.gainNode?this.gainNode.gain.value:this.audio.volume}setAudioVolume(t){return this.gainNode?this.gainNode.gain.value=t:this.audio.volume=t}isMuted(){return["youtube","googledrive"].includes(this.site.host)?Ie.isMuted():this.video?.muted}syncVideoVolumeSlider(){const t=this.isMuted()?0:100*this.getVideoVolume(),e=Math.round(t);this.votVideoVolumeSlider.input.value=e,this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,ye.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(e))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(_.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(_.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncVolumeWrapper(t,e){const o="translation"===t?this.votVideoVolumeSlider:this.votVideoTranslationVolumeSlider,n=Number(o.input.value),i=function(t,e,o,n){let i=e;return e>n?(i=o+(e-n),i=i>100?100:Math.max(i,0),t.volume=i/100):e100?100:Math.max(i,0),t.volume=i/100),i}("translation"===t?this.video:this.audio,e,n,"translation"===t?this.tempVolume:this.tempOriginalVolume);o.input.value=i,o.label.querySelector("strong").textContent=`${i}%`,ye.updateSlider(o.input),this.tempOriginalVolume="translation"===t?i:e,this.tempVolume="translation"===t?e:i}async getVideoData(){const{duration:t,url:e,videoId:o,host:n,translationHelp:i,detectedLanguage:a}=await ut(this.site,this.video),r={translationHelp:i??null,isStream:!1,duration:this.video?.duration||t||y.defaultDuration,videoId:o,url:e,host:n,detectedLanguage:a??this.translateFromLang,responseLanguage:this.translateToLang};if("youtube"===this.site.host){const t=await Ie.getVideoData();r.isStream=t.isLive,t.title&&(r.detectedLanguage=t.detectedLanguage)}else if(["rutube","ok.ru","mail_ru"].includes(this.site.host))r.detectedLanguage="ru";else if("youku"===this.site.host)r.detectedLanguage="zh";else if("vk"===this.site.host){const t=document.getElementsByTagName("track")?.[0]?.srclang;r.detectedLanguage=t||"auto"}else"weverse"===this.site.host?r.detectedLanguage="ko":["bilibili","piped","invidious","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunter","archive","nineanimetv","directlink"].includes(this.site.host)&&(r.detectedLanguage="auto");return r}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)&&(C.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage))throw new ct("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new ct("VOTVideoIsTooLong");return!0}lipSync(t=!1){if(C.log("lipsync video",this.video),this.video)if(this.audio.currentTime=this.video.currentTime,this.audio.playbackRate=this.video.playbackRate,t)if("play"!=t)["pause","stop","waiting"].includes(t)&&(C.log(`lipsync mode is ${t}`),this.audio.pause()),"playing"==t&&(C.log("lipsync mode is playing"),this.audio.play());else{C.log("lipsync mode is play");const t=this.audio.play();void 0!==t&&t.catch((async t=>{if(console.error("[VOT]",t),"NotAllowedError"===t.name)throw this.transformBtn("error",_.get("grantPermissionToAutoPlay")),new ct("grantPermissionToAutoPlay")}))}else C.log("lipsync mode is not set")}handleVideoEvent=t=>{C.log(`video ${t.type}`),this.lipSync(t.type)};stopTranslate(){for(const t of He)this.video.removeEventListener(t,this.handleVideoEvent);this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",_.get("translateVideo")),C.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),this.volumeOnStart="",clearInterval(this.streamPing),clearTimeout(this.autoRetry),this.hls?.destroy(),this.hls=D(),this.firstSyncVolume=!0}async translateExecutor(t){C.log("Run translateFunc",t),await this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=_.get("translationTake"),o=_.lang;if(["Подготавливаем перевод","Видео передано в обработку","Ожидаем перевод видео","Загружаем переведенное аудио"].includes(t)&&this.setLoadingBtn(!0),"VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(t instanceof Error)this.transformBtn("error",t?.message);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===o)this.transformBtn("error",t);else{this.setLoadingBtn(!0);const e=await async function(t,e="",o="ru"){switch(await P.get("translationService",le)){case"yandex":{const n=e&&o?`${e}-${o}`:o;return await we.translate(t,n)}case"deepl":return await Se.translate(t,e,o);default:return t}}(t,"ru",o);this.transformBtn("error",e)}}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").textContent=100*this.data.autoVolume+"%",ye.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}async updateTranslation(t){if(this.cachedTranslation?.url===this.audio.currentSrc)C.log("[translateFunc] Audio src is the same"),this.audio.src=t;else{try{const e=await q(t,{method:"HEAD",timeout:5e3});if(C.log("Test audio response",e),404===e.status){C.log("Yandex returned not valid audio, trying to fix...");let e=await this.translateVideoImpl(this.videoData,this.videoData.detectedLanguage="auto",this.videoData.responseLanguage,this.videoData.translationHelp);this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage),t=e.url,C.log("Fixed audio audioUrl",t)}else C.log("Valid audioUrl",t)}catch(t){"Timeout"===t.message?(C.log("Request timed out. Handling timeout error..."),this.data.audioProxy=1,await P.set("audioProxy",1)):C.log("Test audio error:",t)}this.audio.src=t;try{await this.audio.play()}catch(t){if(console.error("[VOT]",t),"NotSupportedError"===t.name){if([...L,...M].includes(window.location.hostname))throw new ct("VOTMediaCSPError");this.data.audioProxy=1,await P.set("audioProxy",1)}}}if(1===this.data.audioProxy&&t.startsWith("https://vtrans.s3-private.mds.yandex.net/tts/prod/")){const e=t.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/","");t=`https://${this.data.proxyWorkerHost}/video-translation/audio-proxy/${e}`,console.log(`[VOT] Audio proxied via ${t}`)}if(this.audio.src=t,this.volumeOnStart||(this.volumeOnStart=this.getVideoVolume()),this.setupAudioSettings(),"twitter"===this.site.host)document.querySelector('button[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslation);this.video&&!this.video.paused&&this.lipSync("play");for(const t of He)this.video.addEventListener(t,this.handleVideoEvent);this.transformBtn("success",_.get("disableTranslate")),this.afterUpdateTranslation(t)}async translateFunc(t,e,o,n,i){if(console.log("[VOT] Video Data: ",this.videoData),C.log("Run videoValidator"),this.videoValidator(),this.setLoadingBtn(!0),e){let t=await this.translateStreamImpl(this.videoData,o,n);if(!t)return void C.log("Skip translation");this.transformBtn("success",_.get("disableTranslate"));const e=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(t.result.url)}`;if(this.hls)this.setupHLS(e);else{if(!this.audio.canPlayType("application/vnd.apple.mpegurl"))throw new ct("audioFormatNotSupported");this.audio.src=e}if("youtube"===this.site.host&&Ie.videoSeek(this.video,10),this.setupAudioSettings(),!this.video.src&&!this.video.currentSrc&&!this.video.srcObject)return this.stopTranslation();this.video&&!this.video.paused&&this.lipSync("play");for(const t of He)this.video.addEventListener(t,this.handleVideoEvent);return this.afterUpdateTranslation(e)}if(this.cachedTranslation=this.videoTranslations.find((e=>e.videoId===t&&e.expires>Date.now()/1e3&&e.from===o&&e.to===n)),this.cachedTranslation)return await this.updateTranslation(this.cachedTranslation.url),void C.log("[translateFunc] Cached translation was received");let a=await this.translateVideoImpl(this.videoData,o,n,i);C.log("[translateRes]",a),a?(await this.updateTranslation(a.url),[k.kick,k.reddit,k.patreon,k.kodik,k.appledeveloper,k.epicgames,k.nineanimetv].includes(this.site.host)||this.subtitlesList.some((t=>"yandex"===t.source&&t.translatedFromLanguage===this.videoData.detectedLanguage&&t.language===this.videoData.responseLanguage))||(this.subtitlesList=await _e(this.votClient,this.videoData),await this.updateSubtitlesLangSelect()),this.videoTranslations.push({videoId:t,from:o,to:n,url:this.downloadTranslationUrl,expires:Date.now()/1e3+this.videoTranslationTTL})):C.log("Skip translation")}setupHLS(t){this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){C.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){C.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(t),this.hls.attachMedia(this.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),C.log(this.hls)}setupAudioSettings(){"number"==typeof this.data.defaultVolume&&this.setAudioVolume(this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume)}stopTranslation=()=>{this.stopTranslate(),this.syncVideoVolumeSlider()};async handleSrcChanged(){C.log("[VideoHandler] src changed",this),this.firstPlay=!0;const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||(this.container.appendChild(this.votButton.container),this.container.appendChild(this.votMenu.container)),await Promise.all([this.videoData=await this.getVideoData(),this.updateSubtitles(),this.translateToLang=this.data.responseLanguage??"ru"]),this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage)}async release(){C.log("[VideoHandler] release"),this.initialized=!1,this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const We=new class{constructor(){this.videoCache=new Set,this.onVideoAdded=new $e,this.onVideoRemoved=new $e,this.observer=new MutationObserver(this.handleMutations),this.intersectionObserver=new IntersectionObserver(this.handleIntersections,{threshold:.1})}handleMutations=t=>{window.requestIdleCallback((()=>{for(let e=0;e{for(let e=0;e{if(!t)return;const n=t.querySelectorAll("video");for(let t=0;t{this.videoCache.has(t)||(this.videoCache.add(t),this.intersectionObserver.observe(t))};handleIntersectingVideo=t=>{this.intersectionObserver.unobserve(t),(t=>{if(Be.test(t.className)||Be.test(t.title))return!0;let e=t.parentElement;for(;e;){if(Be.test(e.className)||Be.test(e.id))return!0;e=e.parentElement}return!1})(t)||(t=>t.hasAttribute("muted")&&!t.classList.contains("vjs-tech"))(t)?C.log("The promotional/muted video was ignored",t):((t,e)=>{const o=()=>{(t=>t.readyState>=3)(t)?e(t):requestAnimationFrame(o)};o()})(t,this.handleVideoAdded)};handleVideoAdded=t=>{this.onVideoAdded.dispatch(t)};handleVideoRemoved=t=>{document.contains(t)||(this.videoCache.delete(t),this.onVideoRemoved.dispatch(t))}},je=new WeakMap;function Ye(t,e){if(t.shadowRoot){let o=t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.shadowRoot.contains(e))):e.parentElement;return o&&o.shadowRoot?o.parentElement:o}const o=Fe.browser.version.split(".")[0];if(t.selector?.includes(":not")&&t.selector?.includes("*")&&o&&("Chrome"===Fe.browser.name&&Number(o)<88||"Firefox"===Fe.browser.name&&Number(o)<84)){const o=t.selector.split(" *")[0];return o?Array.from(document.querySelectorAll(o)).find((t=>t.contains(e))):e.parentElement}return t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.contains(e))):e.parentElement}(async function(){C.log("Loading extension..."),await _.update(),C.log(`Selected menu language: ${_.lang}`),"https://9animetv.to"===window.location.origin&&window.addEventListener("message",(t=>{if("https://rapid-cloud.co"===t.origin&&"getVideoId"===t.data){const t=/[^/]+$/.exec(window.location.href)?.[0],e=document.querySelector("#iframe-embed")?.contentWindow;e.postMessage(`getVideoId:${t}`,"https://rapid-cloud.co/")}})),We.onVideoAdded.addListener((t=>{for(const e of function(){if(/(http(s)?:\/\/)(127\.0\.0\.1|localhost)/.exec(window.location.href))return[];const t=window.location.hostname,e=new URL(window.location),o=o=>o instanceof RegExp?o.test(t):"string"==typeof o?t.includes(o):"function"==typeof o&&o(e);return A.filter((t=>(Array.isArray(t.match)?t.match.some(o):o(t.match))&&t.host&&t.url))}()){if(!e)continue;let o=Ye(e,t);if(o&&(("rumble"!==e.host||t.style.display)&&(["peertube","directlink"].includes(e.host)&&(e.url=window.location.origin),!je.has(t)))){je.set(t,new Ge(t,o,e));break}}})),We.onVideoRemoved.addListener((async t=>{je.has(t)&&(await je.get(t).release(),je.delete(t))})),We.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file diff --git a/dist/vot.user.js b/dist/vot.user.js index 266ffd82..f969b4b7 100644 --- a/dist/vot.user.js +++ b/dist/vot.user.js @@ -3368,6 +3368,101 @@ class UdemyHelper extends BaseHelper { return url.pathname.slice(1); } } +;// CONCATENATED MODULE: ./node_modules/vot.js/dist/helpers/coursera.js + + + + + + +class CourseraHelper extends BaseHelper { + API_ORIGIN = "https://www.coursera.org/api"; + + async getCourseData(courseId) { + const response = await this.fetch( + `${this.API_ORIGIN}/onDemandCourses.v1/${courseId}`, + ); + const resJSON = await response.json(); + return resJSON?.elements?.[0]; + } + + getPlayer() { + return document.querySelector(".vjs-v6"); + } + + getPlayerData() { + return this.getPlayer()?.player; + } + + findVideoUrl(sources) { + return sources?.find((src) => src.type === "video/mp4")?.src; + } + + findSubtitleUrl(captions, detectedLanguage) { + let subtitle = captions?.find( + (caption) => langTo6391(caption.srclang) === detectedLanguage, + ); + + if (!subtitle) { + subtitle = captions?.find( + (caption) => langTo6391(caption.srclang) === "en", + ) || captions?.[0]; + } + + return subtitle?.src; + } + + async getVideoData(videoId) { + const data = this.getPlayerData(); + + const { duration } = data?.cache_ || {}; + const { courseId, tracks, sources } = data?.options_ || {}; + + const videoUrl = this.findVideoUrl(sources); + if (!videoUrl) { + console.log("Failed to find .mp4 video file in sources", sources); + return undefined; + } + + const { primaryLanguageCodes } = await this.getCourseData(courseId); + let courseLang = primaryLanguageCodes?.[0]; + courseLang = courseLang ? langTo6391(courseLang) : "en"; + + if (!availableLangs.includes(courseLang)) { + courseLang = "en"; + } + + const subtitleUrl = this.findSubtitleUrl(tracks, courseLang); + if (!subtitleUrl) { + console.log("Failed to find subtitle file in tracks", tracks) + } + + return { + ...subtitleUrl ? { + url: sites.find((s) => s.host === VideoService.coursera).url + videoId, + translationHelp: [ + { + target: "subtitles_file_url", + targetUrl: subtitleUrl, + }, + { + target: "video_file_url", + targetUrl: videoUrl, + }, + ], + detectedLanguage: courseLang, + } : { + url: videoUrl, + translationHelp: null, + }, + duration, + }; + } + + async getVideoId(url) { + return /learn\/([^/]+)\/lecture\/([^/]+)/.exec(url.pathname)?.[0]; // <-- COURSE PASSING (IF YOU LOGINED TO COURSERA) + } +} ;// CONCATENATED MODULE: ./node_modules/vot.js/dist/helpers/index.js @@ -3395,6 +3490,8 @@ class UdemyHelper extends BaseHelper { + + @@ -3413,6 +3510,7 @@ class VideoHelper { static [VideoService.twitch] = new TwitchHelper(); static [VideoService.coursehunter] = new CoursehunterHelper(); static [VideoService.udemy] = new UdemyHelper(); + static [VideoService.coursera] = new CourseraHelper(); } ;// CONCATENATED MODULE: ./node_modules/vot.js/dist/utils/videoData.js @@ -5061,10 +5159,8 @@ function isMobile() { } function getPlayer() { - if (window.location.pathname.startsWith("/shorts/")) { - return isMobile() - ? document.querySelector("#movie_player") - : document.querySelector("#shorts-player"); + if (window.location.pathname.startsWith("/shorts/") && !isMobile()) { + return document.querySelector("#shorts-player"); } return document.querySelector("#movie_player"); diff --git a/patches/vot.js+1.1.0+007+added-coursera.patch b/patches/vot.js+1.1.0+007+added-coursera.patch index e927c11c..eb6591a7 100644 --- a/patches/vot.js+1.1.0+007+added-coursera.patch +++ b/patches/vot.js+1.1.0+007+added-coursera.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/vot.js/dist/config/sites.js b/node_modules/vot.js/dist/config/sites.js -index adf37b3..7ab6721 100644 +index 9b95b70..082212c 100644 --- a/node_modules/vot.js/dist/config/sites.js +++ b/node_modules/vot.js/dist/config/sites.js @@ -339,6 +339,14 @@ export default [ @@ -169,6 +169,32 @@ index 241d5cf..b0cf962 100644 } //# sourceMappingURL=index.d.ts.map \ No newline at end of file +diff --git a/node_modules/vot.js/dist/helpers/index.js b/node_modules/vot.js/dist/helpers/index.js +index f8e2601..38871c4 100644 +--- a/node_modules/vot.js/dist/helpers/index.js ++++ b/node_modules/vot.js/dist/helpers/index.js +@@ -13,6 +13,7 @@ import OdyseeHelper from "./odysee.js"; + import CoursehunterHelper from "./coursehunter.js"; + import TwitchHelper from "./twitch.js"; + import UdemyHelper from "./udemy.js"; ++import CourseraHelper from "./coursera.js"; + export * as MailRuHelper from "./mailru.js"; + export * as WeverseHelper from "./weverse.js"; + export * as KodikHelper from "./kodik.js"; +@@ -27,6 +28,7 @@ export * as OdyseeHelper from "./odysee.js"; + export * as CoursehunterHelper from "./coursehunter.js"; + export * as TwitchHelper from "./twitch.js"; + export * as UdemyHelper from "./udemy.js"; ++export * as CourseraHelper from "./udemy.js"; + export default class VideoHelper { + static [VideoService.mailru] = new MailRuHelper(); + static [VideoService.weverse] = new WeverseHelper(); +@@ -42,4 +44,5 @@ export default class VideoHelper { + static [VideoService.twitch] = new TwitchHelper(); + static [VideoService.coursehunter] = new CoursehunterHelper(); + static [VideoService.udemy] = new UdemyHelper(); ++ static [VideoService.coursera] = new CourseraHelper(); + } diff --git a/node_modules/vot.js/dist/types/helpers/coursera.d.ts b/node_modules/vot.js/dist/types/helpers/coursera.d.ts new file mode 100644 index 0000000..15d378e