@vkontakte/videoplayer 1.1.36 → 1.1.37-dev.aaebf6d2.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 +5 -5
- package/es2015.esm.js +5 -5
- package/es2018.cjs.js +5 -5
- package/es2018.esm.js +5 -5
- package/esnext.cjs.js +5 -5
- package/esnext.esm.js +5 -5
- package/evergreen.esm.js +5 -5
- package/package.json +2 -2
package/es2015.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.
|
|
3
|
-
*
|
|
4
|
-
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-
|
|
2
|
+
* @vkontakte/videoplayer v1.1.37-dev.aaebf6d2.0
|
|
3
|
+
* Mon, 24 Jun 2024 09:14:44 GMT
|
|
4
|
+
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-37/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var c0=Object.create;var Nl=Object.defineProperty,f0=Object.defineProperties,d0=Object.getOwnPropertyDescriptor,m0=Object.getOwnPropertyDescriptors,p0=Object.getOwnPropertyNames,qr=Object.getOwnPropertySymbols,h0=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty,v0=Object.prototype.propertyIsEnumerable;var Bl=(t,e,i)=>e in t?Nl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,mn=(t,e)=>{for(var i in e||(e={}))jr.call(e,i)&&Bl(t,i,e[i]);if(qr)for(var i of qr(e))v0.call(e,i)&&Bl(t,i,e[i]);return t},yo=(t,e)=>f0(t,m0(e));var g0=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of p0(e))!jr.call(t,l)&&l!==i&&Nl(t,l,{get:()=>e[l],enumerable:!(n=d0(e,l))||n.enumerable});return t};var Zr=(t,e,i)=>(i=t!=null?c0(h0(t)):{},g0(e||!t||!t.__esModule?Nl(i,"default",{value:t,enumerable:!0}):i,t));var Rl=(t,e,i)=>(Bl(t,typeof e!="symbol"?e+"":e,i),i);var Ji=(t,e,i)=>new Promise((n,l)=>{var r=a=>{try{s(i.next(a))}catch(c){l(c)}},o=a=>{try{s(i.throw(a))}catch(c){l(c)}},s=a=>a.done?n(a.value):Promise.resolve(a.value).then(r,o);s((i=i.apply(t,e)).next())});var tt=require("@vkontakte/videoplayer-core/es2015.cjs.js"),ie=require("@vkontakte/videoplayer-shared/es2015.cjs.js"),St=require("@vkontakte/videoplayer-statistics/es2015.cjs.js");require("@vkontakte/videoplayer-interactive/es2015.cjs.js");function ni(t,e,i,n){function l(r){return r instanceof i?r:new i(function(o){o(r)})}return new(i||(i=Promise))(function(r,o){function s(f){try{c(n.next(f))}catch(d){o(d)}}function a(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?r(f.value):l(f.value).then(s,a)}c((n=n.apply(t,e||[])).next())})}function W(){}function Su(t,e){for(const i in e)t[i]=e[i];return t}function Pu(t){return t()}function Kr(){return Object.create(null)}function ut(t){t.forEach(Pu)}function Vn(t){return typeof t=="function"}function _e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ll;function Wr(t,e){return ll||(ll=document.createElement("a")),ll.href=e,t===ll.href}function b0(t){return Object.keys(t).length===0}function ei(t,...e){if(t==null){for(const n of e)n(void 0);return W}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function $e(t){let e;return ei(t,i=>e=i)(),e}function z(t,e,i){t.$$.on_destroy.push(ei(e,i))}function qn(t,e,i,n){if(t){const l=Eu(t,e,i,n);return t[0](l)}}function Eu(t,e,i,n){return t[1]&&n?Su(i.ctx.slice(),t[1](n(e))):i.ctx}function jn(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 Zn(t,e,i,n,l,r){if(l){const o=Eu(e,i,n,r);t.p(o,l)}}function Kn(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 _0(t){return t==null?"":t}const Iu=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function p(t,e){t.appendChild(e)}function Ye(t,e,i){const n=w0(t);if(!n.getElementById(e)){const l=P("style");l.id=e,l.textContent=i,k0(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 k0(t,e){return p(t.head||t,e),e.sheet}function S(t,e,i){t.insertBefore(e,i||null)}function T(t){t.parentNode&&t.parentNode.removeChild(t)}function Mn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function P(t){return document.createElement(t)}function O(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ze(t){return document.createTextNode(t)}function H(){return ze(" ")}function bt(){return ze("")}function ve(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function ii(t){return function(e){return e.preventDefault(),t.call(this,e)}}function ct(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 y0(t){return Array.from(t.childNodes)}function et(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ht(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let rl;function C0(){if(rl===void 0){rl=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){rl=!0}}return rl}function gr(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=P("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=C0();let r;return l?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=ve(window,"message",o=>{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{r=ve(n.contentWindow,"resize",e),e()}),p(t,n),()=>{(l||r&&n.contentWindow)&&r(),T(n)}}function N(t,e,i){t.classList.toggle(e,!!i)}function Dn(t,e){return new t(e)}let jo;function Uo(t){jo=t}function Ko(){if(!jo)throw new Error("Function called outside component initialization");return jo}function pn(t){Ko().$$.on_mount.push(t)}function Wo(t){Ko().$$.on_destroy.push(t)}function sr(t,e){return Ko().$$.context.set(t,e),e}function br(t){return Ko().$$.context.get(t)}function Au(){return Ko().$$.context}function co(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const Ao=[],Te=[];let Mo=[];const ar=[],Lu=Promise.resolve();let ur=!1;function Vu(){ur||(ur=!0,Lu.then(Mu))}function $n(){return Vu(),Lu}function No(t){Mo.push(t)}function qe(t){ar.push(t)}const Ol=new Set;let Co=0;function Mu(){if(Co!==0)return;const t=jo;do{try{for(;Co<Ao.length;){const e=Ao[Co];Co++,Uo(e),T0(e.$$)}}catch(e){throw Ao.length=0,Co=0,e}for(Uo(null),Ao.length=0,Co=0;Te.length;)Te.pop()();for(let e=0;e<Mo.length;e+=1){const i=Mo[e];Ol.has(i)||(Ol.add(i),i())}Mo.length=0}while(Ao.length);for(;ar.length;)ar.pop()();ur=!1,Ol.clear(),Uo(t)}function T0(t){if(t.fragment!==null){t.update(),ut(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(No)}}function S0(t){const e=[],i=[];Mo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Mo=e}const gl=new Set;let so;function fe(){so={r:0,c:[],p:so}}function de(){so.r||ut(so.c),so=so.p}function m(t,e){t&&t.i&&(gl.delete(t),t.i(e))}function v(t,e,i,n){if(t&&t.o){if(gl.has(t))return;gl.add(t),so.c.push(()=>{gl.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Xt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function P0(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 E0(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 K(t){t&&t.c()}function j(t,e,i){const{fragment:n,after_update:l}=t.$$;n&&n.m(e,i),No(()=>{const r=t.$$.on_mount.map(Pu).filter(Vn);t.$$.on_destroy?t.$$.on_destroy.push(...r):ut(r),t.$$.on_mount=[]}),l.forEach(No)}function Z(t,e){const i=t.$$;i.fragment!==null&&(S0(i.after_update),ut(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function I0(t,e){t.$$.dirty[0]===-1&&(Ao.push(t),Vu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ke(t,e,i,n,l,r,o,s=[-1]){const a=jo;Uo(t);const c=t.$$={fragment:null,ctx:[],props:r,update:W,not_equal:l,bound:Kr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Kr(),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||{},(d,h,...g)=>{const _=g.length?g[0]:h;return c.ctx&&l(c.ctx[d],c.ctx[d]=_)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](_),f&&I0(t,d)),h}):[],c.update(),f=!0,ut(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const d=y0(e.target);c.fragment&&c.fragment.l(d),d.forEach(T)}else c.fragment&&c.fragment.c();e.intro&&m(t.$$.fragment),j(t,e.target,e.anchor),Mu()}Uo(a)}class ye{constructor(){Rl(this,"$$");Rl(this,"$$set")}$destroy(){Z(this,1),this.$destroy=W}$on(e,i){if(!Vn(i))return W;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&&!b0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const A0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(A0);var ao;(function(t){t.VK="vk",t.VK_VIDEO="vk_video",t.VK_VIDEO_MOBILE="vk_video_mobile"})(ao||(ao={}));const L0={isMobile:void 0,defaultLanguage:ie.InterfaceLanguage.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:ao.VK_VIDEO,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:ie.VideoQuality.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,interactiveTimeIndicator:!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}},V0=t=>ie.fillWithDefault(t,L0),M0=t=>sr("ui-config",t),wn=()=>br("ui-config"),cr="vk_player_debug_panel_opened",Bu=300,B0=100,N0="videoplayer",R0="videoplayer";var Ie;(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"})(Ie||(Ie={}));const Go={[Ie.KeyF]:"f",[Ie.KeyK]:"k",[Ie.KeyC]:"c",[Ie.KeyM]:"m"},O0=new Set([Ie.ArrowLeft,Ie.ArrowRight,Ie.KeyL,Ie.KeyJ]),D0=new Set([Ie.Tab,Ie.Space,Ie.ArrowLeft,Ie.ArrowRight,Ie.ArrowUp,Ie.ArrowDown]),z0=new Set([Ie.ShiftRight,Ie.ShiftLeft]);var vt;(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"})(vt||(vt={}));const Gr=40,Nu=260,H0=60,Fo=8,Ru=[vt.TIMELINE],bl=[...Ru,vt.GRAPH_BUTTON],Yr=[...Ru,vt.PLAY_BUTTON],Ou=[...bl,vt.PLAY_BUTTON];var Lo;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(Lo||(Lo={}));exports.GridTypes=void 0;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(exports.GridTypes||(exports.GridTypes={}));const Ro={[exports.GridTypes.XS]:0,[exports.GridTypes.S]:1,[exports.GridTypes.M]:2,[exports.GridTypes.L]:3,[exports.GridTypes.XL]:4},To=[];function On(t,e){return{subscribe:Le(t,e).subscribe}}function Le(t,e=W){let i;const n=new Set;function l(s){if(_e(t,s)&&(t=s,i)){const a=!To.length;for(const c of n)c[1](),To.push(c,t);if(a){for(let c=0;c<To.length;c+=2)To[c][0](To[c+1]);To.length=0}}}function r(s){l(s(t))}function o(s,a=W){const c=[s,a];return n.add(c),n.size===1&&(i=e(l,r)||W),s(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:l,update:r,subscribe:o}}function ki(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 On(i,(o,s)=>{let a=!1;const c=[];let f=0,d=W;const h=()=>{if(f)return;d();const _=e(n?c[0]:c,o,s);r?o(_):d=Vn(_)?_:W},g=l.map((_,b)=>ei(_,C=>{c[b]=C,f&=~(1<<b),a&&h()},()=>{f|=1<<b}));return a=!0,h(),function(){ut(g),d(),a=!1}})}const F0="prod",Tl="1.1.36",Du=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},zu=Symbol("storeContext"),Hu=Symbol("microStoresContext"),U0=(t,e)=>{sr(zu,t),sr(Hu,e)},Pt=()=>{const t=br(zu);return ie.assertNonNullable(t,"Store context is empty!"),t},Do=()=>{const t=br(Hu);return ie.assertNonNullable(t,"MicroStores context is empty!"),t},Tt=(t,e)=>Fu(t,t.getValue(),e),Fu=(t,e,i)=>On(e,n=>{const l=t.subscribe(r=>{n(r),i==null||i(r)});return()=>l.unsubscribe()}),q0=(t,e,i)=>{var n,l,r,o;const s=t.info,{width:a,height:c}=$e(i.ui.playerSize),f=(l=(n=s.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&l!==void 0?l:0,d=(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",g=`${Tl} (core: ${tt.VERSION}, stat: ${St.VERSION}, shared: ${ie.VERSION})`,_=$e(i.state.errorLog$),b=_.length?`
|
|
6
|
+
"use strict";var c0=Object.create;var Nl=Object.defineProperty,f0=Object.defineProperties,d0=Object.getOwnPropertyDescriptor,m0=Object.getOwnPropertyDescriptors,p0=Object.getOwnPropertyNames,qr=Object.getOwnPropertySymbols,h0=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty,v0=Object.prototype.propertyIsEnumerable;var Bl=(t,e,i)=>e in t?Nl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,mn=(t,e)=>{for(var i in e||(e={}))jr.call(e,i)&&Bl(t,i,e[i]);if(qr)for(var i of qr(e))v0.call(e,i)&&Bl(t,i,e[i]);return t},yo=(t,e)=>f0(t,m0(e));var g0=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of p0(e))!jr.call(t,l)&&l!==i&&Nl(t,l,{get:()=>e[l],enumerable:!(n=d0(e,l))||n.enumerable});return t};var Zr=(t,e,i)=>(i=t!=null?c0(h0(t)):{},g0(e||!t||!t.__esModule?Nl(i,"default",{value:t,enumerable:!0}):i,t));var Rl=(t,e,i)=>(Bl(t,typeof e!="symbol"?e+"":e,i),i);var Ji=(t,e,i)=>new Promise((n,l)=>{var r=a=>{try{s(i.next(a))}catch(c){l(c)}},o=a=>{try{s(i.throw(a))}catch(c){l(c)}},s=a=>a.done?n(a.value):Promise.resolve(a.value).then(r,o);s((i=i.apply(t,e)).next())});var tt=require("@vkontakte/videoplayer-core/es2015.cjs.js"),ie=require("@vkontakte/videoplayer-shared/es2015.cjs.js"),St=require("@vkontakte/videoplayer-statistics/es2015.cjs.js");require("@vkontakte/videoplayer-interactive/es2015.cjs.js");function ni(t,e,i,n){function l(r){return r instanceof i?r:new i(function(o){o(r)})}return new(i||(i=Promise))(function(r,o){function s(f){try{c(n.next(f))}catch(d){o(d)}}function a(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?r(f.value):l(f.value).then(s,a)}c((n=n.apply(t,e||[])).next())})}function W(){}function Su(t,e){for(const i in e)t[i]=e[i];return t}function Pu(t){return t()}function Kr(){return Object.create(null)}function ut(t){t.forEach(Pu)}function Vn(t){return typeof t=="function"}function _e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ll;function Wr(t,e){return ll||(ll=document.createElement("a")),ll.href=e,t===ll.href}function b0(t){return Object.keys(t).length===0}function ei(t,...e){if(t==null){for(const n of e)n(void 0);return W}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function $e(t){let e;return ei(t,i=>e=i)(),e}function z(t,e,i){t.$$.on_destroy.push(ei(e,i))}function qn(t,e,i,n){if(t){const l=Eu(t,e,i,n);return t[0](l)}}function Eu(t,e,i,n){return t[1]&&n?Su(i.ctx.slice(),t[1](n(e))):i.ctx}function jn(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 Zn(t,e,i,n,l,r){if(l){const o=Eu(e,i,n,r);t.p(o,l)}}function Kn(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 _0(t){return t==null?"":t}const Iu=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function p(t,e){t.appendChild(e)}function Ye(t,e,i){const n=w0(t);if(!n.getElementById(e)){const l=P("style");l.id=e,l.textContent=i,k0(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 k0(t,e){return p(t.head||t,e),e.sheet}function S(t,e,i){t.insertBefore(e,i||null)}function T(t){t.parentNode&&t.parentNode.removeChild(t)}function Mn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function P(t){return document.createElement(t)}function O(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ze(t){return document.createTextNode(t)}function H(){return ze(" ")}function bt(){return ze("")}function ve(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function ii(t){return function(e){return e.preventDefault(),t.call(this,e)}}function ct(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 y0(t){return Array.from(t.childNodes)}function et(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ht(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let rl;function C0(){if(rl===void 0){rl=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){rl=!0}}return rl}function gr(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=P("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=C0();let r;return l?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=ve(window,"message",o=>{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{r=ve(n.contentWindow,"resize",e),e()}),p(t,n),()=>{(l||r&&n.contentWindow)&&r(),T(n)}}function N(t,e,i){t.classList.toggle(e,!!i)}function Dn(t,e){return new t(e)}let jo;function Uo(t){jo=t}function Ko(){if(!jo)throw new Error("Function called outside component initialization");return jo}function pn(t){Ko().$$.on_mount.push(t)}function Wo(t){Ko().$$.on_destroy.push(t)}function sr(t,e){return Ko().$$.context.set(t,e),e}function br(t){return Ko().$$.context.get(t)}function Au(){return Ko().$$.context}function co(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const Ao=[],Te=[];let Mo=[];const ar=[],Lu=Promise.resolve();let ur=!1;function Vu(){ur||(ur=!0,Lu.then(Mu))}function $n(){return Vu(),Lu}function No(t){Mo.push(t)}function qe(t){ar.push(t)}const Ol=new Set;let Co=0;function Mu(){if(Co!==0)return;const t=jo;do{try{for(;Co<Ao.length;){const e=Ao[Co];Co++,Uo(e),T0(e.$$)}}catch(e){throw Ao.length=0,Co=0,e}for(Uo(null),Ao.length=0,Co=0;Te.length;)Te.pop()();for(let e=0;e<Mo.length;e+=1){const i=Mo[e];Ol.has(i)||(Ol.add(i),i())}Mo.length=0}while(Ao.length);for(;ar.length;)ar.pop()();ur=!1,Ol.clear(),Uo(t)}function T0(t){if(t.fragment!==null){t.update(),ut(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(No)}}function S0(t){const e=[],i=[];Mo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Mo=e}const gl=new Set;let so;function fe(){so={r:0,c:[],p:so}}function de(){so.r||ut(so.c),so=so.p}function m(t,e){t&&t.i&&(gl.delete(t),t.i(e))}function v(t,e,i,n){if(t&&t.o){if(gl.has(t))return;gl.add(t),so.c.push(()=>{gl.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Xt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function P0(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 E0(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 K(t){t&&t.c()}function j(t,e,i){const{fragment:n,after_update:l}=t.$$;n&&n.m(e,i),No(()=>{const r=t.$$.on_mount.map(Pu).filter(Vn);t.$$.on_destroy?t.$$.on_destroy.push(...r):ut(r),t.$$.on_mount=[]}),l.forEach(No)}function Z(t,e){const i=t.$$;i.fragment!==null&&(S0(i.after_update),ut(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function I0(t,e){t.$$.dirty[0]===-1&&(Ao.push(t),Vu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ke(t,e,i,n,l,r,o,s=[-1]){const a=jo;Uo(t);const c=t.$$={fragment:null,ctx:[],props:r,update:W,not_equal:l,bound:Kr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Kr(),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||{},(d,h,...g)=>{const _=g.length?g[0]:h;return c.ctx&&l(c.ctx[d],c.ctx[d]=_)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](_),f&&I0(t,d)),h}):[],c.update(),f=!0,ut(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const d=y0(e.target);c.fragment&&c.fragment.l(d),d.forEach(T)}else c.fragment&&c.fragment.c();e.intro&&m(t.$$.fragment),j(t,e.target,e.anchor),Mu()}Uo(a)}class ye{constructor(){Rl(this,"$$");Rl(this,"$$set")}$destroy(){Z(this,1),this.$destroy=W}$on(e,i){if(!Vn(i))return W;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&&!b0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const A0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(A0);var ao;(function(t){t.VK="vk",t.VK_VIDEO="vk_video",t.VK_VIDEO_MOBILE="vk_video_mobile"})(ao||(ao={}));const L0={isMobile:void 0,defaultLanguage:ie.InterfaceLanguage.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:ao.VK_VIDEO,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:ie.VideoQuality.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,interactiveTimeIndicator:!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}},V0=t=>ie.fillWithDefault(t,L0),M0=t=>sr("ui-config",t),wn=()=>br("ui-config"),cr="vk_player_debug_panel_opened",Bu=300,B0=100,N0="videoplayer",R0="videoplayer";var Ie;(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"})(Ie||(Ie={}));const Go={[Ie.KeyF]:"f",[Ie.KeyK]:"k",[Ie.KeyC]:"c",[Ie.KeyM]:"m"},O0=new Set([Ie.ArrowLeft,Ie.ArrowRight,Ie.KeyL,Ie.KeyJ]),D0=new Set([Ie.Tab,Ie.Space,Ie.ArrowLeft,Ie.ArrowRight,Ie.ArrowUp,Ie.ArrowDown]),z0=new Set([Ie.ShiftRight,Ie.ShiftLeft]);var vt;(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"})(vt||(vt={}));const Gr=40,Nu=260,H0=60,Fo=8,Ru=[vt.TIMELINE],bl=[...Ru,vt.GRAPH_BUTTON],Yr=[...Ru,vt.PLAY_BUTTON],Ou=[...bl,vt.PLAY_BUTTON];var Lo;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(Lo||(Lo={}));exports.GridTypes=void 0;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(exports.GridTypes||(exports.GridTypes={}));const Ro={[exports.GridTypes.XS]:0,[exports.GridTypes.S]:1,[exports.GridTypes.M]:2,[exports.GridTypes.L]:3,[exports.GridTypes.XL]:4},To=[];function On(t,e){return{subscribe:Le(t,e).subscribe}}function Le(t,e=W){let i;const n=new Set;function l(s){if(_e(t,s)&&(t=s,i)){const a=!To.length;for(const c of n)c[1](),To.push(c,t);if(a){for(let c=0;c<To.length;c+=2)To[c][0](To[c+1]);To.length=0}}}function r(s){l(s(t))}function o(s,a=W){const c=[s,a];return n.add(c),n.size===1&&(i=e(l,r)||W),s(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:l,update:r,subscribe:o}}function ki(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 On(i,(o,s)=>{let a=!1;const c=[];let f=0,d=W;const h=()=>{if(f)return;d();const _=e(n?c[0]:c,o,s);r?o(_):d=Vn(_)?_:W},g=l.map((_,b)=>ei(_,C=>{c[b]=C,f&=~(1<<b),a&&h()},()=>{f|=1<<b}));return a=!0,h(),function(){ut(g),d(),a=!1}})}const F0="prod",Tl="1.1.37-dev.aaebf6d2.0",Du=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},zu=Symbol("storeContext"),Hu=Symbol("microStoresContext"),U0=(t,e)=>{sr(zu,t),sr(Hu,e)},Pt=()=>{const t=br(zu);return ie.assertNonNullable(t,"Store context is empty!"),t},Do=()=>{const t=br(Hu);return ie.assertNonNullable(t,"MicroStores context is empty!"),t},Tt=(t,e)=>Fu(t,t.getValue(),e),Fu=(t,e,i)=>On(e,n=>{const l=t.subscribe(r=>{n(r),i==null||i(r)});return()=>l.unsubscribe()}),q0=(t,e,i)=>{var n,l,r,o;const s=t.info,{width:a,height:c}=$e(i.ui.playerSize),f=(l=(n=s.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&l!==void 0?l:0,d=(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",g=`${Tl} (core: ${tt.VERSION}, stat: ${St.VERSION}, shared: ${ie.VERSION})`,_=$e(i.state.errorLog$),b=_.length?`
|
|
7
7
|
`+_.map((w,k)=>{var I;const $=`${k}) Type: ${w.id}
|
|
8
8
|
`,q=`Message: ${w.message} (${w.thrown})
|
|
9
9
|
`,D=`Trace: ${(I=w.thrown)===null||I===void 0?void 0:I.stack}
|
|
@@ -48,4 +48,4 @@
|
|
|
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 G_(t){let e,i,n;function l(o){t[57](o)}let r={store:t[0],uiConfig:t[34],title:t[1],thumbUrl:t[2],interactiveContainer:t[3],live:t[4],autoplay:t[5],canRewindLive:t[6],showAds:t[7],adsSlotId:t[8],adsParams:t[9],adsPreviewParam:t[10],duration:t[11],logoClickable:t[12],logoHidden:t[13],logoTargetUrl:t[35],showNextPrevButtons:t[15],nextButtonActive:t[16],prevButtonActive:t[17],endScreenVideoTitle:t[18],endScreenVideoThumb:t[19],isOneVideoPlaylist:t[20],supportLink:t[21],outerContainerRef:t[22],fullScreenTarget:t[23],showMiniTimer:t[24],playerStarted:t[33],playNextVideo:t[25],playPrevVideo:t[26],repeatPlaylist:t[27],seekToInteractive:t[28],toggleGraph:t[29],playPrevChapter:t[30],firstStart:t[36]};return t[32]!==void 0&&(r.videoContainer=t[32]),e=new N_({props:r}),Te.push(()=>je(e,"videoContainer",l)),{c(){K(e.$$.fragment)},m(o,s){j(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.interactiveContainer=o[3]),s[0]&16&&(a.live=o[4]),s[0]&32&&(a.autoplay=o[5]),s[0]&64&&(a.canRewindLive=o[6]),s[0]&128&&(a.showAds=o[7]),s[0]&256&&(a.adsSlotId=o[8]),s[0]&512&&(a.adsParams=o[9]),s[0]&1024&&(a.adsPreviewParam=o[10]),s[0]&2048&&(a.duration=o[11]),s[0]&4096&&(a.logoClickable=o[12]),s[0]&8192&&(a.logoHidden=o[13]),s[0]&32768&&(a.showNextPrevButtons=o[15]),s[0]&65536&&(a.nextButtonActive=o[16]),s[0]&131072&&(a.prevButtonActive=o[17]),s[0]&262144&&(a.endScreenVideoTitle=o[18]),s[0]&524288&&(a.endScreenVideoThumb=o[19]),s[0]&1048576&&(a.isOneVideoPlaylist=o[20]),s[0]&2097152&&(a.supportLink=o[21]),s[0]&4194304&&(a.outerContainerRef=o[22]),s[0]&8388608&&(a.fullScreenTarget=o[23]),s[0]&16777216&&(a.showMiniTimer=o[24]),s[1]&4&&(a.playerStarted=o[33]),s[0]&33554432&&(a.playNextVideo=o[25]),s[0]&67108864&&(a.playPrevVideo=o[26]),s[0]&134217728&&(a.repeatPlaylist=o[27]),s[0]&268435456&&(a.seekToInteractive=o[28]),s[0]&536870912&&(a.toggleGraph=o[29]),s[0]&1073741824&&(a.playPrevChapter=o[30]),!i&&s[1]&2&&(i=!0,a.videoContainer=o[32],qe(()=>i=!1)),e.$set(a)},i(o){n||(m(e.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),n=!1},d(o){Z(e,o)}}}function Y_(t){let e,i,n;function l(o){t[56](o)}let r={store:t[0],uiConfig:t[34],thumbUrl:t[2],interactiveContainer:t[3],live:t[4],autoplay:t[5],canRewindLive:t[6],showAds:t[7],adsSlotId:t[8],adsParams:t[9],adsPreviewParam:t[10],duration:t[11],logoClickable:t[12],logoHidden:t[13],logoTargetUrl:t[35],showNextPrevButtons:t[15],nextButtonActive:t[16],prevButtonActive:t[17],endScreenVideoTitle:t[18],endScreenVideoThumb:t[19],isOneVideoPlaylist:t[20],supportLink:t[21],outerContainerRef:t[22],fullScreenTarget:t[23],showMiniTimer:t[24],playerStarted:t[33],playNextVideo:t[25],playPrevVideo:t[26],repeatPlaylist:t[27],seekToInteractive:t[28],toggleGraph:t[29],playPrevChapter:t[30],firstStart:t[36],seekTime:t[31]};return t[32]!==void 0&&(r.videoContainer=t[32]),e=new K_({props:r}),Te.push(()=>je(e,"videoContainer",l)),{c(){K(e.$$.fragment)},m(o,s){j(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.interactiveContainer=o[3]),s[0]&16&&(a.live=o[4]),s[0]&32&&(a.autoplay=o[5]),s[0]&64&&(a.canRewindLive=o[6]),s[0]&128&&(a.showAds=o[7]),s[0]&256&&(a.adsSlotId=o[8]),s[0]&512&&(a.adsParams=o[9]),s[0]&1024&&(a.adsPreviewParam=o[10]),s[0]&2048&&(a.duration=o[11]),s[0]&4096&&(a.logoClickable=o[12]),s[0]&8192&&(a.logoHidden=o[13]),s[0]&32768&&(a.showNextPrevButtons=o[15]),s[0]&65536&&(a.nextButtonActive=o[16]),s[0]&131072&&(a.prevButtonActive=o[17]),s[0]&262144&&(a.endScreenVideoTitle=o[18]),s[0]&524288&&(a.endScreenVideoThumb=o[19]),s[0]&1048576&&(a.isOneVideoPlaylist=o[20]),s[0]&2097152&&(a.supportLink=o[21]),s[0]&4194304&&(a.outerContainerRef=o[22]),s[0]&8388608&&(a.fullScreenTarget=o[23]),s[0]&16777216&&(a.showMiniTimer=o[24]),s[1]&4&&(a.playerStarted=o[33]),s[0]&33554432&&(a.playNextVideo=o[25]),s[0]&67108864&&(a.playPrevVideo=o[26]),s[0]&134217728&&(a.repeatPlaylist=o[27]),s[0]&268435456&&(a.seekToInteractive=o[28]),s[0]&536870912&&(a.toggleGraph=o[29]),s[0]&1073741824&&(a.playPrevChapter=o[30]),!i&&s[1]&2&&(i=!0,a.videoContainer=o[32],qe(()=>i=!1)),e.$set(a)},i(o){n||(m(e.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),n=!1},d(o){Z(e,o)}}}function Q_(t){let e,i,n,l;const r=[Y_,G_],o=[];function s(a,c){return a[14]?0:1}return i=s(t),n=o[i]=r[i](t),{c(){e=P("div"),n.c(),u(e,"class","root v-cghoty")},m(a,c){S(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()),m(n,1),n.m(e,null))},i(a){l||(m(n),l=!0)},o(a){v(n),l=!1},d(a){a&&T(e),o[i].d()}}}function X_(t,e,i){let{sources:n}=e,{store:l}=e,{microStoresRoot:r}=e,{videoConfig:o}=e,{uiConfig:s}=e,{title:a}=e,{thumbUrl:c}=e,{interactiveContainer:f}=e,{subtitles:d}=e,{live:h}=e,{preload:g}=e,{autoplay:_}=e,{volume:b=void 0}=e,{muted:C=void 0}=e,{fromTime:y}=e,{canRewindLive:w}=e,{showAds:k}=e,{adsSlotId:I=void 0}=e,{adsParams:$=void 0}=e,{adsPreviewParam:q=void 0}=e,{duration:D=void 0}=e,{logoClickable:te}=e,{logoHidden:re}=e,{isMobile:V}=e,{showNextPrevButtons:X=!1}=e,{nextButtonActive:J=!1}=e,{prevButtonActive:B=!1}=e,{endScreenVideoTitle:A=void 0}=e,{endScreenVideoThumb:R=void 0}=e,{isOneVideoPlaylist:ne=!1}=e,{supportLink:L}=e,{outerContainerRef:G=void 0}=e,{fullScreenTarget:we=void 0}=e,{failoverHosts:Pe=void 0}=e,{showMiniTimer:Ae=!1}=e,{playNextVideo:Be=ie.noop}=e,{playPrevVideo:Ue=ie.noop}=e,{repeatPlaylist:me=ie.noop}=e,{seekToInteractive:F=ie.noop}=e,{toggleGraph:ue=ie.noop}=e,{playPrevChapter:be=ie.noop}=e;const{subscribers:We,stores:Qe}=r;M0(s);const ce=wn(),Ee=s.logoLink,De=l.ui.debugPanelVisible,Ze=l.ui.playerSize;let pe,M=null,Se=!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}),U0(l,Qe);const se=(ae=!1)=>{i(33,Se=!0),ae?l.actions.external.firstStart(k):l.actions.internal.firstStart(k)};function Ce(ae){var Ne;const yt=n||ae;yt&&l.initVideo({container:pe,sources:yt,failoverHosts:Pe,subtitles:d});const Et=ie.safeStorage.get(cr)==="true";De.set(Et),y>0&&l.actions.external.seekTime(y);const ht=V?ce.volumeDefault:(Ne=b!=null?b:Ku())!=null?Ne:ce.volumeDefault,Ge=C!=null?C:G0();if(l.actions.external.setVolume(ht),l.actions.external.setMuted(Ge),l.getAdmanWrapper().setInitialVolume(Ge?0:ht),ce.features.trafficSaving){const dt=Q0();dt&&l.actions.internal.setTrafficSavingEnabled(dt)}const He=W0(l.videoId);He&&l.actions.internal.setQuality(He),l.ui.isAutoplay.set(_),_?se():g&&ce.features.preload&&l.actions.internal.preload()}const Ke=ae=>{if(window.ResizeObserver){let yt,Et;M=new ResizeObserver(ie.throttleFn(ht=>{const Ge=ht[0];if(Ge){if(Ge.contentBoxSize){const He=Array.isArray(Ge.contentBoxSize)?Ge.contentBoxSize[0]:Ge.contentBoxSize;yt=He.inlineSize,Et=He.blockSize}else Ge.contentRect&&(yt=Ge.contentRect.width,Et=Ge.contentRect.height);Ze.set({width:yt,height:Et})}},Bu)),M.observe(ae)}Ze.set({width:ae.clientWidth,height:ae.clientHeight})};pn(()=>{Ke(pe);const ae=We.map(Et=>Et.init({store:l,microStores:Qe,config:o}));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 Ce(),()=>{M==null||M.disconnect(),ae.forEach(Et=>Et.unsubscribe()),l.destroy()}});function ot(){Se?l.actions.external.play():se(!0)}function rt(){l.actions.external.pause()}function it(ae){V||l.actions.external.setMuted(ae)}function pt(ae){V||ae>=0&&ae<=1&&l.actions.external.setVolume(ae)}function st(ae){l.actions.internal.seekTime(ae,St.SeekAction.UNKNOWN)}function he(ae){l.actions.external.seekEpisodeStartTime(ae)}function at(){l.actions.external.returnFocusToEpisodes()}function It(ae){l.actions.external.setPlaybackRate(ae)}function kt(ae){l.actions.external.setAutoQualityLimits(ae)}function Ve(ae){pe=ae,i(32,pe)}function Vt(ae){pe=ae,i(32,pe)}return t.$$set=ae=>{"sources"in ae&&i(37,n=ae.sources),"store"in ae&&i(0,l=ae.store),"microStoresRoot"in ae&&i(38,r=ae.microStoresRoot),"videoConfig"in ae&&i(39,o=ae.videoConfig),"uiConfig"in ae&&i(40,s=ae.uiConfig),"title"in ae&&i(1,a=ae.title),"thumbUrl"in ae&&i(2,c=ae.thumbUrl),"interactiveContainer"in ae&&i(3,f=ae.interactiveContainer),"subtitles"in ae&&i(41,d=ae.subtitles),"live"in ae&&i(4,h=ae.live),"preload"in ae&&i(42,g=ae.preload),"autoplay"in ae&&i(5,_=ae.autoplay),"volume"in ae&&i(43,b=ae.volume),"muted"in ae&&i(44,C=ae.muted),"fromTime"in ae&&i(45,y=ae.fromTime),"canRewindLive"in ae&&i(6,w=ae.canRewindLive),"showAds"in ae&&i(7,k=ae.showAds),"adsSlotId"in ae&&i(8,I=ae.adsSlotId),"adsParams"in ae&&i(9,$=ae.adsParams),"adsPreviewParam"in ae&&i(10,q=ae.adsPreviewParam),"duration"in ae&&i(11,D=ae.duration),"logoClickable"in ae&&i(12,te=ae.logoClickable),"logoHidden"in ae&&i(13,re=ae.logoHidden),"isMobile"in ae&&i(14,V=ae.isMobile),"showNextPrevButtons"in ae&&i(15,X=ae.showNextPrevButtons),"nextButtonActive"in ae&&i(16,J=ae.nextButtonActive),"prevButtonActive"in ae&&i(17,B=ae.prevButtonActive),"endScreenVideoTitle"in ae&&i(18,A=ae.endScreenVideoTitle),"endScreenVideoThumb"in ae&&i(19,R=ae.endScreenVideoThumb),"isOneVideoPlaylist"in ae&&i(20,ne=ae.isOneVideoPlaylist),"supportLink"in ae&&i(21,L=ae.supportLink),"outerContainerRef"in ae&&i(22,G=ae.outerContainerRef),"fullScreenTarget"in ae&&i(23,we=ae.fullScreenTarget),"failoverHosts"in ae&&i(46,Pe=ae.failoverHosts),"showMiniTimer"in ae&&i(24,Ae=ae.showMiniTimer),"playNextVideo"in ae&&i(25,Be=ae.playNextVideo),"playPrevVideo"in ae&&i(26,Ue=ae.playPrevVideo),"repeatPlaylist"in ae&&i(27,me=ae.repeatPlaylist),"seekToInteractive"in ae&&i(28,F=ae.seekToInteractive),"toggleGraph"in ae&&i(29,ue=ae.toggleGraph),"playPrevChapter"in ae&&i(30,be=ae.playPrevChapter)},t.$$.update=()=>{t.$$.dirty[0]&16385&&l.ui.isMobile.set(V)},[l,a,c,f,h,_,w,k,I,$,q,D,te,re,V,X,J,B,A,R,ne,L,G,we,Ae,Be,Ue,me,F,ue,be,st,pe,Se,ce,Ee,se,n,r,o,s,d,g,b,C,y,Pe,Ce,ot,rt,it,pt,he,at,It,kt,Ve,Vt]}class J_ extends ye{constructor(e){super(),ke(this,e,X_,Q_,_e,{sources:37,store:0,microStoresRoot:38,videoConfig:39,uiConfig:40,title:1,thumbUrl:2,interactiveContainer:3,subtitles:41,live:4,preload:42,autoplay:5,volume:43,muted:44,fromTime:45,canRewindLive:6,showAds:7,adsSlotId:8,adsParams:9,adsPreviewParam:10,duration:11,logoClickable:12,logoHidden:13,isMobile:14,showNextPrevButtons:15,nextButtonActive:16,prevButtonActive:17,endScreenVideoTitle:18,endScreenVideoThumb:19,isOneVideoPlaylist:20,supportLink:21,outerContainerRef:22,fullScreenTarget:23,failoverHosts:46,showMiniTimer:24,playNextVideo:25,playPrevVideo:26,repeatPlaylist:27,seekToInteractive:28,toggleGraph:29,playPrevChapter:30,initVideo:47,play:48,pause:49,setMuted:50,setVolume:51,seekTime:31,seekEpisodeStartTime:52,returnFocusToEpisodes:53,setPlaybackRate:54,setAutoQualityLimits:55},W_,[-1,-1,-1])}get initVideo(){return this.$$.ctx[47]}get play(){return this.$$.ctx[48]}get pause(){return this.$$.ctx[49]}get setMuted(){return this.$$.ctx[50]}get setVolume(){return this.$$.ctx[51]}get seekTime(){return this.$$.ctx[31]}get seekEpisodeStartTime(){return this.$$.ctx[52]}get returnFocusToEpisodes(){return this.$$.ctx[53]}get setPlaybackRate(){return this.$$.ctx[54]}get setAutoQualityLimits(){return this.$$.ctx[55]}}function x_(t){let e,i;return{c(){e=O("svg"),i=O("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){S(n,e,l),p(e,i)},p(n,[l]){l&1&&u(i,"fill",n[0])},i:W,o:W,d(n){n&&T(e)}}}function $_(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 e6 extends ye{constructor(e){super(),ke(this,e,$_,x_,_e,{isWhite:1})}}function t6(t){Ye(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 yu(t){let e,i;return{c(){e=P("div"),i=ze(t[0]),u(e,"class","title v-1y9fytq")},m(n,l){S(n,e,l),p(e,i)},p(n,l){l&1&&et(i,n[0])},d(n){n&&T(e)}}}function Cu(t){let e,i;return e=new e6({props:{isWhite:!!t[1]}}),{c(){K(e.$$.fragment)},m(n,l){j(e,n,l),i=!0},p(n,l){const r={};l&2&&(r.isWhite=!!n[1]),e.$set(r)},i(n){i||(m(e.$$.fragment,n),i=!0)},o(n){v(e.$$.fragment,n),i=!1},d(n){Z(e,n)}}}function i6(t){let e,i,n,l,r=t[0]&&yu(t),o=(!t[0]||!t[1])&&Cu(t);return{c(){e=P("div"),r&&r.c(),i=H(),o&&o.c(),u(e,"class","playerStub v-1y9fytq"),u(e,"style",n=t[1]?`background-image: url('${t[1]}')`:"")},m(s,a){S(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=yu(s),r.c(),r.m(e,i)):r&&(r.d(1),r=null),!s[0]||!s[1]?o?(o.p(s,a),a&3&&m(o,1)):(o=Cu(s),o.c(),m(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||(m(o),l=!0)},o(s){v(o),l=!1},d(s){s&&T(e),r&&r.d(),o&&o.d()}}}function n6(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 o6 extends ye{constructor(e){super(),ke(this,e,n6,i6,_e,{title:0,thumbUrl:1},t6)}}class l6{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 r6(t){let e,i,n,l;return{c(){e=O("svg"),i=O("g"),n=O("path"),l=O("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){S(r,e,o),p(e,i),p(i,n),p(i,l)},p:W,i:W,o:W,d(r){r&&T(e)}}}class s6 extends ye{constructor(e){super(),ke(this,e,null,r6,_e,{})}}function a6(t){Ye(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 u6(t){let e,i,n,l,r,o,s;return n=new s6({}),{c(){e=P("div"),i=P("div"),K(n.$$.fragment),l=H(),r=P("span"),o=ze(t[0]),u(i,"class","dummy-image v-1pbsod4"),N(i,"desktop",!t[1]),u(r,"class","title v-1pbsod4"),u(e,"class","player-pip-dummy v-1pbsod4"),N(e,"is-pip-api",t[2])},m(a,c){S(a,e,c),p(e,i),j(n,i,null),p(e,l),p(e,r),p(r,o),s=!0},p(a,[c]){(!s||c&2)&&N(i,"desktop",!a[1]),(!s||c&1)&&et(o,a[0])},i(a){s||(m(n.$$.fragment,a),s=!0)},o(a){v(n.$$.fragment,a),s=!1},d(a){a&&T(e),Z(n)}}}function c6(t,e,i){let n,l;const r=Pt(),o=!!r.webApi.pictureInPictureApi,s=r.interfaceLanguage$;z(t,s,f=>i(5,n=f));const a=r.ui.isMobile;z(t,a,f=>i(1,l=f));let c;return t.$$.update=()=>{t.$$.dirty&32&&i(0,c=n&&Q("pip_dummy_title"))},[c,l,o,s,a,n]}class f6 extends ye{constructor(e){super(),ke(this,e,c6,u6,_e,{},a6)}}const d6=460,m6=280;class Rf{constructor(){this.info={isActive$:new ie.ValueSubject(!1),type:Fn.DocumentPictureInPicture}}isSupported(){const e=ie.getCurrentBrowser().browser===ie.CurrentClientBrowser.Yandex,{isEmbed:i}=ie.detectEmbed();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}request(){var e,i;return ni(this,void 0,void 0,function*(){if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=yield documentPictureInPicture.requestWindow({width:d6,height:m6,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 f6({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))})})}remove(){return ni(this,void 0,void 0,function*(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)===null||i===void 0||i.close(),e()})})}dispose(){return ni(this,void 0,void 0,function*(){yield this.remove()})}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function p6(t){return t instanceof Rf}class h6{static getLatestSupportedVersion(){const e=new Sr,i=new Rf;if(i.isSupported())return i;if(e.isSupported())return e}}function Tu(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 v6="Inner error. Unexpectedly root annotation container null reference exception",g6="Annotation with such name already exists",b6="Annotation with such name does not exist";class lr extends Error{constructor(e){super(e),this.name="AnnotationError"}}const _6="1",w6=100;class k6{constructor(e){this.annotations=new Map,this.subscriptions=new ie.Subscription,this.rootAnnotationsContainer=e;const i=ie.throttleFn(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},w6);this.subscriptions.add(ie.observeElementSize(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 lr(v6);if(this.annotations.has(e))throw new lr(g6);i.style.zIndex=(n=i.style.zIndex)!==null&&n!==void 0?n:_6,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 lr(b6);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 Ll{init({store:e,microStores:i,config:n}){return ie.assertNonNullable(e),ie.assertNonNullable(i),ie.assertNonNullable(n),this.subscription=new ie.Subscription,this.subscription}}class y6 extends Ll{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$=Object.assign(Object.assign({},Le(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e){const i=super.init(e),{isInteractiveExpectation$:n}=e.store.state;return i.add(n.subscribe(l=>{this.state$.set(l?!0:null)})),i}}class C6 extends Ll{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$=Object.assign(Object.assign({},Le(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e){const i=super.init(e),{microStores:n,store:l}=e,{fakeIsPlaying$:r}=n,{isInteractiveExpectation$:o,isPlaying$:s}=l.state,{controlsVisible:a,isMobile:c}=l.ui,f=$e(c),d=()=>f&&$e(a);return i.add(a.subscribe(h=>{if(!f)return;const g=$e(r);$e(s)?this.state$.set(h):g!==null&&this.state$.set(!g||h)})),i.add(s.subscribe(h=>{this.state$.set(!h||d())})),i.add(r.subscribe(h=>{if(h===null)return;const g=$e(o);if(d()){this.state$.set(!0);return}g&&this.state$.set(!h)})),i}}class T6 extends Ll{constructor(){super(...arguments),this.stateName="seekToInteractiveDisabledTooltip$",this.state$=Le("tooltip_chapter_without_interactive")}init(e){const i=super.init(e),{store:n}=e;return i.add(n.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"))})),i}}const rr=Le(!1);let vl=null;class S6 extends Ll{constructor(){super(...arguments),this.stateName="showInteractiveTimeIndicatorTooltip$",this.state$=Object.assign(Object.assign({},rr),{set:(e,i=!1)=>{e!==$e(rr)&&(this.clearTimeout(),rr.set(e),!e&&vl&&(vl=!1),e&&i&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()})}init(e){const i=super.init(e),{store:n,config:l}=e,{isInteractiveTime$:r,isPlaying$:o}=n.state,s=n.ui.controlsVisible;i.add(s.subscribe(f=>{$e(r)&&f&&this.state$.set(!1)}));const a=(l==null?void 0:l.interactiveData)||{tooltipHelpHintActive:!1},c=ki([o,r],([f,d])=>f&&d);return i.add(c.subscribe(f=>{var d,h;const g=$e(o),_=$e(r);if(g){if(!_)return this.state$.set(!1);a.tooltipHelpHintActive&&vl===null&&(vl=!0,a.tooltipHelpHintActive=!1,this.state$.set(!0),(h=(d=n.callbacks)===null||d===void 0?void 0:d.onInteractiveTimeIndicatorHintDeactivated)===null||h===void 0||h.call(d))}})),i}clearTimeout(){window.clearTimeout(this.timeout)}}const P6=()=>[y6,C6,T6,S6].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:Object.assign(Object.assign({},e),{[n.stateName]:n.state$})}},{subscribers:[],stores:{}}),E6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:ie.InterfaceLanguage.RU,logoClickable:!1,logoHidden:!1,isMobile:ie.isMobile(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class I6 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 ie.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new ie.Subscription,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 o6({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,d,h,g,_,b,C;if(!this.videoConfig)return;const{albumId:y,statPlace:w,statUserSalt:k,statAuthToken:I,statTrackCode:$,refreshStatAuthToken:q,preload:D,autoplay:te,volume:re,muted:V,fromTime:X,canRewindLive:J,supportLink:B,showAds:A,adsSlotId:R,adsParams:ne={},adsPreviewParam:L,interfaceLanguage:G,logoClickable:we,logoHidden:Pe,isMobile:Ae,isAudioDisabled:Be,isLiveCatchUpMode:Ue,fullScreenTarget:me,failoverHosts:F,canDownload:ue,callbacks:be,interactiveData:We,showThumbTimer:Qe,additionalButtons:ce=[],repeat:Ee}=Tu(this.videoConfig,i),{sources:De,title:Ze,thumbUrl:pe,unitedVideoId:M,isClip:Se=!1,duration:se,adsParams:Ce={},videoEpisodes:Ke,previewThumbsData:ot,subtitles:rt,live:it}=e,pt=Object.assign(Object.assign({},ne),Ce),st=this.getNextVideoInfo(),he={sources:De,title:Ze,thumbUrl:pe,subtitles:rt,unitedVideoId:M,isClip:Se,live:it,albumId:y,statPlace:w,autoplay:te,muted:V,volume:re,fromTime:X,canRewindLive:J,showAds:A,adsSlotId:R,adsParams:pt,adsPreviewParam:L,duration:se,logoClickable:we,logoHidden:Pe,isMobile:Ae,repeat:Ee,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:st.nextVideoTitle,endScreenVideoThumb:st.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},at={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(he)}`});const It=this.uiConfig.features.statistics&&!!M,{pid:kt}=((r=(l=this.videoConfig)===null||l===void 0?void 0:l.interactiveData)===null||r===void 0?void 0:r.projectInfo)||{};It&&(this.statistics=new cg(Object.assign({movieId:M,albumId:y,place:w,trackCode:$,autoplay:(o=te&&!this.interactiveController)!==null&&o!==void 0?o:!1,mobile:Ae,clip:Se,refDomain:this.videoConfig.refDomain},kt&&!this.isInited&&{projectId:Number(kt)}),Object.assign({refreshAuthToken:q,userSalt:k,config:this.statisticsConfig},this.interactiveController&&{useIsid:!0,isid:this.prevIsid}))),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new pr(this.uiConfig.sentry,{version:Tl,env:F0},{movieId:M,albumId:y,place:w,autoplay:(s=te&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Ae,clip:Se}),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=Object.assign(Object.assign({},this.sentry),pr.getInstance());const Vt=!!We,ae=[];let yt="tooltip_interactive_go_back_disabled_first";if(Vt&&this.interactiveController){const Ge=this.interactiveController.state.isInitialChapter$.getValue(),He=this.interactiveController.getHistoryState();Ge&&ae.push(vt.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||ae.push(vt.SEEK_TO_INTERACTIVE_BUTTON),He.hasPrevChapter$.getValue()||(ae.push(vt.PLAY_PREV_CHAPTER_BUTTON),Ge||(He.isGoBackLimited$.getValue()?yt="tooltip_interactive_go_back_disabled_limit":yt="tooltip_interactive_go_back_disabled"))}const Et=()=>{var Ge;this.isInited=!1,this.prevIsid=void 0;const He=(n==null?void 0:n.info.isEnded$.getValue())&&((Ge=this.interactiveController)===null||Ge===void 0?void 0:Ge.state.isEndChapter$.getValue());be.onReplayInteractiveVideo&&!He?be.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=fg({player:n,interfaceLanguage:G,videoId:M,isClip:Se,isLiveCatchUpMode:Ue,isAudioDisabled:Be,statAuthToken:I,callbacks:be,webApi:at,videoEpisodes:Ke,previewThumbsData:ot,canDownload:ue,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:ae,isInteractive:Vt,interactiveRanges$:(f=this.interactiveController)===null||f===void 0?void 0:f.state.interactiveRanges$,isInteractiveTime$:(d=this.interactiveController)===null||d===void 0?void 0:d.state.isInteractiveTime$,replayInteractive:Et,playPrevChapterDisabledTooltip:yt,hasInteractiveBranches:!!(!((g=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||g===void 0)&&g.length),additionalButtons:this.uiConfig.features.additionalButtons?ce:[],looped:Ee&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:ht}=this.microStoresRoot=P6();this.subscription.add(this.store.state.currentFormat$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onCurrentFormatChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(ht.interactiveControlsOpacity$.subscribe(Ge=>{var He;Ge!==null&&((He=this===null||this===void 0?void 0:this.interactiveController)===null||He===void 0||He.setDisabledControls(Ge))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onThroughputEstimationChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onTrafficSavingEnabledChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onCurrentPlaybackRateChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.volume$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onVolumeChange)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.muted$.subscribe(Ge=>{var He,Ne;return Ge?(He=be==null?void 0:be.onMute)===null||He===void 0?void 0:He.call(be):(Ne=be==null?void 0:be.onUnmute)===null||Ne===void 0?void 0:Ne.call(be)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onVideoBitrateChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Ge=>{var He;const Ne=(He=this.store)===null||He===void 0?void 0:He.ui.controls.disabledControls$;Ne&&(Ge&&!Ne.includes(bl)&&Ne.add(bl),Ge||Ne.remove(bl))})),this.initMediaSession(),this.interactiveController&&It&&this.initInteractivesStatistics(),this.svelteRootComponent=new J_({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:De,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:Ze,thumbUrl:pe,subtitles:rt,live:it,preload:D,autoplay:te,muted:V,volume:re,fromTime:X,canRewindLive:J,supportLink:B,showAds:A,adsSlotId:R,adsParams:pt,adsPreviewParam:L,duration:se,logoClickable:we,logoHidden:Pe,isMobile:Ae,failoverHosts:F,fullScreenTarget:me,showMiniTimer:Qe,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:st.nextVideoTitle,endScreenVideoThumb:st.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,(C=(b=(_=this.videoConfig)===null||_===void 0?void 0:_.callbacks)===null||b===void 0?void 0:b.onInited)===null||C===void 0||C.call(b))}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!==Bo.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.interactiveTimeIndicator.subscribe(r=>{var o;return(o=l.onInteractiveTimeIndicatorChanged)===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&&ie.isNonNullable(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=$e(l),c=$e(r);$e(o)?(o.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),s.remove(Yr),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",o.set(!0),(i=this.interactiveController)===null||i===void 0||i.toggleGraphView(!0),s.add(Yr),!a&&this.graphMadePause&&this.pause())}initInteractives(){var e,i,n,l;return ni(this,void 0,void 0,function*(){if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:r,EVENT_NAMES:o,CustomError:s}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.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?$e(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:d,historyApi:h,videoLoader:g}=this.videoConfig.interactiveData;this.interactiveController=new r({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:d,historyApi:h,vkVideoLoader:g,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),yield this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:_}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(C=>{if(!this.isInited)return;const y=this.store;C?y.ui.controls.disabledControls$.remove(vt.SEEK_TO_INTERACTIVE_BUTTON):y.ui.controls.disabledControls$.add(vt.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(_.subscribe(C=>{this.store&&this.store.state.isInteractiveExpectation$.set(C)}));let b=!0;if(this.interactiveController.on(o.playerChanged,C=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]=Object.assign(Object.assign({},C.config),{title:(f==null?void 0:f.title)||C.config.title});const y=b?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(C.player,y),b&&(b=!1)}),this.interactiveController.on(o.interactives,({type:C,actionType:y})=>{var w,k,I,$;if(!this.store)return;const q=_.getValue();if(C==="action-choice"&&y==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Ou)),C==="action-choice-canceled"){const D=$e(this.store.state.isPlaying$)||q;if(!((w=this.videoConfig)===null||w===void 0)&&w.isMobile&&D){this.store.ui.interactiveHideMobileControls.set(!0);return}($=(k=this.videoConfig)===null||k===void 0?void 0:(I=k.callbacks).onDisabledInteractiveClick)===null||$===void 0||$.call(I)}}),!((l=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||l===void 0)&&l.onInteractiveHistoryChanged){const C=this.interactiveController.getHistoryState();this.subscription.add(C.history$.subscribe(y=>{var w,k,I;y.length&&((I=(k=(w=this.videoConfig)===null||w===void 0?void 0:w.callbacks)===null||k===void 0?void 0:k.onInteractiveHistoryChanged)===null||I===void 0||I.call(k,y))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var C,y,w,k;(C=this.microStoresRoot)===null||C===void 0||C.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(k=(y=this.videoConfig)===null||y===void 0?void 0:(w=y.callbacks).onInteractiveTimeIndicatorClick)===null||k===void 0||k.call(w)})),this.interactiveController.on(o.errors,C=>{this.log({message:C.toString()})})}catch(r){this.log({message:r.message})}})}initInteractivesStatistics(){var e,i;return ni(this,void 0,void 0,function*(){const{statSubscription:n,oneStat:l}=this.statistics;if(!(!n||!l||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:r}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.js"),o={[r.GO_NEXT_BUTTON]:St.InteractiveInterfaceClick.NEXT_BUTTON,[r.GO_NEXT_AREA]:St.InteractiveInterfaceClick.NEXT_AREA,[r.WATCH_AGAIN]:St.InteractiveInterfaceClick.WATCH_AGAIN,[r.OPEN_GRAPH]:St.InteractiveInterfaceClick.GRAPH_SHOW,[r.CLOSE_GRAPH]:St.InteractiveInterfaceClick.GRAPH_HIDE},{click$:s,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new ie.Subject;s.subscribe(f=>{var d,h;f in o?c.next(o[f]):(l==null||l.logError({errorType:"InteractiveVideosAction",fatal:!1}),(h=(d=this.sentry).report)===null||h===void 0||h.call(d,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,d,h,g,_,b,C,y,w,k,I,$;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=Tu(E6,ie.cloneDeepWith(e,q=>q instanceof HTMLElement?q:void 0)),this.uiConfig=V0((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:{}},ie.isNonNullable(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(s=this.videoConfig.isMediaSessionEnabled)!==null&&s!==void 0?s:!0),ie.isNonNullable(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=(d=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&d!==void 0?d:!0),this.videoConfig.isMobile=(h=this.uiConfig.isMobile)!==null&&h!==void 0?h:this.videoConfig.isMobile,(I=this.videoConfig).autoplay&&(I.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(g=this.uiConfig.ads.enable)!==null&&g!==void 0?g:this.videoConfig.showAds,this.videoConfig.adsSlotId=(_=this.uiConfig.ads.slot)!==null&&_!==void 0?_:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(b=this.uiConfig.ads.preview)!==null&&b!==void 0?b:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((C=this.uiConfig.showLogo)!==null&&C!==void 0?C:!this.videoConfig.logoHidden),($=this.videoConfig).canRewindLive&&($.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(y=this.videoConfig.supportLink)!==null&&y!==void 0?y:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=h6.getLatestSupportedVersion():this.pictureInPictureApi=new Sr),this.mediaSessionApi=this.uiConfig.features.mediaSession?new l6:void 0,this.annotationsApi=this.uiConfig.features.annotations?new k6(this.rootContainer):void 0,(w=this.svelteStubComponent)===null||w===void 0||w.$destroy(),(k=this.svelteRootComponent)===null||k===void 0||k.$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]),p6(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}=Object.assign({},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(vt.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(vt.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)}setLanguage(e){var i;return ni(this,void 0,void 0,function*(){yield(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()}showInteractiveIndicatorTooltip(e,i=!1){var n;(n=this.microStoresRoot)===null||n===void 0||n.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}}const A6=()=>{window.customElements.define("vk-video-player",I6)};Object.defineProperty(exports,"VideoFormat",{enumerable:!0,get:function(){return tt.VideoFormat}});Object.defineProperty(exports,"VideoQuality",{enumerable:!0,get:function(){return tt.VideoQuality}});Object.defineProperty(exports,"InterfaceLanguage",{enumerable:!0,get:function(){return ie.InterfaceLanguage}});Object.defineProperty(exports,"VKNumericLanguage",{enumerable:!0,get:function(){return ie.VKNumericLanguage}});Object.defineProperty(exports,"loadVKLangPack",{enumerable:!0,get:function(){return ie.loadVKLangPack}});exports.VERSION=Tl;exports.registerPlayerWebComponent=A6;
|
|
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 f6({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))})})}remove(){return ni(this,void 0,void 0,function*(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)===null||i===void 0||i.close(),e()})})}dispose(){return ni(this,void 0,void 0,function*(){yield this.remove()})}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function p6(t){return t instanceof Rf}class h6{static getLatestSupportedVersion(){const e=new Sr,i=new Rf;if(i.isSupported())return i;if(e.isSupported())return e}}function Tu(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 v6="Inner error. Unexpectedly root annotation container null reference exception",g6="Annotation with such name already exists",b6="Annotation with such name does not exist";class lr extends Error{constructor(e){super(e),this.name="AnnotationError"}}const _6="1",w6=100;class k6{constructor(e){this.annotations=new Map,this.subscriptions=new ie.Subscription,this.rootAnnotationsContainer=e;const i=ie.throttleFn(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},w6);this.subscriptions.add(ie.observeElementSize(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 lr(v6);if(this.annotations.has(e))throw new lr(g6);i.style.zIndex=(n=i.style.zIndex)!==null&&n!==void 0?n:_6,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 lr(b6);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 Ll{init({store:e,microStores:i,config:n}){return ie.assertNonNullable(e),ie.assertNonNullable(i),ie.assertNonNullable(n),this.subscription=new ie.Subscription,this.subscription}}class y6 extends Ll{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$=Object.assign(Object.assign({},Le(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e){const i=super.init(e),{isInteractiveExpectation$:n}=e.store.state;return i.add(n.subscribe(l=>{this.state$.set(l?!0:null)})),i}}class C6 extends Ll{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$=Object.assign(Object.assign({},Le(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e){const i=super.init(e),{microStores:n,store:l}=e,{fakeIsPlaying$:r}=n,{isInteractiveExpectation$:o,isPlaying$:s}=l.state,{controlsVisible:a,isMobile:c}=l.ui,f=$e(c),d=()=>f&&$e(a);return i.add(a.subscribe(h=>{if(!f)return;const g=$e(r);$e(s)?this.state$.set(h):g!==null&&this.state$.set(!g||h)})),i.add(s.subscribe(h=>{this.state$.set(!h||d())})),i.add(r.subscribe(h=>{if(h===null)return;const g=$e(o);if(d()){this.state$.set(!0);return}g&&this.state$.set(!h)})),i}}class T6 extends Ll{constructor(){super(...arguments),this.stateName="seekToInteractiveDisabledTooltip$",this.state$=Le("tooltip_chapter_without_interactive")}init(e){const i=super.init(e),{store:n}=e;return i.add(n.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"))})),i}}const rr=Le(!1);let vl=null;class S6 extends Ll{constructor(){super(...arguments),this.stateName="showInteractiveTimeIndicatorTooltip$",this.state$=Object.assign(Object.assign({},rr),{set:(e,i=!1)=>{e!==$e(rr)&&(this.clearTimeout(),rr.set(e),!e&&vl&&(vl=!1),e&&i&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()})}init(e){const i=super.init(e),{store:n,config:l}=e,{isInteractiveTime$:r,isPlaying$:o}=n.state,s=n.ui.controlsVisible;i.add(s.subscribe(f=>{$e(r)&&f&&this.state$.set(!1)}));const a=(l==null?void 0:l.interactiveData)||{tooltipHelpHintActive:!1},c=ki([o,r],([f,d])=>f&&d);return i.add(c.subscribe(f=>{var d,h;const g=$e(o),_=$e(r);if(g){if(!_)return this.state$.set(!1);a.tooltipHelpHintActive&&vl===null&&(vl=!0,a.tooltipHelpHintActive=!1,this.state$.set(!0),(h=(d=n.callbacks)===null||d===void 0?void 0:d.onInteractiveTimeIndicatorHintDeactivated)===null||h===void 0||h.call(d))}})),i}clearTimeout(){window.clearTimeout(this.timeout)}}const P6=()=>[y6,C6,T6,S6].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:Object.assign(Object.assign({},e),{[n.stateName]:n.state$})}},{subscribers:[],stores:{}}),E6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:ie.InterfaceLanguage.RU,logoClickable:!1,logoHidden:!1,isMobile:ie.isMobile(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class I6 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 ie.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new ie.Subscription,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 o6({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,d,h,g,_,b,C;if(!this.videoConfig)return;const{albumId:y,statPlace:w,statUserSalt:k,statAuthToken:I,statTrackCode:$,refreshStatAuthToken:q,preload:D,autoplay:te,volume:re,muted:V,fromTime:X,canRewindLive:J,supportLink:B,showAds:A,adsSlotId:R,adsParams:ne={},adsPreviewParam:L,interfaceLanguage:G,logoClickable:we,logoHidden:Pe,isMobile:Ae,isAudioDisabled:Be,isLiveCatchUpMode:Ue,fullScreenTarget:me,failoverHosts:F,canDownload:ue,callbacks:be,interactiveData:We,showThumbTimer:Qe,additionalButtons:ce=[],repeat:Ee}=Tu(this.videoConfig,i),{sources:De,title:Ze,thumbUrl:pe,unitedVideoId:M,isClip:Se=!1,duration:se,adsParams:Ce={},videoEpisodes:Ke,previewThumbsData:ot,subtitles:rt,live:it}=e,pt=Object.assign(Object.assign({},ne),Ce),st=this.getNextVideoInfo(),he={sources:De,title:Ze,thumbUrl:pe,subtitles:rt,unitedVideoId:M,isClip:Se,live:it,albumId:y,statPlace:w,autoplay:te,muted:V,volume:re,fromTime:X,canRewindLive:J,showAds:A,adsSlotId:R,adsParams:pt,adsPreviewParam:L,duration:se,logoClickable:we,logoHidden:Pe,isMobile:Ae,repeat:Ee,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:st.nextVideoTitle,endScreenVideoThumb:st.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},at={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(he)}`});const It=this.uiConfig.features.statistics&&!!M,{pid:kt}=((r=(l=this.videoConfig)===null||l===void 0?void 0:l.interactiveData)===null||r===void 0?void 0:r.projectInfo)||{};It&&(this.statistics=new cg(Object.assign({movieId:M,albumId:y,place:w,trackCode:$,autoplay:(o=te&&!this.interactiveController)!==null&&o!==void 0?o:!1,mobile:Ae,clip:Se,refDomain:this.videoConfig.refDomain},kt&&!this.isInited&&{projectId:Number(kt)}),Object.assign({refreshAuthToken:q,userSalt:k,config:this.statisticsConfig},this.interactiveController&&{useIsid:!0,isid:this.prevIsid}))),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new pr(this.uiConfig.sentry,{version:Tl,env:F0},{movieId:M,albumId:y,place:w,autoplay:(s=te&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Ae,clip:Se}),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=Object.assign(Object.assign({},this.sentry),pr.getInstance());const Vt=!!We,ae=[];let yt="tooltip_interactive_go_back_disabled_first";if(Vt&&this.interactiveController){const Ge=this.interactiveController.state.isInitialChapter$.getValue(),He=this.interactiveController.getHistoryState();Ge&&ae.push(vt.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||ae.push(vt.SEEK_TO_INTERACTIVE_BUTTON),He.hasPrevChapter$.getValue()||(ae.push(vt.PLAY_PREV_CHAPTER_BUTTON),Ge||(He.isGoBackLimited$.getValue()?yt="tooltip_interactive_go_back_disabled_limit":yt="tooltip_interactive_go_back_disabled"))}const Et=()=>{var Ge;this.isInited=!1,this.prevIsid=void 0;const He=(n==null?void 0:n.info.isEnded$.getValue())&&((Ge=this.interactiveController)===null||Ge===void 0?void 0:Ge.state.isEndChapter$.getValue());be.onReplayInteractiveVideo&&!He?be.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=fg({player:n,interfaceLanguage:G,videoId:M,isClip:Se,isLiveCatchUpMode:Ue,isAudioDisabled:Be,statAuthToken:I,callbacks:be,webApi:at,videoEpisodes:Ke,previewThumbsData:ot,canDownload:ue,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:ae,isInteractive:Vt,interactiveRanges$:(f=this.interactiveController)===null||f===void 0?void 0:f.state.interactiveRanges$,isInteractiveTime$:(d=this.interactiveController)===null||d===void 0?void 0:d.state.isInteractiveTime$,replayInteractive:Et,playPrevChapterDisabledTooltip:yt,hasInteractiveBranches:!!(!((g=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||g===void 0)&&g.length),additionalButtons:this.uiConfig.features.additionalButtons?ce:[],looped:Ee&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:ht}=this.microStoresRoot=P6();this.subscription.add(this.store.state.currentFormat$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onCurrentFormatChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(ht.interactiveControlsOpacity$.subscribe(Ge=>{var He;Ge!==null&&((He=this===null||this===void 0?void 0:this.interactiveController)===null||He===void 0||He.setDisabledControls(Ge))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onThroughputEstimationChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onTrafficSavingEnabledChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onCurrentPlaybackRateChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.volume$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onVolumeChange)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.muted$.subscribe(Ge=>{var He,Ne;return Ge?(He=be==null?void 0:be.onMute)===null||He===void 0?void 0:He.call(be):(Ne=be==null?void 0:be.onUnmute)===null||Ne===void 0?void 0:Ne.call(be)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Ge=>{var He;return(He=be==null?void 0:be.onVideoBitrateChanged)===null||He===void 0?void 0:He.call(be,Ge)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Ge=>{var He;const Ne=(He=this.store)===null||He===void 0?void 0:He.ui.controls.disabledControls$;Ne&&(Ge&&!Ne.includes(bl)&&Ne.add(bl),Ge||Ne.remove(bl))})),this.initMediaSession(),this.interactiveController&&It&&this.initInteractivesStatistics(),this.svelteRootComponent=new J_({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:De,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:Ze,thumbUrl:pe,subtitles:rt,live:it,preload:D,autoplay:te,muted:V,volume:re,fromTime:X,canRewindLive:J,supportLink:B,showAds:A,adsSlotId:R,adsParams:pt,adsPreviewParam:L,duration:se,logoClickable:we,logoHidden:Pe,isMobile:Ae,failoverHosts:F,fullScreenTarget:me,showMiniTimer:Qe,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:st.nextVideoTitle,endScreenVideoThumb:st.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,(C=(b=(_=this.videoConfig)===null||_===void 0?void 0:_.callbacks)===null||b===void 0?void 0:b.onInited)===null||C===void 0||C.call(b))}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!==Bo.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.interactiveTimeIndicator.subscribe(r=>{var o;return(o=l.onInteractiveTimeIndicatorChanged)===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&&ie.isNonNullable(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=$e(l),c=$e(r);$e(o)?(o.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),s.remove(Yr),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",o.set(!0),(i=this.interactiveController)===null||i===void 0||i.toggleGraphView(!0),s.add(Yr),!a&&this.graphMadePause&&this.pause())}initInteractives(){var e,i,n,l;return ni(this,void 0,void 0,function*(){if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:r,EVENT_NAMES:o,CustomError:s}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.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?$e(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:d,historyApi:h,videoLoader:g}=this.videoConfig.interactiveData;this.interactiveController=new r({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:d,historyApi:h,vkVideoLoader:g,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig});const{isInteractiveExpectation$:_}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(C=>{if(!this.isInited)return;const y=this.store;C?y.ui.controls.disabledControls$.remove(vt.SEEK_TO_INTERACTIVE_BUTTON):y.ui.controls.disabledControls$.add(vt.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(_.subscribe(C=>{this.store&&this.store.state.isInteractiveExpectation$.set(C)}));let b=!0;if(this.interactiveController.on(o.playerChanged,C=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]=Object.assign(Object.assign({},C.config),{title:(f==null?void 0:f.title)||C.config.title});const y=b?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(C.player,y),b&&(b=!1)}),this.interactiveController.on(o.interactives,({type:C,actionType:y})=>{var w,k,I,$;if(!this.store)return;const q=_.getValue();if(C==="action-choice"&&y==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Ou)),C==="action-choice-canceled"){const D=$e(this.store.state.isPlaying$)||q;if(!((w=this.videoConfig)===null||w===void 0)&&w.isMobile&&D){this.store.ui.interactiveHideMobileControls.set(!0);return}($=(k=this.videoConfig)===null||k===void 0?void 0:(I=k.callbacks).onDisabledInteractiveClick)===null||$===void 0||$.call(I)}}),yield this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),!((l=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||l===void 0)&&l.onInteractiveHistoryChanged){const C=this.interactiveController.getHistoryState();this.subscription.add(C.history$.subscribe(y=>{var w,k,I;y.length&&((I=(k=(w=this.videoConfig)===null||w===void 0?void 0:w.callbacks)===null||k===void 0?void 0:k.onInteractiveHistoryChanged)===null||I===void 0||I.call(k,y))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var C,y,w,k;(C=this.microStoresRoot)===null||C===void 0||C.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(k=(y=this.videoConfig)===null||y===void 0?void 0:(w=y.callbacks).onInteractiveTimeIndicatorClick)===null||k===void 0||k.call(w)})),this.interactiveController.on(o.errors,C=>{this.log({message:C.toString()})})}catch(r){this.log({message:r.message})}})}initInteractivesStatistics(){var e,i;return ni(this,void 0,void 0,function*(){const{statSubscription:n,oneStat:l}=this.statistics;if(!(!n||!l||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:r}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.js"),o={[r.GO_NEXT_BUTTON]:St.InteractiveInterfaceClick.NEXT_BUTTON,[r.GO_NEXT_AREA]:St.InteractiveInterfaceClick.NEXT_AREA,[r.WATCH_AGAIN]:St.InteractiveInterfaceClick.WATCH_AGAIN,[r.OPEN_GRAPH]:St.InteractiveInterfaceClick.GRAPH_SHOW,[r.CLOSE_GRAPH]:St.InteractiveInterfaceClick.GRAPH_HIDE},{click$:s,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new ie.Subject;s.subscribe(f=>{var d,h;f in o?c.next(o[f]):(l==null||l.logError({errorType:"InteractiveVideosAction",fatal:!1}),(h=(d=this.sentry).report)===null||h===void 0||h.call(d,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,d,h,g,_,b,C,y,w,k,I,$;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=Tu(E6,ie.cloneDeepWith(e,q=>q instanceof HTMLElement?q:void 0)),this.uiConfig=V0((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:{}},ie.isNonNullable(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(s=this.videoConfig.isMediaSessionEnabled)!==null&&s!==void 0?s:!0),ie.isNonNullable(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=(d=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&d!==void 0?d:!0),this.videoConfig.isMobile=(h=this.uiConfig.isMobile)!==null&&h!==void 0?h:this.videoConfig.isMobile,(I=this.videoConfig).autoplay&&(I.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(g=this.uiConfig.ads.enable)!==null&&g!==void 0?g:this.videoConfig.showAds,this.videoConfig.adsSlotId=(_=this.uiConfig.ads.slot)!==null&&_!==void 0?_:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(b=this.uiConfig.ads.preview)!==null&&b!==void 0?b:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((C=this.uiConfig.showLogo)!==null&&C!==void 0?C:!this.videoConfig.logoHidden),($=this.videoConfig).canRewindLive&&($.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(y=this.videoConfig.supportLink)!==null&&y!==void 0?y:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=h6.getLatestSupportedVersion():this.pictureInPictureApi=new Sr),this.mediaSessionApi=this.uiConfig.features.mediaSession?new l6:void 0,this.annotationsApi=this.uiConfig.features.annotations?new k6(this.rootContainer):void 0,(w=this.svelteStubComponent)===null||w===void 0||w.$destroy(),(k=this.svelteRootComponent)===null||k===void 0||k.$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]),p6(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}=Object.assign({},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(vt.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(vt.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)}setLanguage(e){var i;return ni(this,void 0,void 0,function*(){yield(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()}showInteractiveIndicatorTooltip(e,i=!1){var n;(n=this.microStoresRoot)===null||n===void 0||n.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}}const A6=()=>{window.customElements.define("vk-video-player",I6)};Object.defineProperty(exports,"VideoFormat",{enumerable:!0,get:function(){return tt.VideoFormat}});Object.defineProperty(exports,"VideoQuality",{enumerable:!0,get:function(){return tt.VideoQuality}});Object.defineProperty(exports,"InterfaceLanguage",{enumerable:!0,get:function(){return ie.InterfaceLanguage}});Object.defineProperty(exports,"VKNumericLanguage",{enumerable:!0,get:function(){return ie.VKNumericLanguage}});Object.defineProperty(exports,"loadVKLangPack",{enumerable:!0,get:function(){return ie.loadVKLangPack}});exports.VERSION=Tl;exports.registerPlayerWebComponent=A6;
|