@vkontakte/videoplayer 1.1.36-dev.55db5eff.0 → 1.1.36-dev.cdb7114a.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +4 -4
- package/es2015.esm.js +4 -4
- package/es2018.cjs.js +4 -4
- package/es2018.esm.js +4 -4
- package/esnext.cjs.js +4 -4
- package/esnext.esm.js +4 -4
- package/evergreen.esm.js +4 -4
- package/index.d.ts +1 -0
- package/package.json +5 -5
package/es2018.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.36-dev.
|
|
3
|
-
* Fri, 31 May 2024
|
|
2
|
+
* @vkontakte/videoplayer v1.1.36-dev.cdb7114a.0
|
|
3
|
+
* Fri, 31 May 2024 07:45:19 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-36/doc/
|
|
5
5
|
*/
|
|
6
|
-
var _0=Object.defineProperty;var w0=(t,e,i)=>e in t?_0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var zl=(t,e,i)=>(w0(t,typeof e!="symbol"?e+"":e,i),i);import{VERSION as k0,ChromecastState as Fn,PlaybackState as Kt,VideoQuality as Co,Player as y0,VideoFormat as Oo}from"@vkontakte/videoplayer-core/es2018.esm.js";import{VideoFormat as x6,VideoQuality as $6}from"@vkontakte/videoplayer-core/es2018.esm.js";import{InterfaceLanguage as Uo,VideoQuality as gl,fillWithDefault as C0,VERSION as S0,assertNonNullable as vt,safeStorage as Rn,isNullable as kl,Subscription as no,isNonNullable as Vn,isMacLike as $r,debounceFn as P0,ValueSubject as _r,getCurrentBrowser as wr,CurrentClientBrowser as B1,noop as Ge,checkNever as T0,timeCodeToString as E0,Subject as Cn,addScript as I0,Logger as R1,merge as A0,Observable as L0,map as M0,loadVKLangPack as V0,isIOS as kr,getHighestQuality as B0,throttleFn as Pl,CurrentClientDevice as R0,getIOSVersion as N0,detectEmbed as O0,observeElementSize as D0,isMobile as z0,cloneDeepWith as F0}from"@vkontakte/videoplayer-shared/es2018.esm.js";import{InterfaceLanguage as t8,VKNumericLanguage as i8,loadVKLangPack as n8}from"@vkontakte/videoplayer-shared/es2018.esm.js";import{VERSION as H0,SeekAction as qt,OneStat as U0,InteractiveInterfaceClick as Do}from"@vkontakte/videoplayer-statistics/es2018.esm.js";import"@vkontakte/videoplayer-interactive/es2018.esm.js";function K(){}function N1(t,e){for(const i in e)t[i]=e[i];return t}function O1(t){return t()}function es(){return Object.create(null)}function it(t){t.forEach(O1)}function Bn(t){return typeof t=="function"}function ge(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ol;function ts(t,e){return ol||(ol=document.createElement("a")),ol.href=e,t===ol.href}function q0(t){return Object.keys(t).length===0}function Jt(t,...e){if(t==null){for(const n of e)n(void 0);return K}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function et(t){let e;return Jt(t,i=>e=i)(),e}function D(t,e,i){t.$$.on_destroy.push(Jt(e,i))}function Kn(t,e,i,n){if(t){const l=D1(t,e,i,n);return t[0](l)}}function D1(t,e,i,n){return t[1]&&n?N1(i.ctx.slice(),t[1](n(e))):i.ctx}function Gn(t,e,i,n){if(t[2]&&n){const l=t[2](n(i));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],o=Math.max(e.dirty.length,l.length);for(let s=0;s<o;s+=1)r[s]=e.dirty[s]|l[s];return r}return e.dirty|l}return e.dirty}function Yn(t,e,i,n,l,r){if(l){const o=D1(e,i,n,r);t.p(o,l)}}function Qn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function j0(t){return t==null?"":t}const Tl=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function p(t,e){t.appendChild(e)}function We(t,e,i){const n=W0(t);if(!n.getElementById(e)){const l=T("style");l.id=e,l.textContent=i,Z0(n,l)}}function W0(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Z0(t,e){return p(t.head||t,e),e.sheet}function P(t,e,i){t.insertBefore(e,i||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function Nn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function T(t){return document.createElement(t)}function R(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function De(t){return document.createTextNode(t)}function O(){return De(" ")}function dt(){return De("")}function he(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function $t(t){return function(e){return e.preventDefault(),t.call(this,e)}}function rt(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function u(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function K0(t){return Array.from(t.childNodes)}function $e(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ft(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let ll;function G0(){if(ll===void 0){ll=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){ll=!0}}return ll}function yr(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=T("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const l=G0();let r;return l?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=he(window,"message",o=>{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{r=he(n.contentWindow,"resize",e),e()}),p(t,n),()=>{(l||r&&n.contentWindow)&&r(),S(n)}}function B(t,e,i){t.classList.toggle(e,!!i)}function Hn(t,e){return new t(e)}let Fo;function zo(t){Fo=t}function qo(){if(!Fo)throw new Error("Function called outside component initialization");return Fo}function bn(t){qo().$$.on_mount.push(t)}function El(t){qo().$$.on_destroy.push(t)}function cr(t,e){return qo().$$.context.set(t,e),e}function Cr(t){return qo().$$.context.get(t)}function z1(){return qo().$$.context}function Ao(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const So=[],ye=[];let Eo=[];const fr=[],F1=Promise.resolve();let dr=!1;function H1(){dr||(dr=!0,F1.then(U1))}function jo(){return H1(),F1}function Lo(t){Eo.push(t)}function qe(t){fr.push(t)}const Fl=new Set;let go=0;function U1(){if(go!==0)return;const t=Fo;do{try{for(;go<So.length;){const e=So[go];go++,zo(e),Y0(e.$$)}}catch(e){throw So.length=0,go=0,e}for(zo(null),So.length=0,go=0;ye.length;)ye.pop()();for(let e=0;e<Eo.length;e+=1){const i=Eo[e];Fl.has(i)||(Fl.add(i),i())}Eo.length=0}while(So.length);for(;fr.length;)fr.pop()();dr=!1,Fl.clear(),zo(t)}function Y0(t){if(t.fragment!==null){t.update(),it(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Lo)}}function Q0(t){const e=[],i=[];Eo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Eo=e}const bl=new Set;let uo;function fe(){uo={r:0,c:[],p:uo}}function de(){uo.r||it(uo.c),uo=uo.p}function d(t,e){t&&t.i&&(bl.delete(t),t.i(e))}function v(t,e,i,n){if(t&&t.o){if(bl.has(t))return;bl.add(t),uo.c.push(()=>{bl.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Gt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function X0(t,e){const i={},n={},l={$$scope:1};let r=t.length;for(;r--;){const o=t[r],s=e[r];if(s){for(const a in o)a in s||(n[a]=1);for(const a in s)l[a]||(i[a]=s[a],l[a]=1);t[r]=s}else for(const a in o)l[a]=1}for(const o in n)o in i||(i[o]=void 0);return i}function J0(t){return typeof t=="object"&&t!==null?t:{}}function je(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function q(t){t&&t.c()}function F(t,e,i){const{fragment:n,after_update:l}=t.$$;n&&n.m(e,i),Lo(()=>{const r=t.$$.on_mount.map(O1).filter(Bn);t.$$.on_destroy?t.$$.on_destroy.push(...r):it(r),t.$$.on_mount=[]}),l.forEach(Lo)}function H(t,e){const i=t.$$;i.fragment!==null&&(Q0(i.after_update),it(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function x0(t,e){t.$$.dirty[0]===-1&&(So.push(t),H1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function _e(t,e,i,n,l,r,o,s=[-1]){const a=Fo;zo(t);const c=t.$$={fragment:null,ctx:[],props:r,update:K,not_equal:l,bound:es(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:es(),dirty:s,skip_bound:!1,root:e.target||a.$$.root};o&&o(c.root);let f=!1;if(c.ctx=i?i(t,e.props||{},(m,h,..._)=>{const g=_.length?_[0]:h;return c.ctx&&l(c.ctx[m],c.ctx[m]=g)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](g),f&&x0(t,m)),h}):[],c.update(),f=!0,it(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const m=K0(e.target);c.fragment&&c.fragment.l(m),m.forEach(S)}else c.fragment&&c.fragment.c();e.intro&&d(t.$$.fragment),F(t,e.target,e.anchor),U1()}zo(a)}class we{constructor(){zl(this,"$$");zl(this,"$$set")}$destroy(){H(this,1),this.$destroy=K}$on(e,i){if(!Bn(i))return K;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const l=n.indexOf(i);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!q0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($0);var Mo;(function(t){t.VK="vk",t.VK_VIDEO="vk_video"})(Mo||(Mo={}));const ed={isMobile:void 0,defaultLanguage:Uo.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:Mo.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:gl.Q_480P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,additionalButtons:!0,contextMenuButton:!0},controls:{hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,slot:void 0,preview:void 0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},td=t=>C0(t,ed),id=t=>cr("ui-config",t),_n=()=>Cr("ui-config"),mr="vk_player_debug_panel_opened",q1=300,nd=100,od="videoplayer",ld="videoplayer";var Ee;(function(t){t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Comma="Comma",t.Period="Period",t.Space="Space",t.KeyM="KeyM",t.KeyF="KeyF",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyJ="KeyJ",t.KeyC="KeyC",t.KeyI="KeyI",t.Digit1="Digit1",t.Digit2="Digit2",t.Digit3="Digit3",t.Digit4="Digit4",t.Digit5="Digit5",t.Digit6="Digit6",t.Digit7="Digit7",t.Digit8="Digit8",t.Digit9="Digit9",t.Digit0="Digit0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Numpad0="Numpad0",t.ShiftLeft="ShiftLeft",t.ShiftRight="ShiftRight",t.Slash="Slash",t.Tab="Tab",t.Escape="Escape",t.Enter="Enter"})(Ee||(Ee={}));const Wo={[Ee.KeyF]:"f",[Ee.KeyK]:"k",[Ee.KeyC]:"c",[Ee.KeyM]:"m"},rd=new Set([Ee.ArrowLeft,Ee.ArrowRight,Ee.KeyL,Ee.KeyJ]),sd=new Set([Ee.Tab,Ee.Space,Ee.ArrowLeft,Ee.ArrowRight,Ee.ArrowUp,Ee.ArrowDown]),ad=new Set([Ee.ShiftRight,Ee.ShiftLeft]);var ft;(function(t){t.PLAY_BUTTON="PLAY_BUTTON",t.REPLAY_BUTTON="REPLAY_BUTTON",t.NEXT_BUTTON="NEXT_BUTTON",t.PREV_BUTTON="PREV_BUTTON",t.PICTURE_IN_PICTURE="PICTURE_IN_PICTURE",t.FULLSCREEN_BUTTON="FULLSCREEN_BUTTON",t.SETTINGS_BUTTON="SETTINGS_BUTTON",t.LIVE_BUTTON="LIVE_BUTTON",t.GRAPH_BUTTON="GRAPH_BUTTON",t.PLAY_PREV_CHAPTER_BUTTON="PLAY_PREV_CHAPTER_BUTTON",t.SEEK_TO_INTERACTIVE_BUTTON="SEEK_TO_INTERACTIVE_BUTTON",t.TIMELINE="TIMELINE",t.VOLUME_BAR="VOLUME_BAR",t.MUTE_BUTTON="MUTE_BUTTON",t.SUBTITLES_BUTTON="SUBTITLES_BUTTON",t.CHROMECAST_BUTTON="CHROMECAST_BUTTON",t.VK_BUTTON="VK_BUTTON",t.EPISODE_BUTTON="EPISODE_BUTTON",t.INCREMENT_PLAYBACK_RATE="INCREMENT_PLAYBACK_RATE",t.DECREMENT_PLAYBACK_RATE="DECREMENT_PLAYBACK_RATE"})(ft||(ft={}));const is=40,j1=260,ud=60,rl=8,W1=[ft.TIMELINE],_l=[...W1,ft.GRAPH_BUTTON],ns=[...W1,ft.PLAY_BUTTON],Z1=[..._l,ft.PLAY_BUTTON];var Po;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(Po||(Po={}));var Mt;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(Mt||(Mt={}));const Vo={[Mt.XS]:0,[Mt.S]:1,[Mt.M]:2,[Mt.L]:3,[Mt.XL]:4},bo=[];function zn(t,e){return{subscribe:Be(t,e).subscribe}}function Be(t,e=K){let i;const n=new Set;function l(s){if(ge(t,s)&&(t=s,i)){const a=!bo.length;for(const c of n)c[1](),bo.push(c,t);if(a){for(let c=0;c<bo.length;c+=2)bo[c][0](bo[c+1]);bo.length=0}}}function r(s){l(s(t))}function o(s,a=K){const c=[s,a];return n.add(c),n.size===1&&(i=e(l,r)||K),s(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:l,update:r,subscribe:o}}function Di(t,e,i){const n=!Array.isArray(t),l=n?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return zn(i,(o,s)=>{let a=!1;const c=[];let f=0,m=K;const h=()=>{if(f)return;m();const g=e(n?c[0]:c,o,s);r?o(g):m=Bn(g)?g:K},_=l.map((g,w)=>Jt(g,b=>{c[w]=b,f&=~(1<<w),a&&h()},()=>{f|=1<<w}));return a=!0,h(),function(){it(_),m(),a=!1}})}const cd="prod",Sr="1.1.36-dev.55db5eff.0",K1=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},G1=Symbol("storeContext"),Y1=Symbol("microStoresContext"),fd=(t,e)=>{cr(G1,t),cr(Y1,e)},yt=()=>{const t=Cr(G1);return vt(t,"Store context is empty!"),t},Zo=()=>{const t=Cr(Y1);return vt(t,"MicroStores context is empty!"),t},kt=(t,e)=>Q1(t,t.getValue(),e),Q1=(t,e,i)=>zn(e,n=>{const l=t.subscribe(r=>{n(r),i==null||i(r)});return()=>l.unsubscribe()}),dd=(t,e,i)=>{var n,l,r,o;const s=t.info,{width:a,height:c}=et(i.ui.playerSize),f=(l=(n=s.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&l!==void 0?l:0,m=(o=(r=s.rttEstimation$.getValue())===null||r===void 0?void 0:r.toFixed(0))!==null&&o!==void 0?o:0,h=s.isAutoQualityEnabled$.getValue()?"auto":"manual",_=`${Sr} (core: ${k0}, stat: ${H0}, shared: ${S0})`,g=et(i.state.errorLog$),w=g.length?`
|
|
6
|
+
var _0=Object.defineProperty;var w0=(t,e,i)=>e in t?_0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var zl=(t,e,i)=>(w0(t,typeof e!="symbol"?e+"":e,i),i);import{VERSION as k0,ChromecastState as Fn,PlaybackState as Kt,VideoQuality as Co,Player as y0,VideoFormat as Oo}from"@vkontakte/videoplayer-core/es2018.esm.js";import{VideoFormat as x6,VideoQuality as $6}from"@vkontakte/videoplayer-core/es2018.esm.js";import{InterfaceLanguage as Uo,VideoQuality as gl,fillWithDefault as C0,VERSION as S0,assertNonNullable as vt,safeStorage as Rn,isNullable as kl,Subscription as no,isNonNullable as Vn,isMacLike as $r,debounceFn as P0,ValueSubject as _r,getCurrentBrowser as wr,CurrentClientBrowser as B1,noop as Ge,checkNever as T0,timeCodeToString as E0,Subject as Cn,addScript as I0,Logger as R1,merge as A0,Observable as L0,map as M0,loadVKLangPack as V0,isIOS as kr,getHighestQuality as B0,throttleFn as Pl,CurrentClientDevice as R0,getIOSVersion as N0,detectEmbed as O0,observeElementSize as D0,isMobile as z0,cloneDeepWith as F0}from"@vkontakte/videoplayer-shared/es2018.esm.js";import{InterfaceLanguage as t8,VKNumericLanguage as i8,loadVKLangPack as n8}from"@vkontakte/videoplayer-shared/es2018.esm.js";import{VERSION as H0,SeekAction as qt,OneStat as U0,InteractiveInterfaceClick as Do}from"@vkontakte/videoplayer-statistics/es2018.esm.js";import"@vkontakte/videoplayer-interactive/es2018.esm.js";function K(){}function N1(t,e){for(const i in e)t[i]=e[i];return t}function O1(t){return t()}function es(){return Object.create(null)}function it(t){t.forEach(O1)}function Bn(t){return typeof t=="function"}function ge(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ol;function ts(t,e){return ol||(ol=document.createElement("a")),ol.href=e,t===ol.href}function q0(t){return Object.keys(t).length===0}function Jt(t,...e){if(t==null){for(const n of e)n(void 0);return K}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function et(t){let e;return Jt(t,i=>e=i)(),e}function D(t,e,i){t.$$.on_destroy.push(Jt(e,i))}function Kn(t,e,i,n){if(t){const l=D1(t,e,i,n);return t[0](l)}}function D1(t,e,i,n){return t[1]&&n?N1(i.ctx.slice(),t[1](n(e))):i.ctx}function Gn(t,e,i,n){if(t[2]&&n){const l=t[2](n(i));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],o=Math.max(e.dirty.length,l.length);for(let s=0;s<o;s+=1)r[s]=e.dirty[s]|l[s];return r}return e.dirty|l}return e.dirty}function Yn(t,e,i,n,l,r){if(l){const o=D1(e,i,n,r);t.p(o,l)}}function Qn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function j0(t){return t==null?"":t}const Tl=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function p(t,e){t.appendChild(e)}function We(t,e,i){const n=W0(t);if(!n.getElementById(e)){const l=T("style");l.id=e,l.textContent=i,Z0(n,l)}}function W0(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Z0(t,e){return p(t.head||t,e),e.sheet}function P(t,e,i){t.insertBefore(e,i||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function Nn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function T(t){return document.createElement(t)}function R(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function De(t){return document.createTextNode(t)}function O(){return De(" ")}function dt(){return De("")}function he(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function $t(t){return function(e){return e.preventDefault(),t.call(this,e)}}function rt(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function u(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function K0(t){return Array.from(t.childNodes)}function $e(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ft(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let ll;function G0(){if(ll===void 0){ll=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){ll=!0}}return ll}function yr(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=T("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const l=G0();let r;return l?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=he(window,"message",o=>{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{r=he(n.contentWindow,"resize",e),e()}),p(t,n),()=>{(l||r&&n.contentWindow)&&r(),S(n)}}function B(t,e,i){t.classList.toggle(e,!!i)}function Hn(t,e){return new t(e)}let Fo;function zo(t){Fo=t}function qo(){if(!Fo)throw new Error("Function called outside component initialization");return Fo}function bn(t){qo().$$.on_mount.push(t)}function El(t){qo().$$.on_destroy.push(t)}function cr(t,e){return qo().$$.context.set(t,e),e}function Cr(t){return qo().$$.context.get(t)}function z1(){return qo().$$.context}function Ao(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const So=[],ye=[];let Eo=[];const fr=[],F1=Promise.resolve();let dr=!1;function H1(){dr||(dr=!0,F1.then(U1))}function jo(){return H1(),F1}function Lo(t){Eo.push(t)}function qe(t){fr.push(t)}const Fl=new Set;let go=0;function U1(){if(go!==0)return;const t=Fo;do{try{for(;go<So.length;){const e=So[go];go++,zo(e),Y0(e.$$)}}catch(e){throw So.length=0,go=0,e}for(zo(null),So.length=0,go=0;ye.length;)ye.pop()();for(let e=0;e<Eo.length;e+=1){const i=Eo[e];Fl.has(i)||(Fl.add(i),i())}Eo.length=0}while(So.length);for(;fr.length;)fr.pop()();dr=!1,Fl.clear(),zo(t)}function Y0(t){if(t.fragment!==null){t.update(),it(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Lo)}}function Q0(t){const e=[],i=[];Eo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Eo=e}const bl=new Set;let uo;function fe(){uo={r:0,c:[],p:uo}}function de(){uo.r||it(uo.c),uo=uo.p}function d(t,e){t&&t.i&&(bl.delete(t),t.i(e))}function v(t,e,i,n){if(t&&t.o){if(bl.has(t))return;bl.add(t),uo.c.push(()=>{bl.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Gt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function X0(t,e){const i={},n={},l={$$scope:1};let r=t.length;for(;r--;){const o=t[r],s=e[r];if(s){for(const a in o)a in s||(n[a]=1);for(const a in s)l[a]||(i[a]=s[a],l[a]=1);t[r]=s}else for(const a in o)l[a]=1}for(const o in n)o in i||(i[o]=void 0);return i}function J0(t){return typeof t=="object"&&t!==null?t:{}}function je(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function q(t){t&&t.c()}function F(t,e,i){const{fragment:n,after_update:l}=t.$$;n&&n.m(e,i),Lo(()=>{const r=t.$$.on_mount.map(O1).filter(Bn);t.$$.on_destroy?t.$$.on_destroy.push(...r):it(r),t.$$.on_mount=[]}),l.forEach(Lo)}function H(t,e){const i=t.$$;i.fragment!==null&&(Q0(i.after_update),it(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function x0(t,e){t.$$.dirty[0]===-1&&(So.push(t),H1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function _e(t,e,i,n,l,r,o,s=[-1]){const a=Fo;zo(t);const c=t.$$={fragment:null,ctx:[],props:r,update:K,not_equal:l,bound:es(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:es(),dirty:s,skip_bound:!1,root:e.target||a.$$.root};o&&o(c.root);let f=!1;if(c.ctx=i?i(t,e.props||{},(m,h,..._)=>{const g=_.length?_[0]:h;return c.ctx&&l(c.ctx[m],c.ctx[m]=g)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](g),f&&x0(t,m)),h}):[],c.update(),f=!0,it(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const m=K0(e.target);c.fragment&&c.fragment.l(m),m.forEach(S)}else c.fragment&&c.fragment.c();e.intro&&d(t.$$.fragment),F(t,e.target,e.anchor),U1()}zo(a)}class we{constructor(){zl(this,"$$");zl(this,"$$set")}$destroy(){H(this,1),this.$destroy=K}$on(e,i){if(!Bn(i))return K;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const l=n.indexOf(i);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!q0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($0);var Mo;(function(t){t.VK="vk",t.VK_VIDEO="vk_video"})(Mo||(Mo={}));const ed={isMobile:void 0,defaultLanguage:Uo.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:Mo.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:gl.Q_480P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,additionalButtons:!0,contextMenuButton:!0},controls:{hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,slot:void 0,preview:void 0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},td=t=>C0(t,ed),id=t=>cr("ui-config",t),_n=()=>Cr("ui-config"),mr="vk_player_debug_panel_opened",q1=300,nd=100,od="videoplayer",ld="videoplayer";var Ee;(function(t){t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Comma="Comma",t.Period="Period",t.Space="Space",t.KeyM="KeyM",t.KeyF="KeyF",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyJ="KeyJ",t.KeyC="KeyC",t.KeyI="KeyI",t.Digit1="Digit1",t.Digit2="Digit2",t.Digit3="Digit3",t.Digit4="Digit4",t.Digit5="Digit5",t.Digit6="Digit6",t.Digit7="Digit7",t.Digit8="Digit8",t.Digit9="Digit9",t.Digit0="Digit0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Numpad0="Numpad0",t.ShiftLeft="ShiftLeft",t.ShiftRight="ShiftRight",t.Slash="Slash",t.Tab="Tab",t.Escape="Escape",t.Enter="Enter"})(Ee||(Ee={}));const Wo={[Ee.KeyF]:"f",[Ee.KeyK]:"k",[Ee.KeyC]:"c",[Ee.KeyM]:"m"},rd=new Set([Ee.ArrowLeft,Ee.ArrowRight,Ee.KeyL,Ee.KeyJ]),sd=new Set([Ee.Tab,Ee.Space,Ee.ArrowLeft,Ee.ArrowRight,Ee.ArrowUp,Ee.ArrowDown]),ad=new Set([Ee.ShiftRight,Ee.ShiftLeft]);var ft;(function(t){t.PLAY_BUTTON="PLAY_BUTTON",t.REPLAY_BUTTON="REPLAY_BUTTON",t.NEXT_BUTTON="NEXT_BUTTON",t.PREV_BUTTON="PREV_BUTTON",t.PICTURE_IN_PICTURE="PICTURE_IN_PICTURE",t.FULLSCREEN_BUTTON="FULLSCREEN_BUTTON",t.SETTINGS_BUTTON="SETTINGS_BUTTON",t.LIVE_BUTTON="LIVE_BUTTON",t.GRAPH_BUTTON="GRAPH_BUTTON",t.PLAY_PREV_CHAPTER_BUTTON="PLAY_PREV_CHAPTER_BUTTON",t.SEEK_TO_INTERACTIVE_BUTTON="SEEK_TO_INTERACTIVE_BUTTON",t.TIMELINE="TIMELINE",t.VOLUME_BAR="VOLUME_BAR",t.MUTE_BUTTON="MUTE_BUTTON",t.SUBTITLES_BUTTON="SUBTITLES_BUTTON",t.CHROMECAST_BUTTON="CHROMECAST_BUTTON",t.VK_BUTTON="VK_BUTTON",t.EPISODE_BUTTON="EPISODE_BUTTON",t.INCREMENT_PLAYBACK_RATE="INCREMENT_PLAYBACK_RATE",t.DECREMENT_PLAYBACK_RATE="DECREMENT_PLAYBACK_RATE"})(ft||(ft={}));const is=40,j1=260,ud=60,rl=8,W1=[ft.TIMELINE],_l=[...W1,ft.GRAPH_BUTTON],ns=[...W1,ft.PLAY_BUTTON],Z1=[..._l,ft.PLAY_BUTTON];var Po;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(Po||(Po={}));var Mt;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(Mt||(Mt={}));const Vo={[Mt.XS]:0,[Mt.S]:1,[Mt.M]:2,[Mt.L]:3,[Mt.XL]:4},bo=[];function zn(t,e){return{subscribe:Be(t,e).subscribe}}function Be(t,e=K){let i;const n=new Set;function l(s){if(ge(t,s)&&(t=s,i)){const a=!bo.length;for(const c of n)c[1](),bo.push(c,t);if(a){for(let c=0;c<bo.length;c+=2)bo[c][0](bo[c+1]);bo.length=0}}}function r(s){l(s(t))}function o(s,a=K){const c=[s,a];return n.add(c),n.size===1&&(i=e(l,r)||K),s(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:l,update:r,subscribe:o}}function Di(t,e,i){const n=!Array.isArray(t),l=n?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return zn(i,(o,s)=>{let a=!1;const c=[];let f=0,m=K;const h=()=>{if(f)return;m();const g=e(n?c[0]:c,o,s);r?o(g):m=Bn(g)?g:K},_=l.map((g,w)=>Jt(g,b=>{c[w]=b,f&=~(1<<w),a&&h()},()=>{f|=1<<w}));return a=!0,h(),function(){it(_),m(),a=!1}})}const cd="prod",Sr="1.1.36-dev.cdb7114a.0",K1=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},G1=Symbol("storeContext"),Y1=Symbol("microStoresContext"),fd=(t,e)=>{cr(G1,t),cr(Y1,e)},yt=()=>{const t=Cr(G1);return vt(t,"Store context is empty!"),t},Zo=()=>{const t=Cr(Y1);return vt(t,"MicroStores context is empty!"),t},kt=(t,e)=>Q1(t,t.getValue(),e),Q1=(t,e,i)=>zn(e,n=>{const l=t.subscribe(r=>{n(r),i==null||i(r)});return()=>l.unsubscribe()}),dd=(t,e,i)=>{var n,l,r,o;const s=t.info,{width:a,height:c}=et(i.ui.playerSize),f=(l=(n=s.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&l!==void 0?l:0,m=(o=(r=s.rttEstimation$.getValue())===null||r===void 0?void 0:r.toFixed(0))!==null&&o!==void 0?o:0,h=s.isAutoQualityEnabled$.getValue()?"auto":"manual",_=`${Sr} (core: ${k0}, stat: ${H0}, shared: ${S0})`,g=et(i.state.errorLog$),w=g.length?`
|
|
7
7
|
`+g.map((k,y)=>{var V;const j=`${y}) Type: ${k.id}
|
|
8
8
|
`,A=`Message: ${k.message} (${k.thrown})
|
|
9
9
|
`,z=`Trace: ${(V=k.thrown)===null||V===void 0?void 0:V.stack}
|
|
@@ -48,4 +48,4 @@ var _0=Object.defineProperty;var w0=(t,e,i)=>e in t?_0(t,e,{enumerable:!0,config
|
|
|
48
48
|
rgba(0, 0, 0, 0.99) 93.33%,
|
|
49
49
|
#000 100%
|
|
50
50
|
);--timeline-preview-shadow:rgba(0, 0, 0, 0.08);--timeline-preview-bg:rgba(34, 34, 34, 1);--mobile-settings-bg:#2C2D2E;--button-hover-transition:opacity 0.2s;--video-container-z-index:0;--rotate-transition-duration:0.25s;position:relative;width:100%;height:100%;color:var(--white);font-size:12px;line-height:normal;overflow:hidden;outline:0;user-select:none;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;background:var(--black)}button{border:none;margin:0;padding:0;width:auto;overflow:visible;background:transparent;color:inherit;font:inherit;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;cursor:pointer}svg:not(.interactiveContainer svg){pointer-events:none}*:focus, *:focus-visible{outline:none}*:focus-visible{box-shadow:var(--focused-element-shadow)}.hidden{visibility:hidden;opacity:0}.overlay-container{pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:10000}.out-of-view{position:absolute !important;left:-1000vh !important}`)}function s6(t){let e,i,n;function l(o){t[56](o)}let r={store:t[0],uiConfig:t[35],title:t[1],thumbUrl:t[2],videoLogoUrl:t[3],interactiveContainer:t[4],live:t[5],autoplay:t[6],canRewindLive:t[7],showAds:t[8],adsSlotId:t[9],adsParams:t[10],adsPreviewParam:t[11],duration:t[12],logoClickable:t[13],logoHidden:t[14],showNextPrevButtons:t[16],nextButtonActive:t[17],prevButtonActive:t[18],endScreenVideoTitle:t[19],endScreenVideoThumb:t[20],isOneVideoPlaylist:t[21],supportLink:t[22],outerContainerRef:t[23],fullScreenTarget:t[24],showMiniTimer:t[25],playerStarted:t[34],playNextVideo:t[26],playPrevVideo:t[27],repeatPlaylist:t[28],seekToInteractive:t[29],toggleGraph:t[30],playPrevChapter:t[31],firstStart:t[36]};return t[33]!==void 0&&(r.videoContainer=t[33]),e=new Y_({props:r}),ye.push(()=>je(e,"videoContainer",l)),{c(){q(e.$$.fragment)},m(o,s){F(e,o,s),n=!0},p(o,s){const a={};s[0]&1&&(a.store=o[0]),s[0]&2&&(a.title=o[1]),s[0]&4&&(a.thumbUrl=o[2]),s[0]&8&&(a.videoLogoUrl=o[3]),s[0]&16&&(a.interactiveContainer=o[4]),s[0]&32&&(a.live=o[5]),s[0]&64&&(a.autoplay=o[6]),s[0]&128&&(a.canRewindLive=o[7]),s[0]&256&&(a.showAds=o[8]),s[0]&512&&(a.adsSlotId=o[9]),s[0]&1024&&(a.adsParams=o[10]),s[0]&2048&&(a.adsPreviewParam=o[11]),s[0]&4096&&(a.duration=o[12]),s[0]&8192&&(a.logoClickable=o[13]),s[0]&16384&&(a.logoHidden=o[14]),s[0]&65536&&(a.showNextPrevButtons=o[16]),s[0]&131072&&(a.nextButtonActive=o[17]),s[0]&262144&&(a.prevButtonActive=o[18]),s[0]&524288&&(a.endScreenVideoTitle=o[19]),s[0]&1048576&&(a.endScreenVideoThumb=o[20]),s[0]&2097152&&(a.isOneVideoPlaylist=o[21]),s[0]&4194304&&(a.supportLink=o[22]),s[0]&8388608&&(a.outerContainerRef=o[23]),s[0]&16777216&&(a.fullScreenTarget=o[24]),s[0]&33554432&&(a.showMiniTimer=o[25]),s[1]&8&&(a.playerStarted=o[34]),s[0]&67108864&&(a.playNextVideo=o[26]),s[0]&134217728&&(a.playPrevVideo=o[27]),s[0]&268435456&&(a.repeatPlaylist=o[28]),s[0]&536870912&&(a.seekToInteractive=o[29]),s[0]&1073741824&&(a.toggleGraph=o[30]),s[1]&1&&(a.playPrevChapter=o[31]),!i&&s[1]&4&&(i=!0,a.videoContainer=o[33],qe(()=>i=!1)),e.$set(a)},i(o){n||(d(e.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),n=!1},d(o){H(e,o)}}}function a6(t){let e,i,n;function l(o){t[55](o)}let r={store:t[0],uiConfig:t[35],thumbUrl:t[2],videoLogoUrl:t[3],interactiveContainer:t[4],live:t[5],autoplay:t[6],canRewindLive:t[7],showAds:t[8],adsSlotId:t[9],adsParams:t[10],adsPreviewParam:t[11],duration:t[12],logoClickable:t[13],logoHidden:t[14],showNextPrevButtons:t[16],nextButtonActive:t[17],prevButtonActive:t[18],endScreenVideoTitle:t[19],endScreenVideoThumb:t[20],isOneVideoPlaylist:t[21],supportLink:t[22],outerContainerRef:t[23],fullScreenTarget:t[24],showMiniTimer:t[25],playerStarted:t[34],playNextVideo:t[26],playPrevVideo:t[27],repeatPlaylist:t[28],seekToInteractive:t[29],toggleGraph:t[30],playPrevChapter:t[31],firstStart:t[36],seekTime:t[32]};return t[33]!==void 0&&(r.videoContainer=t[33]),e=new l6({props:r}),ye.push(()=>je(e,"videoContainer",l)),{c(){q(e.$$.fragment)},m(o,s){F(e,o,s),n=!0},p(o,s){const a={};s[0]&1&&(a.store=o[0]),s[0]&4&&(a.thumbUrl=o[2]),s[0]&8&&(a.videoLogoUrl=o[3]),s[0]&16&&(a.interactiveContainer=o[4]),s[0]&32&&(a.live=o[5]),s[0]&64&&(a.autoplay=o[6]),s[0]&128&&(a.canRewindLive=o[7]),s[0]&256&&(a.showAds=o[8]),s[0]&512&&(a.adsSlotId=o[9]),s[0]&1024&&(a.adsParams=o[10]),s[0]&2048&&(a.adsPreviewParam=o[11]),s[0]&4096&&(a.duration=o[12]),s[0]&8192&&(a.logoClickable=o[13]),s[0]&16384&&(a.logoHidden=o[14]),s[0]&65536&&(a.showNextPrevButtons=o[16]),s[0]&131072&&(a.nextButtonActive=o[17]),s[0]&262144&&(a.prevButtonActive=o[18]),s[0]&524288&&(a.endScreenVideoTitle=o[19]),s[0]&1048576&&(a.endScreenVideoThumb=o[20]),s[0]&2097152&&(a.isOneVideoPlaylist=o[21]),s[0]&4194304&&(a.supportLink=o[22]),s[0]&8388608&&(a.outerContainerRef=o[23]),s[0]&16777216&&(a.fullScreenTarget=o[24]),s[0]&33554432&&(a.showMiniTimer=o[25]),s[1]&8&&(a.playerStarted=o[34]),s[0]&67108864&&(a.playNextVideo=o[26]),s[0]&134217728&&(a.playPrevVideo=o[27]),s[0]&268435456&&(a.repeatPlaylist=o[28]),s[0]&536870912&&(a.seekToInteractive=o[29]),s[0]&1073741824&&(a.toggleGraph=o[30]),s[1]&1&&(a.playPrevChapter=o[31]),!i&&s[1]&4&&(i=!0,a.videoContainer=o[33],qe(()=>i=!1)),e.$set(a)},i(o){n||(d(e.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),n=!1},d(o){H(e,o)}}}function u6(t){let e,i,n,l;const r=[a6,s6],o=[];function s(a,c){return a[15]?0:1}return i=s(t),n=o[i]=r[i](t),{c(){e=T("div"),n.c(),u(e,"class","root v-cghoty")},m(a,c){P(a,e,c),o[i].m(e,null),l=!0},p(a,c){let f=i;i=s(a),i===f?o[i].p(a,c):(fe(),v(o[f],1,1,()=>{o[f]=null}),de(),n=o[i],n?n.p(a,c):(n=o[i]=r[i](a),n.c()),d(n,1),n.m(e,null))},i(a){l||(d(n),l=!0)},o(a){v(n),l=!1},d(a){a&&S(e),o[i].d()}}}function c6(t,e,i){let{sources:n}=e,{store:l}=e,{microStoresRoot:r}=e,{uiConfig:o}=e,{title:s}=e,{thumbUrl:a}=e,{videoLogoUrl:c}=e,{interactiveContainer:f}=e,{subtitles:m}=e,{live:h}=e,{preload:_}=e,{autoplay:g}=e,{volume:w=void 0}=e,{muted:b=void 0}=e,{fromTime:C}=e,{canRewindLive:k}=e,{showAds:y}=e,{adsSlotId:V=void 0}=e,{adsParams:j=void 0}=e,{adsPreviewParam:A=void 0}=e,{duration:z=void 0}=e,{logoClickable:se}=e,{logoHidden:re}=e,{isMobile:N}=e,{showNextPrevButtons:te=!1}=e,{nextButtonActive:X=!1}=e,{prevButtonActive:G=!1}=e,{endScreenVideoTitle:I=void 0}=e,{endScreenVideoThumb:M=void 0}=e,{isOneVideoPlaylist:x=!1}=e,{supportLink:L}=e,{outerContainerRef:ie=void 0}=e,{fullScreenTarget:Te=void 0}=e,{failoverHosts:ke=void 0}=e,{showMiniTimer:Ae=!1}=e,{playNextVideo:Le=Ge}=e,{playPrevVideo:be=Ge}=e,{repeatPlaylist:Ce=Ge}=e,{seekToInteractive:W=Ge}=e,{toggleGraph:$=Ge}=e,{playPrevChapter:ce=Ge}=e;const{subscribers:ae,stores:ze}=r;id(o);const Ne=_n(),Me=l.ui.debugPanelVisible,Ie=l.ui.playerSize;let ue,pe=null,le=!1;l.getAdmanWrapper().init({switchFromAdsToVideo:l.actions.internal.switchFromAdsToVideo,switchFromVideoToAds:l.actions.internal.switchFromVideoToAds,setMuted:l.actions.external.setMuted},l.ads,{isMobile:l.ui.isMobile,mobileUnmuteButtonVisible:l.ui.mobileUnmuteButtonVisible,vsid:l.vsid}),fd(l,ze);const Pe=(ne=!1)=>{i(34,le=!0),ne?l.actions.external.firstStart(y):l.actions.internal.firstStart(y)};function me(ne){var Je;const _t=n||ne;_t&&l.initVideo({container:ue,sources:_t,failoverHosts:ke,subtitles:m});const lt=Rn.get(mr)==="true";Me.set(lt),C>0&&l.actions.external.seekTime(C);const Nt=N?Ne.volumeDefault:(Je=w!=null?w:ec())!=null?Je:Ne.volumeDefault,at=b!=null?b:gd();if(l.actions.external.setVolume(Nt),l.actions.external.setMuted(at),l.getAdmanWrapper().setInitialVolume(at?0:Nt),Ne.features.trafficSaving){const He=_d();He&&l.actions.internal.setTrafficSavingEnabled(He)}const It=vd(l.videoId);It&&l.actions.internal.setQuality(It),l.ui.isAutoplay.set(g),g?Pe():_&&Ne.features.preload&&l.actions.internal.preload()}const Se=ne=>{if(window.ResizeObserver){let _t,lt;pe=new ResizeObserver(Pl(Nt=>{const at=Nt[0];if(at){if(at.contentBoxSize){const It=Array.isArray(at.contentBoxSize)?at.contentBoxSize[0]:at.contentBoxSize;_t=It.inlineSize,lt=It.blockSize}else at.contentRect&&(_t=at.contentRect.width,lt=at.contentRect.height);Ie.set({width:_t,height:lt})}},q1)),pe.observe(ne)}Ie.set({width:ne.clientWidth,height:ne.clientHeight})};bn(()=>{Se(ue);const ne=ae.map(lt=>lt.init(l,ze));if((h==null?void 0:h.status)==="upcoming"||(h==null?void 0:h.status)==="waiting"){l.actions.internal.setWaitingLive(!0);return}if(((h==null?void 0:h.status)==="finished"||(h==null?void 0:h.status)==="postlive")&&!Object.keys(n||[]).length){l.actions.internal.setWaitingRecord(!0);return}return me(),()=>{pe==null||pe.disconnect(),ne.forEach(lt=>lt.unsubscribe()),l.destroy()}});function Ze(){le?l.actions.external.play():Pe(!0)}function Re(){l.actions.external.pause()}function xe(ne){N||l.actions.external.setMuted(ne)}function Xe(ne){N||ne>=0&&ne<=1&&l.actions.external.setVolume(ne)}function nt(ne){l.actions.internal.seekTime(ne,qt.UNKNOWN)}function st(ne){l.actions.external.seekEpisodeStartTime(ne)}function Et(){l.actions.external.returnFocusToEpisodes()}function mt(ne){l.actions.external.setPlaybackRate(ne)}function ei(ne){l.actions.external.setAutoQualityLimits(ne)}function gt(ne){ue=ne,i(33,ue)}function Vt(ne){ue=ne,i(33,ue)}return t.$$set=ne=>{"sources"in ne&&i(37,n=ne.sources),"store"in ne&&i(0,l=ne.store),"microStoresRoot"in ne&&i(38,r=ne.microStoresRoot),"uiConfig"in ne&&i(39,o=ne.uiConfig),"title"in ne&&i(1,s=ne.title),"thumbUrl"in ne&&i(2,a=ne.thumbUrl),"videoLogoUrl"in ne&&i(3,c=ne.videoLogoUrl),"interactiveContainer"in ne&&i(4,f=ne.interactiveContainer),"subtitles"in ne&&i(40,m=ne.subtitles),"live"in ne&&i(5,h=ne.live),"preload"in ne&&i(41,_=ne.preload),"autoplay"in ne&&i(6,g=ne.autoplay),"volume"in ne&&i(42,w=ne.volume),"muted"in ne&&i(43,b=ne.muted),"fromTime"in ne&&i(44,C=ne.fromTime),"canRewindLive"in ne&&i(7,k=ne.canRewindLive),"showAds"in ne&&i(8,y=ne.showAds),"adsSlotId"in ne&&i(9,V=ne.adsSlotId),"adsParams"in ne&&i(10,j=ne.adsParams),"adsPreviewParam"in ne&&i(11,A=ne.adsPreviewParam),"duration"in ne&&i(12,z=ne.duration),"logoClickable"in ne&&i(13,se=ne.logoClickable),"logoHidden"in ne&&i(14,re=ne.logoHidden),"isMobile"in ne&&i(15,N=ne.isMobile),"showNextPrevButtons"in ne&&i(16,te=ne.showNextPrevButtons),"nextButtonActive"in ne&&i(17,X=ne.nextButtonActive),"prevButtonActive"in ne&&i(18,G=ne.prevButtonActive),"endScreenVideoTitle"in ne&&i(19,I=ne.endScreenVideoTitle),"endScreenVideoThumb"in ne&&i(20,M=ne.endScreenVideoThumb),"isOneVideoPlaylist"in ne&&i(21,x=ne.isOneVideoPlaylist),"supportLink"in ne&&i(22,L=ne.supportLink),"outerContainerRef"in ne&&i(23,ie=ne.outerContainerRef),"fullScreenTarget"in ne&&i(24,Te=ne.fullScreenTarget),"failoverHosts"in ne&&i(45,ke=ne.failoverHosts),"showMiniTimer"in ne&&i(25,Ae=ne.showMiniTimer),"playNextVideo"in ne&&i(26,Le=ne.playNextVideo),"playPrevVideo"in ne&&i(27,be=ne.playPrevVideo),"repeatPlaylist"in ne&&i(28,Ce=ne.repeatPlaylist),"seekToInteractive"in ne&&i(29,W=ne.seekToInteractive),"toggleGraph"in ne&&i(30,$=ne.toggleGraph),"playPrevChapter"in ne&&i(31,ce=ne.playPrevChapter)},t.$$.update=()=>{t.$$.dirty[0]&32769&&l.ui.isMobile.set(N)},[l,s,a,c,f,h,g,k,y,V,j,A,z,se,re,N,te,X,G,I,M,x,L,ie,Te,Ae,Le,be,Ce,W,$,ce,nt,ue,le,Ne,Pe,n,r,o,m,_,w,b,C,ke,me,Ze,Re,xe,Xe,st,Et,mt,ei,gt,Vt]}class f6 extends we{constructor(e){super(),_e(this,e,c6,u6,ge,{sources:37,store:0,microStoresRoot:38,uiConfig:39,title:1,thumbUrl:2,videoLogoUrl:3,interactiveContainer:4,subtitles:40,live:5,preload:41,autoplay:6,volume:42,muted:43,fromTime:44,canRewindLive:7,showAds:8,adsSlotId:9,adsParams:10,adsPreviewParam:11,duration:12,logoClickable:13,logoHidden:14,isMobile:15,showNextPrevButtons:16,nextButtonActive:17,prevButtonActive:18,endScreenVideoTitle:19,endScreenVideoThumb:20,isOneVideoPlaylist:21,supportLink:22,outerContainerRef:23,fullScreenTarget:24,failoverHosts:45,showMiniTimer:25,playNextVideo:26,playPrevVideo:27,repeatPlaylist:28,seekToInteractive:29,toggleGraph:30,playPrevChapter:31,initVideo:46,play:47,pause:48,setMuted:49,setVolume:50,seekTime:32,seekEpisodeStartTime:51,returnFocusToEpisodes:52,setPlaybackRate:53,setAutoQualityLimits:54},r6,[-1,-1,-1])}get initVideo(){return this.$$.ctx[46]}get play(){return this.$$.ctx[47]}get pause(){return this.$$.ctx[48]}get setMuted(){return this.$$.ctx[49]}get setVolume(){return this.$$.ctx[50]}get seekTime(){return this.$$.ctx[32]}get seekEpisodeStartTime(){return this.$$.ctx[51]}get returnFocusToEpisodes(){return this.$$.ctx[52]}get setPlaybackRate(){return this.$$.ctx[53]}get setAutoQualityLimits(){return this.$$.ctx[54]}}function d6(t){let e,i;return{c(){e=R("svg"),i=R("path"),u(i,"fill",t[0]),u(i,"d","M38.245 6c3.566 0 4.859.371 6.162 1.069a7.27 7.27 0 0 1 3.025 3.024c.697 1.303 1.068 2.597 1.068 6.163v23.489c0 3.566-.371 4.859-1.069 6.162a7.27 7.27 0 0 1-3.024 3.025C43.104 49.629 41.811 50 38.245 50h-19.49c-3.565 0-4.859-.371-6.162-1.069a7.27 7.27 0 0 1-3.024-3.024C8.87 44.604 8.5 43.311 8.5 39.745v-23.49c0-3.565.371-4.859 1.069-6.162a7.27 7.27 0 0 1 3.024-3.024C13.896 6.37 15.19 6 18.756 6h19.489zm.314 3H18.756c-2.799 0-3.761.186-4.749.714a4.27 4.27 0 0 0-1.793 1.793c-.508.95-.7 1.876-.713 4.434L11.5 39.744c0 2.799.186 3.761.714 4.749a4.27 4.27 0 0 0 1.793 1.793c.988.528 1.95.714 4.749.714h19.489c2.798 0 3.76-.186 4.748-.714a4.27 4.27 0 0 0 1.793-1.793c.528-.988.714-1.95.714-4.748v-23.49c0-2.798-.186-3.76-.714-4.748a4.27 4.27 0 0 0-1.793-1.793c-.95-.508-1.876-.7-4.434-.713zM19.22 38c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436z"),u(e,"width","57"),u(e,"height","60"),u(e,"fill","none"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"aria-hidden","true"),u(e,"data-testid","stub-icon")},m(n,l){P(n,e,l),p(e,i)},p(n,[l]){l&1&&u(i,"fill",n[0])},i:K,o:K,d(n){n&&S(e)}}}function m6(t,e,i){let{isWhite:n=!1}=e,l;return t.$$set=r=>{"isWhite"in r&&i(1,n=r.isWhite)},t.$$.update=()=>{t.$$.dirty&2&&i(0,l=n?"#fff":"#909499")},[l,n]}class p6 extends we{constructor(e){super(),_e(this,e,m6,d6,ge,{isWhite:1})}}function h6(t){We(t,"v-1y9fytq",".playerStub.v-1y9fytq{width:100%;height:100%;background-color:#222;display:flex;justify-content:center;align-items:center;position:relative;background-position:center;background-size:cover;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif}.title.v-1y9fytq{position:absolute;left:0;top:0;width:100%;font-size:15px;color:#fff;box-sizing:border-box;padding:18px 20px 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}")}function L1(t){let e,i;return{c(){e=T("div"),i=De(t[0]),u(e,"class","title v-1y9fytq")},m(n,l){P(n,e,l),p(e,i)},p(n,l){l&1&&$e(i,n[0])},d(n){n&&S(e)}}}function M1(t){let e,i;return e=new p6({props:{isWhite:!!t[1]}}),{c(){q(e.$$.fragment)},m(n,l){F(e,n,l),i=!0},p(n,l){const r={};l&2&&(r.isWhite=!!n[1]),e.$set(r)},i(n){i||(d(e.$$.fragment,n),i=!0)},o(n){v(e.$$.fragment,n),i=!1},d(n){H(e,n)}}}function v6(t){let e,i,n,l,r=t[0]&&L1(t),o=(!t[0]||!t[1])&&M1(t);return{c(){e=T("div"),r&&r.c(),i=O(),o&&o.c(),u(e,"class","playerStub v-1y9fytq"),u(e,"style",n=t[1]?`background-image: url('${t[1]}')`:"")},m(s,a){P(s,e,a),r&&r.m(e,null),p(e,i),o&&o.m(e,null),l=!0},p(s,[a]){s[0]?r?r.p(s,a):(r=L1(s),r.c(),r.m(e,i)):r&&(r.d(1),r=null),!s[0]||!s[1]?o?(o.p(s,a),a&3&&d(o,1)):(o=M1(s),o.c(),d(o,1),o.m(e,null)):o&&(fe(),v(o,1,1,()=>{o=null}),de()),(!l||a&2&&n!==(n=s[1]?`background-image: url('${s[1]}')`:""))&&u(e,"style",n)},i(s){l||(d(o),l=!0)},o(s){v(o),l=!1},d(s){s&&S(e),r&&r.d(),o&&o.d()}}}function g6(t,e,i){let{title:n}=e,{thumbUrl:l}=e;return t.$$set=r=>{"title"in r&&i(0,n=r.title),"thumbUrl"in r&&i(1,l=r.thumbUrl)},[n,l]}class b6 extends we{constructor(e){super(),_e(this,e,g6,v6,ge,{title:0,thumbUrl:1},h6)}}class _6{isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:n=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,artwork:[{src:n,sizes:"96x96",type:"image/png"},{src:n,sizes:"128x128",type:"image/png"},{src:n,sizes:"192x192",type:"image/png"},{src:n,sizes:"256x256",type:"image/png"},{src:n,sizes:"384x384",type:"image/png"},{src:n,sizes:"512x512",type:"image/png"}]}))}updateActionHandlers(e){this.resetActionHandlers(),this.setActionHandlers(e)}resetActionHandlers(){const e=[["play",null],["pause",null],["stop",null],["nexttrack",null],["previoustrack",null],["seekto",i=>null],["seekbackward",i=>null],["seekforward",i=>null]];this.setActionHandlers(e)}setActionHandlers(e){if(this.isSupported())for(const[i,n]of e)try{navigator.mediaSession.setActionHandler(i,n)}catch(l){throw new Error(`The media session action "${i}" is not supported yet.`)}}}function w6(t){let e,i,n,l;return{c(){e=R("svg"),i=R("g"),n=R("path"),l=R("path"),u(n,"d","m30.744 4 .744.005c2.981.046 4.526.385 6.127 1.24a8.766 8.766 0 0 1 3.475 3.347l.174.312.15.292c.772 1.553 1.066 3.18 1.085 6.251v9.045a1.5 1.5 0 0 1-3 .016l-.008-9.651c-.04-2.032-.228-3.12-.627-4.035l-.126-.27-.13-.252A5.77 5.77 0 0 0 36.2 7.891c-1.187-.635-2.339-.873-5.115-.89L22.255 7c-2.737 0-4.003.2-5.071.698l-.133.064-.251.13a5.77 5.77 0 0 0-2.409 2.408c-.635 1.187-.873 2.339-.89 5.114l-.001 20.83c0 2.738.2 4.004.698 5.072l.064.133.13.251a5.769 5.769 0 0 0 2.408 2.409c1.1.588 2.134.825 4.438.88l.323.006 3.695.005H26a1.5 1.5 0 0 1 0 3h-.756l-3.718-.005c-2.989-.047-4.526-.377-6.14-1.24a8.766 8.766 0 0 1-3.476-3.347l-.174-.312-.15-.292c-.731-1.472-1.036-3.016-1.08-5.803l-.006-.756v-20.49l.005-.743c.046-2.981.385-4.526 1.24-6.127a8.765 8.765 0 0 1 3.347-3.475l.312-.174.292-.15c1.472-.731 3.016-1.036 5.803-1.08L22.256 4h8.488Z"),u(l,"d","M30.5 33.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C32.78 29 33.62 29 35.3 29h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311c.327.642.327 1.482.327 3.162v13.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C44.22 52 43.38 52 41.7 52h-6.4c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C30.5 49.72 30.5 48.88 30.5 47.2V33.8Z"),u(i,"fill","#fff"),u(e,"width","57"),u(e,"height","56"),u(e,"fill","none"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"aria-label","dummy-image"),u(e,"data-testid","pip-dummy-icon")},m(r,o){P(r,e,o),p(e,i),p(i,n),p(i,l)},p:K,i:K,o:K,d(r){r&&S(e)}}}class k6 extends we{constructor(e){super(),_e(this,e,null,w6,ge,{})}}function y6(t){We(t,"v-1pbsod4",".player-pip-dummy.v-1pbsod4{width:100%;height:100%;background-color:#19191A;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif}.player-pip-dummy.is-pip-api.v-1pbsod4{position:relative}.dummy-image.v-1pbsod4 svg{transform:scale(1.07143)}.dummy-image.desktop.v-1pbsod4{transform:scale(1.07143) rotate(-90deg) rotateY(180deg)}.title.v-1pbsod4{font-size:16px;color:#fff;padding:18px 20px 10px;text-align:center}")}function C6(t){let e,i,n,l,r,o,s;return n=new k6({}),{c(){e=T("div"),i=T("div"),q(n.$$.fragment),l=O(),r=T("span"),o=De(t[0]),u(i,"class","dummy-image v-1pbsod4"),B(i,"desktop",!t[1]),u(r,"class","title v-1pbsod4"),u(e,"class","player-pip-dummy v-1pbsod4"),B(e,"is-pip-api",t[2])},m(a,c){P(a,e,c),p(e,i),F(n,i,null),p(e,l),p(e,r),p(r,o),s=!0},p(a,[c]){(!s||c&2)&&B(i,"desktop",!a[1]),(!s||c&1)&&$e(o,a[0])},i(a){s||(d(n.$$.fragment,a),s=!0)},o(a){v(n.$$.fragment,a),s=!1},d(a){a&&S(e),H(n)}}}function S6(t,e,i){let n,l;const r=yt(),o=!!r.webApi.pictureInPictureApi,s=r.interfaceLanguage$;D(t,s,f=>i(5,n=f));const a=r.ui.isMobile;D(t,a,f=>i(1,l=f));let c;return t.$$.update=()=>{t.$$.dirty&32&&i(0,c=n&&Y("pip_dummy_title"))},[c,l,o,s,a,n]}class P6 extends we{constructor(e){super(),_e(this,e,S6,C6,ge,{},y6)}}const T6=460,E6=280;class Wf{constructor(){this.info={isActive$:new _r(!1),type:Wn.DocumentPictureInPicture}}isSupported(){const e=wr().browser===B1.Yandex,{isEmbed:i}=O0();return"documentPictureInPicture"in window&&!e&&!i}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:T6,height:E6,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";const n=[...this.playerParentShadowRoot.styleSheets].map(s=>[...s.cssRules].map(a=>a.cssText).join(" ")).filter(Boolean).join(`
|
|
51
|
-
`),l=document.createElement("style");l.textContent=n;const r=this.createStretchedContainer(),o=r.attachShadow({mode:"open"});o.append(l),o.append(this.playerDomElement),this.playerDummyElement=new P6({target:this.playerParentShadowRoot,context:this.svelteContext}),(e=this.pipWindow)===null||e===void 0||e.document.body.append(r),this.info.isActive$.next(!0),(i=this.pipWindow)===null||i===void 0||i.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)===null||i===void 0||i.close(),e()})}async dispose(){await this.remove()}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function I6(t){return t instanceof Wf}class A6{static getLatestSupportedVersion(){const e=new Mr,i=new Wf;if(i.isSupported())return i;if(e.isSupported())return e}}function V1(t,e){var i,n;const l=new Set([...Object.keys(t),...Object.keys(e)]),r={};for(const o of l)r[o]=(n=(i=e[o])!==null&&i!==void 0?i:t[o])!==null&&n!==void 0?n:void 0;return r}const L6="Inner error. Unexpectedly root annotation container null reference exception",M6="Annotation with such name already exists",V6="Annotation with such name does not exist";class ur extends Error{constructor(e){super(e),this.name="AnnotationError"}}const B6="1",R6=100;class N6{constructor(e){this.annotations=new Map,this.subscriptions=new no,this.rootAnnotationsContainer=e;const i=Pl(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},R6);this.subscriptions.add(D0(this.rootAnnotationsContainer).subscribe(({width:n,height:l})=>{this.playerSize={width:n,height:l},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var n;if(!this.rootAnnotationsContainer)throw new ur(L6);if(this.annotations.has(e))throw new ur(M6);i.style.zIndex=(n=i.style.zIndex)!==null&&n!==void 0?n:B6,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){const i=this.annotations.get(e);if(!i)throw new ur(V6);return i}remove(e){const i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(const e in this.annotations.keys())this.remove(e)}destroy(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,n){const l=e.offsetTop,r=e.offsetLeft,o=e.offsetWidth,s=e.offsetHeight;return l<0||r<0||r+o>i||l+s>n}registryRootContainer(e){}addLayer(e){return new HTMLElement}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}}class qr{init(e,i){return vt(e),vt(i),this.subscription=new no,this.subscription}}class O6 extends qr{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$={...Be(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{isInteractiveExpectation$:l}=e.state;return n.add(l.subscribe(r=>{this.state$.set(r?!0:null)})),n}}class D6 extends qr{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$={...Be(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{fakeIsPlaying$:l}=i,{isInteractiveExpectation$:r,isPlaying$:o}=e.state,{controlsVisible:s,isMobile:a}=e.ui,c=et(a),f=()=>c&&et(s);return n.add(s.subscribe(m=>{if(!c)return;const h=et(l);et(o)?this.state$.set(m):h!==null&&this.state$.set(!h||m)})),n.add(o.subscribe(m=>{this.state$.set(!m||f())})),n.add(l.subscribe(m=>{if(m===null)return;const h=et(r);if(f()){this.state$.set(!0);return}h&&this.state$.set(!m)})),n}}class z6 extends qr{constructor(){super(...arguments),this.stateName="seekToInteractiveDisabledTooltip$",this.state$=Be("tooltip_chapter_without_interactive")}init(e,i){const n=super.init(e,i);return n.add(e.state.interactiveEpisodes$.subscribe(l=>{l.length&&(l.every(r=>r.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}}const F6=()=>[O6,D6,z6].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}}),H6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Uo.RU,logoClickable:!1,logoHidden:!1,isMobile:z0(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class U6 extends HTMLElement{constructor(){var e;super(),this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=!1,this.videoConfig=void 0,this.pictureInPictureApi=void 0,this.mediaSessionApi=void 0,this.unsubscribePlayerPhaseSubscription=void 0,this.annotationsApi=void 0,this.prevIsid=void 0,this.isInited=!1,this.logger=new R1,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new no,this.graphMadePause=!1,!((e=window==null?void 0:window.videoPlayerConfig)===null||e===void 0)&&e.debugLogs&&this.subscription.add(this.logger.log$.subscribe(i=>{console.log("%c player web component ","background:#77dd77;",`${i.component}`,i.message)}))}connectedCallback(){var e,i;if(this.isInited)return;this.initPlayerRootContainers();const n=(e=this.getAttribute("stub-title"))!==null&&e!==void 0?e:void 0,l=(i=this.getAttribute("stub-thumb-url"))!==null&&i!==void 0?i:void 0;this.svelteStubComponent=new b6({target:this.playerContainer,props:{title:n,thumbUrl:l}})}disconnectedCallback(){var e,i,n,l,r;(e=this.annotationsApi)===null||e===void 0||e.destroy(),(i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),(n=this.svelteStubComponent)===null||n===void 0||n.$destroy(),this.subscription.unsubscribe(),(l=this.unsubscribePlayerPhaseSubscription)===null||l===void 0||l.call(this),(r=this.interactiveController)===null||r===void 0||r.destroy()}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%";const e=document.createElement("div");e.style.position="absolute",e.className="shadow-root-container",e.style.width="100%",e.style.height="100%",this._shadowRoot=e.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(e),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var i;const n=(i=this.store)===null||i===void 0?void 0:i.ui.controls.disabledControls$;return(n==null?void 0:n.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};const e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createPlayer(e,i={},n){var l,r,o,s,a,c,f,m,h,_,g,w,b;if(!this.videoConfig)return;const{albumId:C,statPlace:k,statUserSalt:y,statAuthToken:V,statTrackCode:j,refreshStatAuthToken:A,preload:z,autoplay:se,volume:re,muted:N,fromTime:te,canRewindLive:X,supportLink:G,showAds:I,adsSlotId:M,adsParams:x={},adsPreviewParam:L,interfaceLanguage:ie,logoClickable:Te,logoHidden:ke,isMobile:Ae,isAudioDisabled:Le,isLiveCatchUpMode:be,fullScreenTarget:Ce,failoverHosts:W,canDownload:$,callbacks:ce,interactiveData:ae,showThumbTimer:ze,additionalButtons:Ne=[],repeat:Me}=V1(this.videoConfig,i),{sources:Ie,title:ue,thumbUrl:pe,videoLogoUrl:le,unitedVideoId:Pe,isClip:me=!1,duration:Se,adsParams:Ze={},videoEpisodes:Re,previewThumbsData:xe,subtitles:Xe,live:nt}=e,st={...x,...Ze},Et=this.getNextVideoInfo(),mt={sources:Ie,title:ue,thumbUrl:pe,subtitles:Xe,unitedVideoId:Pe,isClip:me,live:nt,albumId:C,statPlace:k,autoplay:se,muted:N,volume:re,fromTime:te,canRewindLive:X,showAds:I,adsSlotId:M,adsParams:st,adsPreviewParam:L,duration:Se,logoClickable:Te,logoHidden:ke,isMobile:Ae,repeat:Me,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Et.nextVideoTitle,endScreenVideoThumb:Et.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},ei={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(mt)}`});const gt=this.uiConfig.features.statistics&&!!Pe,{pid:Vt}=((r=(l=this.videoConfig)===null||l===void 0?void 0:l.interactiveData)===null||r===void 0?void 0:r.projectInfo)||{};gt&&(this.statistics=new Pg({movieId:Pe,albumId:C,place:k,trackCode:j,autoplay:(o=se&&!this.interactiveController)!==null&&o!==void 0?o:!1,mobile:Ae,clip:me,...Vt&&!this.isInited&&{projectId:Number(Vt)}},{refreshAuthToken:A,userSalt:y,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new gr(this.uiConfig.sentry,{version:Sr,env:cd},{movieId:Pe,albumId:C,place:k,autoplay:(s=se&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Ae,clip:me}),this.interactiveController&&((a=this.prevIsid)!==null&&a!==void 0||(this.prevIsid=(c=this.statistics)===null||c===void 0?void 0:c.oneStat.isid$.getValue())),this.sentry={...this.sentry,...gr.getInstance()};const _t=!!ae,lt=[];let Nt="tooltip_interactive_go_back_disabled_first";if(_t&&this.interactiveController){const Je=this.interactiveController.state.isInitialChapter$.getValue(),He=this.interactiveController.getHistoryState();Je&<.push(ft.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||lt.push(ft.SEEK_TO_INTERACTIVE_BUTTON),He.hasPrevChapter$.getValue()||(lt.push(ft.PLAY_PREV_CHAPTER_BUTTON),Je||(He.isGoBackLimited$.getValue()?Nt="tooltip_interactive_go_back_disabled_limit":Nt="tooltip_interactive_go_back_disabled"))}const at=()=>{var Je;this.isInited=!1,this.prevIsid=void 0;const He=(n==null?void 0:n.info.isEnded$.getValue())&&((Je=this.interactiveController)===null||Je===void 0?void 0:Je.state.isEndChapter$.getValue());ce.onReplayInteractiveVideo&&!He?ce.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Tg({player:n,interfaceLanguage:ie,videoId:Pe,isClip:me,isLiveCatchUpMode:be,isAudioDisabled:Le,statAuthToken:V,callbacks:ce,webApi:ei,videoEpisodes:Re,previewThumbsData:xe,canDownload:$,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:lt,isInteractive:_t,interactiveRanges$:(f=this.interactiveController)===null||f===void 0?void 0:f.state.interactiveRanges$,isInteractiveTime$:(m=this.interactiveController)===null||m===void 0?void 0:m.state.isInteractiveTime$,replayInteractive:at,playPrevChapterDisabledTooltip:Nt,hasInteractiveBranches:!!(!((_=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||_===void 0)&&_.length),additionalButtons:this.uiConfig.features.additionalButtons?Ne:[],looped:Me&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:It}=this.microStoresRoot=F6();this.subscription.add(this.store.state.currentFormat$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onCurrentFormatChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(It.interactiveControlsOpacity$.subscribe(Je=>{var He;Je!==null&&((He=this===null||this===void 0?void 0:this.interactiveController)===null||He===void 0||He.setDisabledControls(Je))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onThroughputEstimationChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onTrafficSavingEnabledChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onCurrentPlaybackRateChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.volume$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onVolumeChange)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.muted$.subscribe(Je=>{var He,Ct;return Je?(He=ce==null?void 0:ce.onMute)===null||He===void 0?void 0:He.call(ce):(Ct=ce==null?void 0:ce.onUnmute)===null||Ct===void 0?void 0:Ct.call(ce)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onVideoBitrateChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Je=>{var He;const Ct=(He=this.store)===null||He===void 0?void 0:He.ui.controls.disabledControls$;Ct&&(Je&&!Ct.includes(_l)&&Ct.add(_l),Je||Ct.remove(_l))})),this.initMediaSession(),this.interactiveController&>&&this.initInteractivesStatistics(),this.svelteRootComponent=new f6({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Ie,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:ue,thumbUrl:pe,videoLogoUrl:le,subtitles:Xe,live:nt,preload:z,autoplay:se,muted:N,volume:re,fromTime:te,canRewindLive:X,supportLink:G,showAds:I,adsSlotId:M,adsParams:st,adsPreviewParam:L,duration:Se,logoClickable:Te,logoHidden:ke,isMobile:Ae,failoverHosts:W,fullScreenTarget:Ce,showMiniTimer:ze,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Et.nextVideoTitle,endScreenVideoThumb:Et.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playNextVideo:()=>this.playNextVideo(),playPrevVideo:()=>this.playPrevVideo(),repeatPlaylist:()=>this.repeatPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),toggleGraph:()=>this.toggleGraph()}}),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(b=(w=(g=this.videoConfig)===null||g===void 0?void 0:g.callbacks)===null||w===void 0?void 0:w.onInited)===null||b===void 0||b.call(w))}addPlayerInfoSubscriptions(){var e;const i=this.store;if(!i)return;const n=(e=this.videoConfig)===null||e===void 0?void 0:e.callbacks;n&&this.subscription.add(i.playerPhase.subscribe(r=>{var o;return(o=n.onPlayerPhaseChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.playbackState$.subscribe(r=>{var o;return(o=n.onPlaybackStateChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isLive$.subscribe(r=>{var o;return(o=n.onIsLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isActiveLive$.subscribe(r=>{var o;return(o=n.onIsActiveLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isAudioAvailable$.subscribe(r=>{var o;return(o=n.onIsAudioAvailableChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.currentQuality$.subscribe(r=>{var o;return(o=n.onCurrentQualityChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.availableQualities$.subscribe(r=>{var o;return(o=n.onAvailableQualitiesChanged)===null||o===void 0?void 0:o.call(n,r.map(({value:s})=>s).filter(s=>s!==Io.AUTO))})).add(i.ui.isPictureInPictureActive$.subscribe(r=>{var o,s;return r?(o=n.onPiPEnter)===null||o===void 0?void 0:o.call(n):(s=n.onPiPExit)===null||s===void 0?void 0:s.call(n)}));const l=n==null?void 0:n.uiInfo;l&&this.subscription.add(i.ui.controlsVisible.subscribe(r=>{var o;return(o=l.onControlsVisibleChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.isMobile.subscribe(r=>{var o;return(o=l.onIsMobileChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.playerSize.subscribe(r=>{var o;return(o=l.onPlayerSizeChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.prevButton.subscribe(r=>{var o;return(o=l.onPrevButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playButton.subscribe(r=>{var o;return(o=l.onPlayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.replayButton.subscribe(r=>{var o;return(o=l.onReplayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.nextButton.subscribe(r=>{var o;return(o=l.onNextButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playPrevChapterButton.subscribe(r=>{var o;return(o=l.onPlayPrevChapterChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.seekToInteractiveButton.subscribe(r=>{var o;return(o=l.onSeekToInteractiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveGraphButton.subscribe(r=>{var o;return(o=l.onGraphButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.liveButton.subscribe(r=>{var o;return(o=l.onLiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.time.subscribe(r=>{var o;return(o=l.onTimeUpdateChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.episodes.subscribe(r=>{var o;return(o=l.onEpisodesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.subtitles.subscribe(r=>{var o;return(o=l.onSubtitlesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.settings.subscribe(r=>{var o;return(o=l.onSettingsChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.fullscreen.subscribe(r=>{var o;return(o=l.onFullscreenChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.chromecast.subscribe(r=>{var o;return(o=l.onChromecastChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.pip.subscribe(r=>{var o;return(o=l.onPipChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.vkLogo.subscribe(r=>{var o;return(o=l.onVkLogoChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveTimeIcon.subscribe(r=>{var o;return(o=l.onInteractiveTimeIconChanged)===null||o===void 0?void 0:o.call(l,r)}))}playNextVideo(){var e;if(!this.videoConfig)return;let i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onNextVideoClick)try{i=this.videoConfig.callbacks.onNextVideoClick()}catch(n){this.log({message:"onNextVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){var e;if(!this.videoConfig)return;let i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onPrevVideoClick)try{i=this.videoConfig.callbacks.onPrevVideoClick()}catch(n){this.log({message:"onPrevVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}repeatPlaylist(){this.currentPlayingVideoIndex=0,this.log({message:"repeat playlist"}),this.createPlayerWithCurrentVideo()}createPlayerWithCurrentVideo(e,i=!0){var n;if(!this.videoConfig)return;const l=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!l){this.log({message:"no next video"});return}this.isInited&&Vn(l.unitedVideoId)&&this.store.actions.internal.nextMovie(l.unitedVideoId),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(l,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)===null||e===void 0||e.playPrevChapter()}seekToInteractive(){var e;const i=(e=this.interactiveController)===null||e===void 0?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}toggleGraph(){var e,i;if(!this.isInited)return;const n=this.store,{isEnded$:l,playbackState$:r,graphIsOpened$:o}=n.state,{disabledControls$:s}=n.ui.controls,a=et(l),c=et(r);et(o)?(o.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),s.remove(ns),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",o.set(!0),(i=this.interactiveController)===null||i===void 0||i.toggleGraphView(!0),s.add(ns),!a&&this.graphMadePause&&this.pause())}async initInteractives(){var e,i,n,l;if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:r,EVENT_NAMES:o,CustomError:s}=await import("@vkontakte/videoplayer-interactive/es2018.esm.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const a=(i=this.store)===null||i===void 0?void 0:i.interfaceLanguage$,c=a?et(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:m,historyApi:h,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new r({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:m,historyApi:h,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:g}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(b=>{if(!this.isInited)return;const C=this.store;b?C.ui.controls.disabledControls$.remove(ft.SEEK_TO_INTERACTIVE_BUTTON):C.ui.controls.disabledControls$.add(ft.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(g.subscribe(b=>{this.store&&this.store.state.isInteractiveExpectation$.set(b)}));let w=!0;if(this.interactiveController.on(o.playerChanged,b=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...b.config,title:(f==null?void 0:f.title)||b.config.title};const C=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(b.player,C),w&&(w=!1)}),this.interactiveController.on(o.interactives,({type:b,actionType:C})=>{var k,y,V,j;if(!this.store)return;const A=g.getValue();if(b==="action-choice"&&C==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Z1)),b==="action-choice-canceled"){const z=et(this.store.state.isPlaying$)||A;if(!((k=this.videoConfig)===null||k===void 0)&&k.isMobile&&z){this.store.ui.interactiveHideMobileControls.set(!0);return}(j=(y=this.videoConfig)===null||y===void 0?void 0:(V=y.callbacks).onDisabledInteractiveClick)===null||j===void 0||j.call(V)}}),!((l=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||l===void 0)&&l.onInteractiveHistoryChanged){const b=this.interactiveController.getHistoryState();this.subscription.add(b.history$.subscribe(C=>{var k,y,V;C.length&&((V=(y=(k=this.videoConfig)===null||k===void 0?void 0:k.callbacks)===null||y===void 0?void 0:y.onInteractiveHistoryChanged)===null||V===void 0||V.call(y,C))}))}this.interactiveController.events.noInteraction$.subscribe(()=>{var b,C,k;(k=(b=this.videoConfig)===null||b===void 0?void 0:(C=b.callbacks).onInteractiveTimeIconClick)===null||k===void 0||k.call(C)}),this.interactiveController.on(o.errors,b=>{this.log({message:b.toString()})})}catch(r){this.log({message:r.message})}}async initInteractivesStatistics(){var e,i;const{statSubscription:n,oneStat:l}=this.statistics;if(!(!n||!l||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:r}=await import("@vkontakte/videoplayer-interactive/es2018.esm.js"),o={[r.GO_NEXT_BUTTON]:Do.NEXT_BUTTON,[r.GO_NEXT_AREA]:Do.NEXT_AREA,[r.WATCH_AGAIN]:Do.WATCH_AGAIN,[r.OPEN_GRAPH]:Do.GRAPH_SHOW,[r.CLOSE_GRAPH]:Do.GRAPH_HIDE},{click$:s,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new Cn;s.subscribe(f=>{var m,h;f in o?c.next(o[f]):(l==null||l.logError({errorType:"InteractiveVideosAction",fatal:!1}),(h=(m=this.sentry).report)===null||h===void 0||h.call(m,new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),n.add(l.attachToInteractive({click$:c,nextMovie$:a}))}catch(r){l==null||l.logError({errorType:"InteractiveVideos",fatal:!1}),(i=(e=this.sentry).report)===null||i===void 0||i.call(e,r,{errorType:"InteractiveVideosAction",fatal:!1})}}initPlayer(e,i={}){var n,l,r,o,s,a,c,f,m,h,_,g,w,b,C,k,y,V,j;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=V1(H6,F0(e,A=>A instanceof HTMLElement?A:void 0)),this.uiConfig=td((n=i.ui)!==null&&n!==void 0?n:{}),this.coreConfig=(l=i.core)!==null&&l!==void 0?l:{configName:[]},this.statisticsConfig=(r=i.statistics)!==null&&r!==void 0?r:{},this.sentry={config:(o=this.uiConfig.sentry)!==null&&o!==void 0?o:{}},Vn(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(s=this.videoConfig.isMediaSessionEnabled)!==null&&s!==void 0?s:!0),Vn(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(c=(a=this.uiConfig.features.pip)!==null&&a!==void 0?a:this.videoConfig.isPictureInPictureEnabled)!==null&&c!==void 0?c:!0,this.uiConfig.features.dpip=(m=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&m!==void 0?m:!0),this.videoConfig.isMobile=(h=this.uiConfig.isMobile)!==null&&h!==void 0?h:this.videoConfig.isMobile,(V=this.videoConfig).autoplay&&(V.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(_=this.uiConfig.ads.enable)!==null&&_!==void 0?_:this.videoConfig.showAds,this.videoConfig.adsSlotId=(g=this.uiConfig.ads.slot)!==null&&g!==void 0?g:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(w=this.uiConfig.ads.preview)!==null&&w!==void 0?w:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((b=this.uiConfig.showLogo)!==null&&b!==void 0?b:!this.videoConfig.logoHidden),(j=this.videoConfig).canRewindLive&&(j.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(C=this.videoConfig.supportLink)!==null&&C!==void 0?C:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=A6.getLatestSupportedVersion():this.pictureInPictureApi=new Mr),this.mediaSessionApi=this.uiConfig.features.mediaSession?new _6:void 0,this.annotationsApi=this.uiConfig.features.annotations?new N6(this.rootContainer):void 0,(k=this.svelteStubComponent)===null||k===void 0||k.$destroy(),(y=this.svelteRootComponent)===null||y===void 0||y.$destroy(),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0),e.interactiveData?this.initInteractives():this.createPlayer(e.videos[0]),I6(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){var i;if(!this.videoConfig)return;this.log({message:`update next videos, videos: ${JSON.stringify(e)}`}),this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e);const n=this.getNextVideoInfo();(i=this.svelteRootComponent)===null||i===void 0||i.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)===null||e===void 0||e.call(this),this.unsubscribePlayerPhaseSubscription=(i=this.store)===null||i===void 0?void 0:i.playerPhase.subscribe(n=>{n===Oe.Video?this.setupMediaSessionForVideo():n===Oe.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",l=>this.seekTime(l.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&n.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&n.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(n)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i)}catch(e){this.log({message:e.message})}}play(){var e,i;this.isControlDisabled(ft.PLAY_BUTTON)||!((e=this.store)===null||e===void 0)&&e.playerPhase.is(Oe.WaitingLive)||(this.log({message:"play"}),(i=this.svelteRootComponent)===null||i===void 0||i.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)===null||e===void 0||e.pause()}stop(){var e,i;if(!this.videoConfig)return;this.log({message:"stop"}),(e=this.svelteStubComponent)===null||e===void 0||e.$destroy();const n=this.videoConfig.videos[0];n&&((i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),this.createPlayer(n))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setMuted(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setVolume(e)}setRepeat(e){var i;this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,(i=this.svelteRootComponent)===null||i===void 0||i.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){var i;this.isControlDisabled(ft.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)===null||e===void 0||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,n,l;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!==null&&i!==void 0?i:"none"}. Min: ${(n=e.min)!==null&&n!==void 0?n:"none"}`}),(l=this.svelteRootComponent)===null||l===void 0||l.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)===null||i===void 0||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)===null||i===void 0?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,n;this.log({message:"live started"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingLive(!1),(n=this.svelteRootComponent)===null||n===void 0||n.initVideo(e),this.play()}setWaitRecord(){var e,i;this.log({message:"post live"}),(e=this.store)===null||e===void 0||e.actions.internal.setWaitingRecord(!0),(i=this.store)===null||i===void 0||i.destroy()}setLiveEnd(e){var i,n;this.log({message:"live ended"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingRecord(!1),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){var e,i;return(i=(e=this.statistics)===null||e===void 0?void 0:e.oneStat.getDeviceId())!==null&&i!==void 0?i:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const Q6=()=>{window.customElements.define("vk-video-player",U6)};export{Mt as GridTypes,t8 as InterfaceLanguage,Sr as VERSION,i8 as VKNumericLanguage,x6 as VideoFormat,$6 as VideoQuality,n8 as loadVKLangPack,Q6 as registerPlayerWebComponent};
|
|
51
|
+
`),l=document.createElement("style");l.textContent=n;const r=this.createStretchedContainer(),o=r.attachShadow({mode:"open"});o.append(l),o.append(this.playerDomElement),this.playerDummyElement=new P6({target:this.playerParentShadowRoot,context:this.svelteContext}),(e=this.pipWindow)===null||e===void 0||e.document.body.append(r),this.info.isActive$.next(!0),(i=this.pipWindow)===null||i===void 0||i.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)===null||i===void 0||i.close(),e()})}async dispose(){await this.remove()}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function I6(t){return t instanceof Wf}class A6{static getLatestSupportedVersion(){const e=new Mr,i=new Wf;if(i.isSupported())return i;if(e.isSupported())return e}}function V1(t,e){var i,n;const l=new Set([...Object.keys(t),...Object.keys(e)]),r={};for(const o of l)r[o]=(n=(i=e[o])!==null&&i!==void 0?i:t[o])!==null&&n!==void 0?n:void 0;return r}const L6="Inner error. Unexpectedly root annotation container null reference exception",M6="Annotation with such name already exists",V6="Annotation with such name does not exist";class ur extends Error{constructor(e){super(e),this.name="AnnotationError"}}const B6="1",R6=100;class N6{constructor(e){this.annotations=new Map,this.subscriptions=new no,this.rootAnnotationsContainer=e;const i=Pl(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},R6);this.subscriptions.add(D0(this.rootAnnotationsContainer).subscribe(({width:n,height:l})=>{this.playerSize={width:n,height:l},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var n;if(!this.rootAnnotationsContainer)throw new ur(L6);if(this.annotations.has(e))throw new ur(M6);i.style.zIndex=(n=i.style.zIndex)!==null&&n!==void 0?n:B6,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){const i=this.annotations.get(e);if(!i)throw new ur(V6);return i}remove(e){const i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(const e in this.annotations.keys())this.remove(e)}destroy(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,n){const l=e.offsetTop,r=e.offsetLeft,o=e.offsetWidth,s=e.offsetHeight;return l<0||r<0||r+o>i||l+s>n}registryRootContainer(e){}addLayer(e){return new HTMLElement}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}}class qr{init(e,i){return vt(e),vt(i),this.subscription=new no,this.subscription}}class O6 extends qr{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$={...Be(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{isInteractiveExpectation$:l}=e.state;return n.add(l.subscribe(r=>{this.state$.set(r?!0:null)})),n}}class D6 extends qr{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$={...Be(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{fakeIsPlaying$:l}=i,{isInteractiveExpectation$:r,isPlaying$:o}=e.state,{controlsVisible:s,isMobile:a}=e.ui,c=et(a),f=()=>c&&et(s);return n.add(s.subscribe(m=>{if(!c)return;const h=et(l);et(o)?this.state$.set(m):h!==null&&this.state$.set(!h||m)})),n.add(o.subscribe(m=>{this.state$.set(!m||f())})),n.add(l.subscribe(m=>{if(m===null)return;const h=et(r);if(f()){this.state$.set(!0);return}h&&this.state$.set(!m)})),n}}class z6 extends qr{constructor(){super(...arguments),this.stateName="seekToInteractiveDisabledTooltip$",this.state$=Be("tooltip_chapter_without_interactive")}init(e,i){const n=super.init(e,i);return n.add(e.state.interactiveEpisodes$.subscribe(l=>{l.length&&(l.every(r=>r.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}}const F6=()=>[O6,D6,z6].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}}),H6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Uo.RU,logoClickable:!1,logoHidden:!1,isMobile:z0(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class U6 extends HTMLElement{constructor(){var e;super(),this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=!1,this.videoConfig=void 0,this.pictureInPictureApi=void 0,this.mediaSessionApi=void 0,this.unsubscribePlayerPhaseSubscription=void 0,this.annotationsApi=void 0,this.prevIsid=void 0,this.isInited=!1,this.logger=new R1,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new no,this.graphMadePause=!1,!((e=window==null?void 0:window.videoPlayerConfig)===null||e===void 0)&&e.debugLogs&&this.subscription.add(this.logger.log$.subscribe(i=>{console.log("%c player web component ","background:#77dd77;",`${i.component}`,i.message)}))}connectedCallback(){var e,i;if(this.isInited)return;this.initPlayerRootContainers();const n=(e=this.getAttribute("stub-title"))!==null&&e!==void 0?e:void 0,l=(i=this.getAttribute("stub-thumb-url"))!==null&&i!==void 0?i:void 0;this.svelteStubComponent=new b6({target:this.playerContainer,props:{title:n,thumbUrl:l}})}disconnectedCallback(){var e,i,n,l,r;(e=this.annotationsApi)===null||e===void 0||e.destroy(),(i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),(n=this.svelteStubComponent)===null||n===void 0||n.$destroy(),this.subscription.unsubscribe(),(l=this.unsubscribePlayerPhaseSubscription)===null||l===void 0||l.call(this),(r=this.interactiveController)===null||r===void 0||r.destroy()}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%";const e=document.createElement("div");e.style.position="absolute",e.className="shadow-root-container",e.style.width="100%",e.style.height="100%",this._shadowRoot=e.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(e),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var i;const n=(i=this.store)===null||i===void 0?void 0:i.ui.controls.disabledControls$;return(n==null?void 0:n.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};const e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createPlayer(e,i={},n){var l,r,o,s,a,c,f,m,h,_,g,w,b;if(!this.videoConfig)return;const{albumId:C,statPlace:k,statUserSalt:y,statAuthToken:V,statTrackCode:j,refreshStatAuthToken:A,preload:z,autoplay:se,volume:re,muted:N,fromTime:te,canRewindLive:X,supportLink:G,showAds:I,adsSlotId:M,adsParams:x={},adsPreviewParam:L,interfaceLanguage:ie,logoClickable:Te,logoHidden:ke,isMobile:Ae,isAudioDisabled:Le,isLiveCatchUpMode:be,fullScreenTarget:Ce,failoverHosts:W,canDownload:$,callbacks:ce,interactiveData:ae,showThumbTimer:ze,additionalButtons:Ne=[],repeat:Me}=V1(this.videoConfig,i),{sources:Ie,title:ue,thumbUrl:pe,videoLogoUrl:le,unitedVideoId:Pe,isClip:me=!1,duration:Se,adsParams:Ze={},videoEpisodes:Re,previewThumbsData:xe,subtitles:Xe,live:nt}=e,st={...x,...Ze},Et=this.getNextVideoInfo(),mt={sources:Ie,title:ue,thumbUrl:pe,subtitles:Xe,unitedVideoId:Pe,isClip:me,live:nt,albumId:C,statPlace:k,autoplay:se,muted:N,volume:re,fromTime:te,canRewindLive:X,showAds:I,adsSlotId:M,adsParams:st,adsPreviewParam:L,duration:Se,logoClickable:Te,logoHidden:ke,isMobile:Ae,repeat:Me,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Et.nextVideoTitle,endScreenVideoThumb:Et.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},ei={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(mt)}`});const gt=this.uiConfig.features.statistics&&!!Pe,{pid:Vt}=((r=(l=this.videoConfig)===null||l===void 0?void 0:l.interactiveData)===null||r===void 0?void 0:r.projectInfo)||{};gt&&(this.statistics=new Pg({movieId:Pe,albumId:C,place:k,trackCode:j,autoplay:(o=se&&!this.interactiveController)!==null&&o!==void 0?o:!1,mobile:Ae,clip:me,refDomain:this.videoConfig.refDomain,...Vt&&!this.isInited&&{projectId:Number(Vt)}},{refreshAuthToken:A,userSalt:y,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new gr(this.uiConfig.sentry,{version:Sr,env:cd},{movieId:Pe,albumId:C,place:k,autoplay:(s=se&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Ae,clip:me}),this.interactiveController&&((a=this.prevIsid)!==null&&a!==void 0||(this.prevIsid=(c=this.statistics)===null||c===void 0?void 0:c.oneStat.isid$.getValue())),this.sentry={...this.sentry,...gr.getInstance()};const _t=!!ae,lt=[];let Nt="tooltip_interactive_go_back_disabled_first";if(_t&&this.interactiveController){const Je=this.interactiveController.state.isInitialChapter$.getValue(),He=this.interactiveController.getHistoryState();Je&<.push(ft.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||lt.push(ft.SEEK_TO_INTERACTIVE_BUTTON),He.hasPrevChapter$.getValue()||(lt.push(ft.PLAY_PREV_CHAPTER_BUTTON),Je||(He.isGoBackLimited$.getValue()?Nt="tooltip_interactive_go_back_disabled_limit":Nt="tooltip_interactive_go_back_disabled"))}const at=()=>{var Je;this.isInited=!1,this.prevIsid=void 0;const He=(n==null?void 0:n.info.isEnded$.getValue())&&((Je=this.interactiveController)===null||Je===void 0?void 0:Je.state.isEndChapter$.getValue());ce.onReplayInteractiveVideo&&!He?ce.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Tg({player:n,interfaceLanguage:ie,videoId:Pe,isClip:me,isLiveCatchUpMode:be,isAudioDisabled:Le,statAuthToken:V,callbacks:ce,webApi:ei,videoEpisodes:Re,previewThumbsData:xe,canDownload:$,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:lt,isInteractive:_t,interactiveRanges$:(f=this.interactiveController)===null||f===void 0?void 0:f.state.interactiveRanges$,isInteractiveTime$:(m=this.interactiveController)===null||m===void 0?void 0:m.state.isInteractiveTime$,replayInteractive:at,playPrevChapterDisabledTooltip:Nt,hasInteractiveBranches:!!(!((_=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||_===void 0)&&_.length),additionalButtons:this.uiConfig.features.additionalButtons?Ne:[],looped:Me&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:It}=this.microStoresRoot=F6();this.subscription.add(this.store.state.currentFormat$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onCurrentFormatChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(It.interactiveControlsOpacity$.subscribe(Je=>{var He;Je!==null&&((He=this===null||this===void 0?void 0:this.interactiveController)===null||He===void 0||He.setDisabledControls(Je))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onThroughputEstimationChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onTrafficSavingEnabledChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onCurrentPlaybackRateChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.volume$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onVolumeChange)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.muted$.subscribe(Je=>{var He,Ct;return Je?(He=ce==null?void 0:ce.onMute)===null||He===void 0?void 0:He.call(ce):(Ct=ce==null?void 0:ce.onUnmute)===null||Ct===void 0?void 0:Ct.call(ce)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Je=>{var He;return(He=ce==null?void 0:ce.onVideoBitrateChanged)===null||He===void 0?void 0:He.call(ce,Je)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Je=>{var He;const Ct=(He=this.store)===null||He===void 0?void 0:He.ui.controls.disabledControls$;Ct&&(Je&&!Ct.includes(_l)&&Ct.add(_l),Je||Ct.remove(_l))})),this.initMediaSession(),this.interactiveController&>&&this.initInteractivesStatistics(),this.svelteRootComponent=new f6({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Ie,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:ue,thumbUrl:pe,videoLogoUrl:le,subtitles:Xe,live:nt,preload:z,autoplay:se,muted:N,volume:re,fromTime:te,canRewindLive:X,supportLink:G,showAds:I,adsSlotId:M,adsParams:st,adsPreviewParam:L,duration:Se,logoClickable:Te,logoHidden:ke,isMobile:Ae,failoverHosts:W,fullScreenTarget:Ce,showMiniTimer:ze,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Et.nextVideoTitle,endScreenVideoThumb:Et.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playNextVideo:()=>this.playNextVideo(),playPrevVideo:()=>this.playPrevVideo(),repeatPlaylist:()=>this.repeatPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),toggleGraph:()=>this.toggleGraph()}}),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(b=(w=(g=this.videoConfig)===null||g===void 0?void 0:g.callbacks)===null||w===void 0?void 0:w.onInited)===null||b===void 0||b.call(w))}addPlayerInfoSubscriptions(){var e;const i=this.store;if(!i)return;const n=(e=this.videoConfig)===null||e===void 0?void 0:e.callbacks;n&&this.subscription.add(i.playerPhase.subscribe(r=>{var o;return(o=n.onPlayerPhaseChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.playbackState$.subscribe(r=>{var o;return(o=n.onPlaybackStateChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isLive$.subscribe(r=>{var o;return(o=n.onIsLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isActiveLive$.subscribe(r=>{var o;return(o=n.onIsActiveLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isAudioAvailable$.subscribe(r=>{var o;return(o=n.onIsAudioAvailableChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.currentQuality$.subscribe(r=>{var o;return(o=n.onCurrentQualityChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.availableQualities$.subscribe(r=>{var o;return(o=n.onAvailableQualitiesChanged)===null||o===void 0?void 0:o.call(n,r.map(({value:s})=>s).filter(s=>s!==Io.AUTO))})).add(i.ui.isPictureInPictureActive$.subscribe(r=>{var o,s;return r?(o=n.onPiPEnter)===null||o===void 0?void 0:o.call(n):(s=n.onPiPExit)===null||s===void 0?void 0:s.call(n)}));const l=n==null?void 0:n.uiInfo;l&&this.subscription.add(i.ui.controlsVisible.subscribe(r=>{var o;return(o=l.onControlsVisibleChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.isMobile.subscribe(r=>{var o;return(o=l.onIsMobileChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.playerSize.subscribe(r=>{var o;return(o=l.onPlayerSizeChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.prevButton.subscribe(r=>{var o;return(o=l.onPrevButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playButton.subscribe(r=>{var o;return(o=l.onPlayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.replayButton.subscribe(r=>{var o;return(o=l.onReplayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.nextButton.subscribe(r=>{var o;return(o=l.onNextButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playPrevChapterButton.subscribe(r=>{var o;return(o=l.onPlayPrevChapterChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.seekToInteractiveButton.subscribe(r=>{var o;return(o=l.onSeekToInteractiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveGraphButton.subscribe(r=>{var o;return(o=l.onGraphButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.liveButton.subscribe(r=>{var o;return(o=l.onLiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.time.subscribe(r=>{var o;return(o=l.onTimeUpdateChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.episodes.subscribe(r=>{var o;return(o=l.onEpisodesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.subtitles.subscribe(r=>{var o;return(o=l.onSubtitlesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.settings.subscribe(r=>{var o;return(o=l.onSettingsChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.fullscreen.subscribe(r=>{var o;return(o=l.onFullscreenChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.chromecast.subscribe(r=>{var o;return(o=l.onChromecastChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.pip.subscribe(r=>{var o;return(o=l.onPipChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.vkLogo.subscribe(r=>{var o;return(o=l.onVkLogoChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveTimeIcon.subscribe(r=>{var o;return(o=l.onInteractiveTimeIconChanged)===null||o===void 0?void 0:o.call(l,r)}))}playNextVideo(){var e;if(!this.videoConfig)return;let i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onNextVideoClick)try{i=this.videoConfig.callbacks.onNextVideoClick()}catch(n){this.log({message:"onNextVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){var e;if(!this.videoConfig)return;let i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onPrevVideoClick)try{i=this.videoConfig.callbacks.onPrevVideoClick()}catch(n){this.log({message:"onPrevVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}repeatPlaylist(){this.currentPlayingVideoIndex=0,this.log({message:"repeat playlist"}),this.createPlayerWithCurrentVideo()}createPlayerWithCurrentVideo(e,i=!0){var n;if(!this.videoConfig)return;const l=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!l){this.log({message:"no next video"});return}this.isInited&&Vn(l.unitedVideoId)&&this.store.actions.internal.nextMovie(l.unitedVideoId),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(l,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)===null||e===void 0||e.playPrevChapter()}seekToInteractive(){var e;const i=(e=this.interactiveController)===null||e===void 0?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}toggleGraph(){var e,i;if(!this.isInited)return;const n=this.store,{isEnded$:l,playbackState$:r,graphIsOpened$:o}=n.state,{disabledControls$:s}=n.ui.controls,a=et(l),c=et(r);et(o)?(o.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),s.remove(ns),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",o.set(!0),(i=this.interactiveController)===null||i===void 0||i.toggleGraphView(!0),s.add(ns),!a&&this.graphMadePause&&this.pause())}async initInteractives(){var e,i,n,l;if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:r,EVENT_NAMES:o,CustomError:s}=await import("@vkontakte/videoplayer-interactive/es2018.esm.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const a=(i=this.store)===null||i===void 0?void 0:i.interfaceLanguage$,c=a?et(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:m,historyApi:h,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new r({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:m,historyApi:h,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:g}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(b=>{if(!this.isInited)return;const C=this.store;b?C.ui.controls.disabledControls$.remove(ft.SEEK_TO_INTERACTIVE_BUTTON):C.ui.controls.disabledControls$.add(ft.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(g.subscribe(b=>{this.store&&this.store.state.isInteractiveExpectation$.set(b)}));let w=!0;if(this.interactiveController.on(o.playerChanged,b=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...b.config,title:(f==null?void 0:f.title)||b.config.title};const C=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(b.player,C),w&&(w=!1)}),this.interactiveController.on(o.interactives,({type:b,actionType:C})=>{var k,y,V,j;if(!this.store)return;const A=g.getValue();if(b==="action-choice"&&C==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Z1)),b==="action-choice-canceled"){const z=et(this.store.state.isPlaying$)||A;if(!((k=this.videoConfig)===null||k===void 0)&&k.isMobile&&z){this.store.ui.interactiveHideMobileControls.set(!0);return}(j=(y=this.videoConfig)===null||y===void 0?void 0:(V=y.callbacks).onDisabledInteractiveClick)===null||j===void 0||j.call(V)}}),!((l=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||l===void 0)&&l.onInteractiveHistoryChanged){const b=this.interactiveController.getHistoryState();this.subscription.add(b.history$.subscribe(C=>{var k,y,V;C.length&&((V=(y=(k=this.videoConfig)===null||k===void 0?void 0:k.callbacks)===null||y===void 0?void 0:y.onInteractiveHistoryChanged)===null||V===void 0||V.call(y,C))}))}this.interactiveController.events.noInteraction$.subscribe(()=>{var b,C,k;(k=(b=this.videoConfig)===null||b===void 0?void 0:(C=b.callbacks).onInteractiveTimeIconClick)===null||k===void 0||k.call(C)}),this.interactiveController.on(o.errors,b=>{this.log({message:b.toString()})})}catch(r){this.log({message:r.message})}}async initInteractivesStatistics(){var e,i;const{statSubscription:n,oneStat:l}=this.statistics;if(!(!n||!l||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:r}=await import("@vkontakte/videoplayer-interactive/es2018.esm.js"),o={[r.GO_NEXT_BUTTON]:Do.NEXT_BUTTON,[r.GO_NEXT_AREA]:Do.NEXT_AREA,[r.WATCH_AGAIN]:Do.WATCH_AGAIN,[r.OPEN_GRAPH]:Do.GRAPH_SHOW,[r.CLOSE_GRAPH]:Do.GRAPH_HIDE},{click$:s,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new Cn;s.subscribe(f=>{var m,h;f in o?c.next(o[f]):(l==null||l.logError({errorType:"InteractiveVideosAction",fatal:!1}),(h=(m=this.sentry).report)===null||h===void 0||h.call(m,new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),n.add(l.attachToInteractive({click$:c,nextMovie$:a}))}catch(r){l==null||l.logError({errorType:"InteractiveVideos",fatal:!1}),(i=(e=this.sentry).report)===null||i===void 0||i.call(e,r,{errorType:"InteractiveVideosAction",fatal:!1})}}initPlayer(e,i={}){var n,l,r,o,s,a,c,f,m,h,_,g,w,b,C,k,y,V,j;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=V1(H6,F0(e,A=>A instanceof HTMLElement?A:void 0)),this.uiConfig=td((n=i.ui)!==null&&n!==void 0?n:{}),this.coreConfig=(l=i.core)!==null&&l!==void 0?l:{configName:[]},this.statisticsConfig=(r=i.statistics)!==null&&r!==void 0?r:{},this.sentry={config:(o=this.uiConfig.sentry)!==null&&o!==void 0?o:{}},Vn(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(s=this.videoConfig.isMediaSessionEnabled)!==null&&s!==void 0?s:!0),Vn(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(c=(a=this.uiConfig.features.pip)!==null&&a!==void 0?a:this.videoConfig.isPictureInPictureEnabled)!==null&&c!==void 0?c:!0,this.uiConfig.features.dpip=(m=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&m!==void 0?m:!0),this.videoConfig.isMobile=(h=this.uiConfig.isMobile)!==null&&h!==void 0?h:this.videoConfig.isMobile,(V=this.videoConfig).autoplay&&(V.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(_=this.uiConfig.ads.enable)!==null&&_!==void 0?_:this.videoConfig.showAds,this.videoConfig.adsSlotId=(g=this.uiConfig.ads.slot)!==null&&g!==void 0?g:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(w=this.uiConfig.ads.preview)!==null&&w!==void 0?w:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((b=this.uiConfig.showLogo)!==null&&b!==void 0?b:!this.videoConfig.logoHidden),(j=this.videoConfig).canRewindLive&&(j.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(C=this.videoConfig.supportLink)!==null&&C!==void 0?C:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=A6.getLatestSupportedVersion():this.pictureInPictureApi=new Mr),this.mediaSessionApi=this.uiConfig.features.mediaSession?new _6:void 0,this.annotationsApi=this.uiConfig.features.annotations?new N6(this.rootContainer):void 0,(k=this.svelteStubComponent)===null||k===void 0||k.$destroy(),(y=this.svelteRootComponent)===null||y===void 0||y.$destroy(),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0),e.interactiveData?this.initInteractives():this.createPlayer(e.videos[0]),I6(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){var i;if(!this.videoConfig)return;this.log({message:`update next videos, videos: ${JSON.stringify(e)}`}),this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e);const n=this.getNextVideoInfo();(i=this.svelteRootComponent)===null||i===void 0||i.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)===null||e===void 0||e.call(this),this.unsubscribePlayerPhaseSubscription=(i=this.store)===null||i===void 0?void 0:i.playerPhase.subscribe(n=>{n===Oe.Video?this.setupMediaSessionForVideo():n===Oe.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",l=>this.seekTime(l.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&n.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&n.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(n)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i)}catch(e){this.log({message:e.message})}}play(){var e,i;this.isControlDisabled(ft.PLAY_BUTTON)||!((e=this.store)===null||e===void 0)&&e.playerPhase.is(Oe.WaitingLive)||(this.log({message:"play"}),(i=this.svelteRootComponent)===null||i===void 0||i.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)===null||e===void 0||e.pause()}stop(){var e,i;if(!this.videoConfig)return;this.log({message:"stop"}),(e=this.svelteStubComponent)===null||e===void 0||e.$destroy();const n=this.videoConfig.videos[0];n&&((i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),this.createPlayer(n))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setMuted(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setVolume(e)}setRepeat(e){var i;this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,(i=this.svelteRootComponent)===null||i===void 0||i.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){var i;this.isControlDisabled(ft.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)===null||e===void 0||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,n,l;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!==null&&i!==void 0?i:"none"}. Min: ${(n=e.min)!==null&&n!==void 0?n:"none"}`}),(l=this.svelteRootComponent)===null||l===void 0||l.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)===null||i===void 0||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)===null||i===void 0?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,n;this.log({message:"live started"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingLive(!1),(n=this.svelteRootComponent)===null||n===void 0||n.initVideo(e),this.play()}setWaitRecord(){var e,i;this.log({message:"post live"}),(e=this.store)===null||e===void 0||e.actions.internal.setWaitingRecord(!0),(i=this.store)===null||i===void 0||i.destroy()}setLiveEnd(e){var i,n;this.log({message:"live ended"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingRecord(!1),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){var e,i;return(i=(e=this.statistics)===null||e===void 0?void 0:e.oneStat.getDeviceId())!==null&&i!==void 0?i:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const Q6=()=>{window.customElements.define("vk-video-player",U6)};export{Mt as GridTypes,t8 as InterfaceLanguage,Sr as VERSION,i8 as VKNumericLanguage,x6 as VideoFormat,$6 as VideoQuality,n8 as loadVKLangPack,Q6 as registerPlayerWebComponent};
|