@vkontakte/videoplayer 1.1.36-dev.55db5eff.0 → 1.1.36-dev.cdb7114a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/evergreen.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @vkontakte/videoplayer v1.1.36-dev.55db5eff.0
3
- * Fri, 31 May 2024 10:58:23 GMT
2
+ * @vkontakte/videoplayer v1.1.36-dev.cdb7114a.0
3
+ * Fri, 31 May 2024 07:45:19 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-1-36/doc/
5
5
  */
6
- import{VERSION as vc,ChromecastState as Vn,PlaybackState as Nt,VideoQuality as uo,Player as kc,VideoFormat as Po}from"@vkontakte/videoplayer-core/evergreen.esm.js";import{VideoFormat as T5,VideoQuality as E5}from"@vkontakte/videoplayer-core/evergreen.esm.js";import{InterfaceLanguage as Ao,VideoQuality as Qo,fillWithDefault as wc,VERSION as yc,assertNonNullable as ut,safeStorage as wn,isNullable as xo,Subscription as Jn,isNonNullable as vn,isMacLike as os,debounceFn as Cc,ValueSubject as Al,getCurrentBrowser as Ll,CurrentClientBrowser as m1,noop as je,checkNever as Pc,timeCodeToString as Sc,Subject as cn,addScript as Tc,Logger as p1,merge as Ec,Observable as Ic,map as Ac,loadVKLangPack as Lc,isIOS as Vl,getHighestQuality as Vc,throttleFn as tl,CurrentClientDevice as Mc,getIOSVersion as Bc,detectEmbed as Rc,observeElementSize as Nc,isMobile as Dc,cloneDeepWith as zc}from"@vkontakte/videoplayer-shared/evergreen.esm.js";import{InterfaceLanguage as A5,VKNumericLanguage as L5,loadVKLangPack as V5}from"@vkontakte/videoplayer-shared/evergreen.esm.js";import{VERSION as Oc,SeekAction as At,OneStat as Hc,InteractiveInterfaceClick as So}from"@vkontakte/videoplayer-statistics/evergreen.esm.js";import"@vkontakte/videoplayer-interactive/evergreen.esm.js";function Z(){}function h1(t,e){for(const i in e)t[i]=e[i];return t}function g1(t){return t()}function ls(){return Object.create(null)}function tt(t){t.forEach(g1)}function kn(t){return typeof t=="function"}function ge(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Fo;function ss(t,e){return Fo||(Fo=document.createElement("a")),Fo.href=e,t===Fo.href}function Fc(t){return Object.keys(t).length===0}function Kt(t,...e){if(t==null){for(const n of e)n(void 0);return Z}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function xe(t){let e;return Kt(t,i=>e=i)(),e}function D(t,e,i){t.$$.on_destroy.push(Kt(e,i))}function Hn(t,e,i,n){if(t){const o=b1(t,e,i,n);return t[0](o)}}function b1(t,e,i,n){return t[1]&&n?h1(i.ctx.slice(),t[1](n(e))):i.ctx}function Fn(t,e,i,n){if(t[2]&&n){const o=t[2](n(i));if(e.dirty===void 0)return o;if(typeof o=="object"){const s=[],l=Math.max(e.dirty.length,o.length);for(let r=0;r<l;r+=1)s[r]=e.dirty[r]|o[r];return s}return e.dirty|o}return e.dirty}function Un(t,e,i,n,o,s){if(o){const l=b1(e,i,n,s);t.p(l,o)}}function qn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function Uc(t){return t??""}const il=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function m(t,e){t.appendChild(e)}function Ze(t,e,i){const n=qc(t);if(!n.getElementById(e)){const o=E("style");o.id=e,o.textContent=i,Zc(n,o)}}function qc(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Zc(t,e){return m(t.head||t,e),e.sheet}function T(t,e,i){t.insertBefore(e,i||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function yn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function E(t){return document.createElement(t)}function R(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ze(t){return document.createTextNode(t)}function N(){return ze(" ")}function at(){return ze("")}function pe(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Gt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function nt(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 Wc(t){return Array.from(t.childNodes)}function Je(t,e){e=""+e,t.data!==e&&(t.data=e)}function Pt(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let Uo;function Kc(){if(Uo===void 0){Uo=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{Uo=!0}}return Uo}function Ml(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=E("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 o=Kc();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=pe(window,"message",l=>{l.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=pe(n.contentWindow,"resize",e),e()}),m(t,n),()=>{(o||s&&n.contentWindow)&&s(),S(n)}}function B(t,e,i){t.classList.toggle(e,!!i)}function Mn(t,e){return new t(e)}let Eo;function To(t){Eo=t}function Lo(){if(!Eo)throw new Error("Function called outside component initialization");return Eo}function rn(t){Lo().$$.on_mount.push(t)}function nl(t){Lo().$$.on_destroy.push(t)}function Cl(t,e){return Lo().$$.context.set(t,e),e}function Bl(t){return Lo().$$.context.get(t)}function _1(){return Lo().$$.context}function ho(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const co=[],ke=[];let mo=[];const Pl=[],v1=Promise.resolve();let Sl=!1;function k1(){Sl||(Sl=!0,v1.then(w1))}function Vo(){return k1(),v1}function go(t){mo.push(t)}function Fe(t){Pl.push(t)}const ml=new Set;let so=0;function w1(){if(so!==0)return;const t=Eo;do{try{for(;so<co.length;){const e=co[so];so++,To(e),jc(e.$$)}}catch(e){throw co.length=0,so=0,e}for(To(null),co.length=0,so=0;ke.length;)ke.pop()();for(let e=0;e<mo.length;e+=1){const i=mo[e];ml.has(i)||(ml.add(i),i())}mo.length=0}while(co.length);for(;Pl.length;)Pl.pop()();Sl=!1,ml.clear(),To(t)}function jc(t){if(t.fragment!==null){t.update(),tt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(go)}}function Gc(t){const e=[],i=[];mo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),mo=e}const Xo=new Set;let to;function fe(){to={r:0,c:[],p:to}}function de(){to.r||tt(to.c),to=to.p}function d(t,e){t&&t.i&&(Xo.delete(t),t.i(e))}function g(t,e,i,n){if(t&&t.o){if(Xo.has(t))return;Xo.add(t),to.c.push(()=>{Xo.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Dt(t){return t?.length!==void 0?t:Array.from(t)}function Yc(t,e){const i={},n={},o={$$scope:1};let s=t.length;for(;s--;){const l=t[s],r=e[s];if(r){for(const a in l)a in r||(n[a]=1);for(const a in r)o[a]||(i[a]=r[a],o[a]=1);t[s]=r}else for(const a in l)o[a]=1}for(const l in n)l in i||(i[l]=void 0);return i}function Qc(t){return typeof t=="object"&&t!==null?t:{}}function Ue(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function F(t){t&&t.c()}function z(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),go(()=>{const s=t.$$.on_mount.map(g1).filter(kn);t.$$.on_destroy?t.$$.on_destroy.push(...s):tt(s),t.$$.on_mount=[]}),o.forEach(go)}function O(t,e){const i=t.$$;i.fragment!==null&&(Gc(i.after_update),tt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Xc(t,e){t.$$.dirty[0]===-1&&(co.push(t),k1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function be(t,e,i,n,o,s,l,r=[-1]){const a=Eo;To(t);const c=t.$$={fragment:null,ctx:[],props:s,update:Z,not_equal:o,bound:ls(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:ls(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};l&&l(c.root);let f=!1;if(c.ctx=i?i(t,e.props||{},(p,h,..._)=>{const b=_.length?_[0]:h;return c.ctx&&o(c.ctx[p],c.ctx[p]=b)&&(!c.skip_bound&&c.bound[p]&&c.bound[p](b),f&&Xc(t,p)),h}):[],c.update(),f=!0,tt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const p=Wc(e.target);c.fragment&&c.fragment.l(p),p.forEach(S)}else c.fragment&&c.fragment.c();e.intro&&d(t.$$.fragment),z(t,e.target,e.anchor),w1()}To(a)}class _e{$$=void 0;$$set=void 0;$destroy(){O(this,1),this.$destroy=Z}$on(e,i){if(!kn(i))return Z;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const o=n.indexOf(i);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!Fc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Jc="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jc);var bo;(function(t){t.VK="vk",t.VK_VIDEO="vk_video"})(bo||(bo={}));const xc={isMobile:void 0,defaultLanguage:Ao.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:bo.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:Qo.Q_480P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,additionalButtons:!0,contextMenuButton:!0},controls:{hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,slot:void 0,preview:void 0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},$c=t=>wc(t,xc),ef=t=>Cl("ui-config",t),an=()=>Bl("ui-config"),Tl="vk_player_debug_panel_opened",y1=300,tf=100,nf="videoplayer",of="videoplayer";var Ee;(function(t){t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Comma="Comma",t.Period="Period",t.Space="Space",t.KeyM="KeyM",t.KeyF="KeyF",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyJ="KeyJ",t.KeyC="KeyC",t.KeyI="KeyI",t.Digit1="Digit1",t.Digit2="Digit2",t.Digit3="Digit3",t.Digit4="Digit4",t.Digit5="Digit5",t.Digit6="Digit6",t.Digit7="Digit7",t.Digit8="Digit8",t.Digit9="Digit9",t.Digit0="Digit0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Numpad0="Numpad0",t.ShiftLeft="ShiftLeft",t.ShiftRight="ShiftRight",t.Slash="Slash",t.Tab="Tab",t.Escape="Escape",t.Enter="Enter"})(Ee||(Ee={}));const Mo={[Ee.KeyF]:"f",[Ee.KeyK]:"k",[Ee.KeyC]:"c",[Ee.KeyM]:"m"},lf=new Set([Ee.ArrowLeft,Ee.ArrowRight,Ee.KeyL,Ee.KeyJ]),sf=new Set([Ee.Tab,Ee.Space,Ee.ArrowLeft,Ee.ArrowRight,Ee.ArrowUp,Ee.ArrowDown]),rf=new Set([Ee.ShiftRight,Ee.ShiftLeft]);var st;(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"})(st||(st={}));const rs=40,C1=260,af=60,qo=8,P1=[st.TIMELINE],Jo=[...P1,st.GRAPH_BUTTON],as=[...P1,st.PLAY_BUTTON],S1=[...Jo,st.PLAY_BUTTON];var fo;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(fo||(fo={}));var vt;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(vt||(vt={}));const _o={[vt.XS]:0,[vt.S]:1,[vt.M]:2,[vt.L]:3,[vt.XL]:4},ro=[];function Ln(t,e){return{subscribe:Ve(t,e).subscribe}}function Ve(t,e=Z){let i;const n=new Set;function o(r){if(ge(t,r)&&(t=r,i)){const a=!ro.length;for(const c of n)c[1](),ro.push(c,t);if(a){for(let c=0;c<ro.length;c+=2)ro[c][0](ro[c+1]);ro.length=0}}}function s(r){o(r(t))}function l(r,a=Z){const c=[r,a];return n.add(c),n.size===1&&(i=e(o,s)||Z),r(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:o,update:s,subscribe:l}}function Ni(t,e,i){const n=!Array.isArray(t),o=n?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Ln(i,(l,r)=>{let a=!1;const c=[];let f=0,p=Z;const h=()=>{if(f)return;p();const b=e(n?c[0]:c,l,r);s?l(b):p=kn(b)?b:Z},_=o.map((b,k)=>Kt(b,v=>{c[k]=v,f&=~(1<<k),a&&h()},()=>{f|=1<<k}));return a=!0,h(),function(){tt(_),p(),a=!1}})}const uf="prod",Rl="1.1.36-dev.55db5eff.0",T1=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},E1=Symbol("storeContext"),I1=Symbol("microStoresContext"),cf=(t,e)=>{Cl(E1,t),Cl(I1,e)},dt=()=>{const t=Bl(E1);return ut(t,"Store context is empty!"),t},Bo=()=>{const t=Bl(I1);return ut(t,"MicroStores context is empty!"),t},ft=(t,e)=>A1(t,t.getValue(),e),A1=(t,e,i)=>Ln(e,n=>{const o=t.subscribe(s=>{n(s),i?.(s)});return()=>o.unsubscribe()}),ff=(t,e,i)=>{const n=t.info,{width:o,height:s}=xe(i.ui.playerSize),l=n.throughputEstimation$.getValue()?.toFixed(0)??0,r=n.rttEstimation$.getValue()?.toFixed(0)??0,a=n.isAutoQualityEnabled$.getValue()?"auto":"manual",c=`${Rl} (core: ${vc}, stat: ${Oc}, shared: ${yc})`,f=xe(i.state.errorLog$),p=f.length?`
6
+ import{VERSION as vc,ChromecastState as Vn,PlaybackState as Nt,VideoQuality as uo,Player as kc,VideoFormat as Po}from"@vkontakte/videoplayer-core/evergreen.esm.js";import{VideoFormat as T5,VideoQuality as E5}from"@vkontakte/videoplayer-core/evergreen.esm.js";import{InterfaceLanguage as Ao,VideoQuality as Qo,fillWithDefault as wc,VERSION as yc,assertNonNullable as ut,safeStorage as wn,isNullable as xo,Subscription as Jn,isNonNullable as vn,isMacLike as os,debounceFn as Cc,ValueSubject as Al,getCurrentBrowser as Ll,CurrentClientBrowser as m1,noop as je,checkNever as Pc,timeCodeToString as Sc,Subject as cn,addScript as Tc,Logger as p1,merge as Ec,Observable as Ic,map as Ac,loadVKLangPack as Lc,isIOS as Vl,getHighestQuality as Vc,throttleFn as tl,CurrentClientDevice as Mc,getIOSVersion as Bc,detectEmbed as Rc,observeElementSize as Nc,isMobile as Dc,cloneDeepWith as zc}from"@vkontakte/videoplayer-shared/evergreen.esm.js";import{InterfaceLanguage as A5,VKNumericLanguage as L5,loadVKLangPack as V5}from"@vkontakte/videoplayer-shared/evergreen.esm.js";import{VERSION as Oc,SeekAction as At,OneStat as Hc,InteractiveInterfaceClick as So}from"@vkontakte/videoplayer-statistics/evergreen.esm.js";import"@vkontakte/videoplayer-interactive/evergreen.esm.js";function Z(){}function h1(t,e){for(const i in e)t[i]=e[i];return t}function g1(t){return t()}function ls(){return Object.create(null)}function tt(t){t.forEach(g1)}function kn(t){return typeof t=="function"}function ge(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Fo;function ss(t,e){return Fo||(Fo=document.createElement("a")),Fo.href=e,t===Fo.href}function Fc(t){return Object.keys(t).length===0}function Kt(t,...e){if(t==null){for(const n of e)n(void 0);return Z}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function xe(t){let e;return Kt(t,i=>e=i)(),e}function D(t,e,i){t.$$.on_destroy.push(Kt(e,i))}function Hn(t,e,i,n){if(t){const o=b1(t,e,i,n);return t[0](o)}}function b1(t,e,i,n){return t[1]&&n?h1(i.ctx.slice(),t[1](n(e))):i.ctx}function Fn(t,e,i,n){if(t[2]&&n){const o=t[2](n(i));if(e.dirty===void 0)return o;if(typeof o=="object"){const s=[],l=Math.max(e.dirty.length,o.length);for(let r=0;r<l;r+=1)s[r]=e.dirty[r]|o[r];return s}return e.dirty|o}return e.dirty}function Un(t,e,i,n,o,s){if(o){const l=b1(e,i,n,s);t.p(l,o)}}function qn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function Uc(t){return t??""}const il=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function m(t,e){t.appendChild(e)}function Ze(t,e,i){const n=qc(t);if(!n.getElementById(e)){const o=E("style");o.id=e,o.textContent=i,Zc(n,o)}}function qc(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Zc(t,e){return m(t.head||t,e),e.sheet}function T(t,e,i){t.insertBefore(e,i||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function yn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function E(t){return document.createElement(t)}function R(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ze(t){return document.createTextNode(t)}function N(){return ze(" ")}function at(){return ze("")}function pe(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Gt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function nt(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 Wc(t){return Array.from(t.childNodes)}function Je(t,e){e=""+e,t.data!==e&&(t.data=e)}function Pt(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let Uo;function Kc(){if(Uo===void 0){Uo=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{Uo=!0}}return Uo}function Ml(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=E("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 o=Kc();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=pe(window,"message",l=>{l.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=pe(n.contentWindow,"resize",e),e()}),m(t,n),()=>{(o||s&&n.contentWindow)&&s(),S(n)}}function B(t,e,i){t.classList.toggle(e,!!i)}function Mn(t,e){return new t(e)}let Eo;function To(t){Eo=t}function Lo(){if(!Eo)throw new Error("Function called outside component initialization");return Eo}function rn(t){Lo().$$.on_mount.push(t)}function nl(t){Lo().$$.on_destroy.push(t)}function Cl(t,e){return Lo().$$.context.set(t,e),e}function Bl(t){return Lo().$$.context.get(t)}function _1(){return Lo().$$.context}function ho(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const co=[],ke=[];let mo=[];const Pl=[],v1=Promise.resolve();let Sl=!1;function k1(){Sl||(Sl=!0,v1.then(w1))}function Vo(){return k1(),v1}function go(t){mo.push(t)}function Fe(t){Pl.push(t)}const ml=new Set;let so=0;function w1(){if(so!==0)return;const t=Eo;do{try{for(;so<co.length;){const e=co[so];so++,To(e),jc(e.$$)}}catch(e){throw co.length=0,so=0,e}for(To(null),co.length=0,so=0;ke.length;)ke.pop()();for(let e=0;e<mo.length;e+=1){const i=mo[e];ml.has(i)||(ml.add(i),i())}mo.length=0}while(co.length);for(;Pl.length;)Pl.pop()();Sl=!1,ml.clear(),To(t)}function jc(t){if(t.fragment!==null){t.update(),tt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(go)}}function Gc(t){const e=[],i=[];mo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),mo=e}const Xo=new Set;let to;function fe(){to={r:0,c:[],p:to}}function de(){to.r||tt(to.c),to=to.p}function d(t,e){t&&t.i&&(Xo.delete(t),t.i(e))}function g(t,e,i,n){if(t&&t.o){if(Xo.has(t))return;Xo.add(t),to.c.push(()=>{Xo.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Dt(t){return t?.length!==void 0?t:Array.from(t)}function Yc(t,e){const i={},n={},o={$$scope:1};let s=t.length;for(;s--;){const l=t[s],r=e[s];if(r){for(const a in l)a in r||(n[a]=1);for(const a in r)o[a]||(i[a]=r[a],o[a]=1);t[s]=r}else for(const a in l)o[a]=1}for(const l in n)l in i||(i[l]=void 0);return i}function Qc(t){return typeof t=="object"&&t!==null?t:{}}function Ue(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function F(t){t&&t.c()}function z(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),go(()=>{const s=t.$$.on_mount.map(g1).filter(kn);t.$$.on_destroy?t.$$.on_destroy.push(...s):tt(s),t.$$.on_mount=[]}),o.forEach(go)}function O(t,e){const i=t.$$;i.fragment!==null&&(Gc(i.after_update),tt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Xc(t,e){t.$$.dirty[0]===-1&&(co.push(t),k1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function be(t,e,i,n,o,s,l,r=[-1]){const a=Eo;To(t);const c=t.$$={fragment:null,ctx:[],props:s,update:Z,not_equal:o,bound:ls(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:ls(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};l&&l(c.root);let f=!1;if(c.ctx=i?i(t,e.props||{},(p,h,..._)=>{const b=_.length?_[0]:h;return c.ctx&&o(c.ctx[p],c.ctx[p]=b)&&(!c.skip_bound&&c.bound[p]&&c.bound[p](b),f&&Xc(t,p)),h}):[],c.update(),f=!0,tt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const p=Wc(e.target);c.fragment&&c.fragment.l(p),p.forEach(S)}else c.fragment&&c.fragment.c();e.intro&&d(t.$$.fragment),z(t,e.target,e.anchor),w1()}To(a)}class _e{$$=void 0;$$set=void 0;$destroy(){O(this,1),this.$destroy=Z}$on(e,i){if(!kn(i))return Z;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const o=n.indexOf(i);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!Fc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Jc="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jc);var bo;(function(t){t.VK="vk",t.VK_VIDEO="vk_video"})(bo||(bo={}));const xc={isMobile:void 0,defaultLanguage:Ao.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:bo.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:Qo.Q_480P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,additionalButtons:!0,contextMenuButton:!0},controls:{hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,slot:void 0,preview:void 0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},$c=t=>wc(t,xc),ef=t=>Cl("ui-config",t),an=()=>Bl("ui-config"),Tl="vk_player_debug_panel_opened",y1=300,tf=100,nf="videoplayer",of="videoplayer";var Ee;(function(t){t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Comma="Comma",t.Period="Period",t.Space="Space",t.KeyM="KeyM",t.KeyF="KeyF",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyJ="KeyJ",t.KeyC="KeyC",t.KeyI="KeyI",t.Digit1="Digit1",t.Digit2="Digit2",t.Digit3="Digit3",t.Digit4="Digit4",t.Digit5="Digit5",t.Digit6="Digit6",t.Digit7="Digit7",t.Digit8="Digit8",t.Digit9="Digit9",t.Digit0="Digit0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Numpad0="Numpad0",t.ShiftLeft="ShiftLeft",t.ShiftRight="ShiftRight",t.Slash="Slash",t.Tab="Tab",t.Escape="Escape",t.Enter="Enter"})(Ee||(Ee={}));const Mo={[Ee.KeyF]:"f",[Ee.KeyK]:"k",[Ee.KeyC]:"c",[Ee.KeyM]:"m"},lf=new Set([Ee.ArrowLeft,Ee.ArrowRight,Ee.KeyL,Ee.KeyJ]),sf=new Set([Ee.Tab,Ee.Space,Ee.ArrowLeft,Ee.ArrowRight,Ee.ArrowUp,Ee.ArrowDown]),rf=new Set([Ee.ShiftRight,Ee.ShiftLeft]);var st;(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"})(st||(st={}));const rs=40,C1=260,af=60,qo=8,P1=[st.TIMELINE],Jo=[...P1,st.GRAPH_BUTTON],as=[...P1,st.PLAY_BUTTON],S1=[...Jo,st.PLAY_BUTTON];var fo;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(fo||(fo={}));var vt;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(vt||(vt={}));const _o={[vt.XS]:0,[vt.S]:1,[vt.M]:2,[vt.L]:3,[vt.XL]:4},ro=[];function Ln(t,e){return{subscribe:Ve(t,e).subscribe}}function Ve(t,e=Z){let i;const n=new Set;function o(r){if(ge(t,r)&&(t=r,i)){const a=!ro.length;for(const c of n)c[1](),ro.push(c,t);if(a){for(let c=0;c<ro.length;c+=2)ro[c][0](ro[c+1]);ro.length=0}}}function s(r){o(r(t))}function l(r,a=Z){const c=[r,a];return n.add(c),n.size===1&&(i=e(o,s)||Z),r(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:o,update:s,subscribe:l}}function Ni(t,e,i){const n=!Array.isArray(t),o=n?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Ln(i,(l,r)=>{let a=!1;const c=[];let f=0,p=Z;const h=()=>{if(f)return;p();const b=e(n?c[0]:c,l,r);s?l(b):p=kn(b)?b:Z},_=o.map((b,k)=>Kt(b,v=>{c[k]=v,f&=~(1<<k),a&&h()},()=>{f|=1<<k}));return a=!0,h(),function(){tt(_),p(),a=!1}})}const uf="prod",Rl="1.1.36-dev.cdb7114a.0",T1=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},E1=Symbol("storeContext"),I1=Symbol("microStoresContext"),cf=(t,e)=>{Cl(E1,t),Cl(I1,e)},dt=()=>{const t=Bl(E1);return ut(t,"Store context is empty!"),t},Bo=()=>{const t=Bl(I1);return ut(t,"MicroStores context is empty!"),t},ft=(t,e)=>A1(t,t.getValue(),e),A1=(t,e,i)=>Ln(e,n=>{const o=t.subscribe(s=>{n(s),i?.(s)});return()=>o.unsubscribe()}),ff=(t,e,i)=>{const n=t.info,{width:o,height:s}=xe(i.ui.playerSize),l=n.throughputEstimation$.getValue()?.toFixed(0)??0,r=n.rttEstimation$.getValue()?.toFixed(0)??0,a=n.isAutoQualityEnabled$.getValue()?"auto":"manual",c=`${Rl} (core: ${vc}, stat: ${Oc}, shared: ${yc})`,f=xe(i.state.errorLog$),p=f.length?`
7
7
  `+f.map((b,k)=>{const v=`${k}) Type: ${b.id}
8
8
  `,P=`Message: ${b.message} (${b.thrown})
9
9
  `,y=`Trace: ${b.thrown?.stack}
@@ -48,4 +48,4 @@ import{VERSION as vc,ChromecastState as Vn,PlaybackState as Nt,VideoQuality as u
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 zh(t){let e,i,n;function o(l){t[56](l)}let s={store:t[0],uiConfig:t[35],title:t[1],thumbUrl:t[2],videoLogoUrl:t[3],interactiveContainer:t[4],live:t[5],autoplay:t[6],canRewindLive:t[7],showAds:t[8],adsSlotId:t[9],adsParams:t[10],adsPreviewParam:t[11],duration:t[12],logoClickable:t[13],logoHidden:t[14],showNextPrevButtons:t[16],nextButtonActive:t[17],prevButtonActive:t[18],endScreenVideoTitle:t[19],endScreenVideoThumb:t[20],isOneVideoPlaylist:t[21],supportLink:t[22],outerContainerRef:t[23],fullScreenTarget:t[24],showMiniTimer:t[25],playerStarted:t[34],playNextVideo:t[26],playPrevVideo:t[27],repeatPlaylist:t[28],seekToInteractive:t[29],toggleGraph:t[30],playPrevChapter:t[31],firstStart:t[36]};return t[33]!==void 0&&(s.videoContainer=t[33]),e=new Ph({props:s}),ke.push(()=>Ue(e,"videoContainer",o)),{c(){F(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){const a={};r[0]&1&&(a.store=l[0]),r[0]&2&&(a.title=l[1]),r[0]&4&&(a.thumbUrl=l[2]),r[0]&8&&(a.videoLogoUrl=l[3]),r[0]&16&&(a.interactiveContainer=l[4]),r[0]&32&&(a.live=l[5]),r[0]&64&&(a.autoplay=l[6]),r[0]&128&&(a.canRewindLive=l[7]),r[0]&256&&(a.showAds=l[8]),r[0]&512&&(a.adsSlotId=l[9]),r[0]&1024&&(a.adsParams=l[10]),r[0]&2048&&(a.adsPreviewParam=l[11]),r[0]&4096&&(a.duration=l[12]),r[0]&8192&&(a.logoClickable=l[13]),r[0]&16384&&(a.logoHidden=l[14]),r[0]&65536&&(a.showNextPrevButtons=l[16]),r[0]&131072&&(a.nextButtonActive=l[17]),r[0]&262144&&(a.prevButtonActive=l[18]),r[0]&524288&&(a.endScreenVideoTitle=l[19]),r[0]&1048576&&(a.endScreenVideoThumb=l[20]),r[0]&2097152&&(a.isOneVideoPlaylist=l[21]),r[0]&4194304&&(a.supportLink=l[22]),r[0]&8388608&&(a.outerContainerRef=l[23]),r[0]&16777216&&(a.fullScreenTarget=l[24]),r[0]&33554432&&(a.showMiniTimer=l[25]),r[1]&8&&(a.playerStarted=l[34]),r[0]&67108864&&(a.playNextVideo=l[26]),r[0]&134217728&&(a.playPrevVideo=l[27]),r[0]&268435456&&(a.repeatPlaylist=l[28]),r[0]&536870912&&(a.seekToInteractive=l[29]),r[0]&1073741824&&(a.toggleGraph=l[30]),r[1]&1&&(a.playPrevChapter=l[31]),!i&&r[1]&4&&(i=!0,a.videoContainer=l[33],Fe(()=>i=!1)),e.$set(a)},i(l){n||(d(e.$$.fragment,l),n=!0)},o(l){g(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function Oh(t){let e,i,n;function o(l){t[55](l)}let s={store:t[0],uiConfig:t[35],thumbUrl:t[2],videoLogoUrl:t[3],interactiveContainer:t[4],live:t[5],autoplay:t[6],canRewindLive:t[7],showAds:t[8],adsSlotId:t[9],adsParams:t[10],adsPreviewParam:t[11],duration:t[12],logoClickable:t[13],logoHidden:t[14],showNextPrevButtons:t[16],nextButtonActive:t[17],prevButtonActive:t[18],endScreenVideoTitle:t[19],endScreenVideoThumb:t[20],isOneVideoPlaylist:t[21],supportLink:t[22],outerContainerRef:t[23],fullScreenTarget:t[24],showMiniTimer:t[25],playerStarted:t[34],playNextVideo:t[26],playPrevVideo:t[27],repeatPlaylist:t[28],seekToInteractive:t[29],toggleGraph:t[30],playPrevChapter:t[31],firstStart:t[36],seekTime:t[32]};return t[33]!==void 0&&(s.videoContainer=t[33]),e=new Nh({props:s}),ke.push(()=>Ue(e,"videoContainer",o)),{c(){F(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){const a={};r[0]&1&&(a.store=l[0]),r[0]&4&&(a.thumbUrl=l[2]),r[0]&8&&(a.videoLogoUrl=l[3]),r[0]&16&&(a.interactiveContainer=l[4]),r[0]&32&&(a.live=l[5]),r[0]&64&&(a.autoplay=l[6]),r[0]&128&&(a.canRewindLive=l[7]),r[0]&256&&(a.showAds=l[8]),r[0]&512&&(a.adsSlotId=l[9]),r[0]&1024&&(a.adsParams=l[10]),r[0]&2048&&(a.adsPreviewParam=l[11]),r[0]&4096&&(a.duration=l[12]),r[0]&8192&&(a.logoClickable=l[13]),r[0]&16384&&(a.logoHidden=l[14]),r[0]&65536&&(a.showNextPrevButtons=l[16]),r[0]&131072&&(a.nextButtonActive=l[17]),r[0]&262144&&(a.prevButtonActive=l[18]),r[0]&524288&&(a.endScreenVideoTitle=l[19]),r[0]&1048576&&(a.endScreenVideoThumb=l[20]),r[0]&2097152&&(a.isOneVideoPlaylist=l[21]),r[0]&4194304&&(a.supportLink=l[22]),r[0]&8388608&&(a.outerContainerRef=l[23]),r[0]&16777216&&(a.fullScreenTarget=l[24]),r[0]&33554432&&(a.showMiniTimer=l[25]),r[1]&8&&(a.playerStarted=l[34]),r[0]&67108864&&(a.playNextVideo=l[26]),r[0]&134217728&&(a.playPrevVideo=l[27]),r[0]&268435456&&(a.repeatPlaylist=l[28]),r[0]&536870912&&(a.seekToInteractive=l[29]),r[0]&1073741824&&(a.toggleGraph=l[30]),r[1]&1&&(a.playPrevChapter=l[31]),!i&&r[1]&4&&(i=!0,a.videoContainer=l[33],Fe(()=>i=!1)),e.$set(a)},i(l){n||(d(e.$$.fragment,l),n=!0)},o(l){g(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function Hh(t){let e,i,n,o;const s=[Oh,zh],l=[];function r(a,c){return a[15]?0:1}return i=r(t),n=l[i]=s[i](t),{c(){e=E("div"),n.c(),u(e,"class","root v-cghoty")},m(a,c){T(a,e,c),l[i].m(e,null),o=!0},p(a,c){let f=i;i=r(a),i===f?l[i].p(a,c):(fe(),g(l[f],1,1,()=>{l[f]=null}),de(),n=l[i],n?n.p(a,c):(n=l[i]=s[i](a),n.c()),d(n,1),n.m(e,null))},i(a){o||(d(n),o=!0)},o(a){g(n),o=!1},d(a){a&&S(e),l[i].d()}}}function Fh(t,e,i){let{sources:n}=e,{store:o}=e,{microStoresRoot:s}=e,{uiConfig:l}=e,{title:r}=e,{thumbUrl:a}=e,{videoLogoUrl:c}=e,{interactiveContainer:f}=e,{subtitles:p}=e,{live:h}=e,{preload:_}=e,{autoplay:b}=e,{volume:k=void 0}=e,{muted:v=void 0}=e,{fromTime:P}=e,{canRewindLive:y}=e,{showAds:C}=e,{adsSlotId:I=void 0}=e,{adsParams:ie=void 0}=e,{adsPreviewParam:M=void 0}=e,{duration:U=void 0}=e,{logoClickable:se}=e,{logoHidden:x}=e,{isMobile:w}=e,{showNextPrevButtons:$=!1}=e,{nextButtonActive:G=!1}=e,{prevButtonActive:ne=!1}=e,{endScreenVideoTitle:K=void 0}=e,{endScreenVideoThumb:V=void 0}=e,{isOneVideoPlaylist:Y=!1}=e,{supportLink:A}=e,{outerContainerRef:oe=void 0}=e,{fullScreenTarget:Te=void 0}=e,{failoverHosts:Re=void 0}=e,{showMiniTimer:Me=!1}=e,{playNextVideo:Ne=je}=e,{playPrevVideo:ce=je}=e,{repeatPlaylist:ve=je}=e,{seekToInteractive:Q=je}=e,{toggleGraph:ee=je}=e,{playPrevChapter:we=je}=e;const{subscribers:re,stores:Oe}=s;ef(l);const Le=an(),Ie=o.ui.debugPanelVisible,ue=o.ui.playerSize;let Ce,he=null,le=!1;o.getAdmanWrapper().init({switchFromAdsToVideo:o.actions.internal.switchFromAdsToVideo,switchFromVideoToAds:o.actions.internal.switchFromVideoToAds,setMuted:o.actions.external.setMuted},o.ads,{isMobile:o.ui.isMobile,mobileUnmuteButtonVisible:o.ui.mobileUnmuteButtonVisible,vsid:o.vsid}),cf(o,Oe);const Be=(te=!1)=>{i(34,le=!0),te?o.actions.external.firstStart(C):o.actions.internal.firstStart(C)};function me(te){const pt=n||te;pt&&o.initVideo({container:Ce,sources:pt,failoverHosts:Re,subtitles:p});const lt=wn.get(Tl)==="true";Ie.set(lt),P>0&&o.actions.external.seekTime(P);const Yt=w?Le.volumeDefault:k??R1()??Le.volumeDefault,rt=v??gf();if(o.actions.external.setVolume(Yt),o.actions.external.setMuted(rt),o.getAdmanWrapper().setInitialVolume(rt?0:Yt),Le.features.trafficSaving){const Ti=_f();Ti&&o.actions.internal.setTrafficSavingEnabled(Ti)}const kt=hf(o.videoId);kt&&o.actions.internal.setQuality(kt),o.ui.isAutoplay.set(b),b?Be():_&&Le.features.preload&&o.actions.internal.preload()}const Pe=te=>{if(window.ResizeObserver){let pt,lt;he=new ResizeObserver(tl(Yt=>{const rt=Yt[0];if(rt){if(rt.contentBoxSize){const kt=Array.isArray(rt.contentBoxSize)?rt.contentBoxSize[0]:rt.contentBoxSize;pt=kt.inlineSize,lt=kt.blockSize}else rt.contentRect&&(pt=rt.contentRect.width,lt=rt.contentRect.height);ue.set({width:pt,height:lt})}},y1)),he.observe(te)}ue.set({width:te.clientWidth,height:te.clientHeight})};rn(()=>{Pe(Ce);const te=re.map(lt=>lt.init(o,Oe));if(h?.status==="upcoming"||h?.status==="waiting"){o.actions.internal.setWaitingLive(!0);return}if((h?.status==="finished"||h?.status==="postlive")&&!Object.keys(n||[]).length){o.actions.internal.setWaitingRecord(!0);return}return me(),()=>{he?.disconnect(),te.forEach(lt=>lt.unsubscribe()),o.destroy()}});function ye(){le?o.actions.external.play():Be(!0)}function Ke(){o.actions.external.pause()}function it(te){w||o.actions.external.setMuted(te)}function Xe(te){w||te>=0&&te<=1&&o.actions.external.setVolume(te)}function Ye(te){o.actions.internal.seekTime(te,At.UNKNOWN)}function et(te){o.actions.external.seekEpisodeStartTime(te)}function St(){o.actions.external.returnFocusToEpisodes()}function mt(te){o.actions.external.setPlaybackRate(te)}function Si(te){o.actions.external.setAutoQualityLimits(te)}function gt(te){Ce=te,i(33,Ce)}function Vt(te){Ce=te,i(33,Ce)}return t.$$set=te=>{"sources"in te&&i(37,n=te.sources),"store"in te&&i(0,o=te.store),"microStoresRoot"in te&&i(38,s=te.microStoresRoot),"uiConfig"in te&&i(39,l=te.uiConfig),"title"in te&&i(1,r=te.title),"thumbUrl"in te&&i(2,a=te.thumbUrl),"videoLogoUrl"in te&&i(3,c=te.videoLogoUrl),"interactiveContainer"in te&&i(4,f=te.interactiveContainer),"subtitles"in te&&i(40,p=te.subtitles),"live"in te&&i(5,h=te.live),"preload"in te&&i(41,_=te.preload),"autoplay"in te&&i(6,b=te.autoplay),"volume"in te&&i(42,k=te.volume),"muted"in te&&i(43,v=te.muted),"fromTime"in te&&i(44,P=te.fromTime),"canRewindLive"in te&&i(7,y=te.canRewindLive),"showAds"in te&&i(8,C=te.showAds),"adsSlotId"in te&&i(9,I=te.adsSlotId),"adsParams"in te&&i(10,ie=te.adsParams),"adsPreviewParam"in te&&i(11,M=te.adsPreviewParam),"duration"in te&&i(12,U=te.duration),"logoClickable"in te&&i(13,se=te.logoClickable),"logoHidden"in te&&i(14,x=te.logoHidden),"isMobile"in te&&i(15,w=te.isMobile),"showNextPrevButtons"in te&&i(16,$=te.showNextPrevButtons),"nextButtonActive"in te&&i(17,G=te.nextButtonActive),"prevButtonActive"in te&&i(18,ne=te.prevButtonActive),"endScreenVideoTitle"in te&&i(19,K=te.endScreenVideoTitle),"endScreenVideoThumb"in te&&i(20,V=te.endScreenVideoThumb),"isOneVideoPlaylist"in te&&i(21,Y=te.isOneVideoPlaylist),"supportLink"in te&&i(22,A=te.supportLink),"outerContainerRef"in te&&i(23,oe=te.outerContainerRef),"fullScreenTarget"in te&&i(24,Te=te.fullScreenTarget),"failoverHosts"in te&&i(45,Re=te.failoverHosts),"showMiniTimer"in te&&i(25,Me=te.showMiniTimer),"playNextVideo"in te&&i(26,Ne=te.playNextVideo),"playPrevVideo"in te&&i(27,ce=te.playPrevVideo),"repeatPlaylist"in te&&i(28,ve=te.repeatPlaylist),"seekToInteractive"in te&&i(29,Q=te.seekToInteractive),"toggleGraph"in te&&i(30,ee=te.toggleGraph),"playPrevChapter"in te&&i(31,we=te.playPrevChapter)},t.$$.update=()=>{t.$$.dirty[0]&32769&&o.ui.isMobile.set(w)},[o,r,a,c,f,h,b,y,C,I,ie,M,U,se,x,w,$,G,ne,K,V,Y,A,oe,Te,Me,Ne,ce,ve,Q,ee,we,Ye,Ce,le,Le,Be,n,s,l,p,_,k,v,P,Re,me,ye,Ke,it,Xe,et,St,mt,Si,gt,Vt]}class Uh extends _e{constructor(e){super(),be(this,e,Fh,Hh,ge,{sources:37,store:0,microStoresRoot:38,uiConfig:39,title:1,thumbUrl:2,videoLogoUrl:3,interactiveContainer:4,subtitles:40,live:5,preload:41,autoplay:6,volume:42,muted:43,fromTime:44,canRewindLive:7,showAds:8,adsSlotId:9,adsParams:10,adsPreviewParam:11,duration:12,logoClickable:13,logoHidden:14,isMobile:15,showNextPrevButtons:16,nextButtonActive:17,prevButtonActive:18,endScreenVideoTitle:19,endScreenVideoThumb:20,isOneVideoPlaylist:21,supportLink:22,outerContainerRef:23,fullScreenTarget:24,failoverHosts:45,showMiniTimer:25,playNextVideo:26,playPrevVideo:27,repeatPlaylist:28,seekToInteractive:29,toggleGraph:30,playPrevChapter:31,initVideo:46,play:47,pause:48,setMuted:49,setVolume:50,seekTime:32,seekEpisodeStartTime:51,returnFocusToEpisodes:52,setPlaybackRate:53,setAutoQualityLimits:54},Dh,[-1,-1,-1])}get initVideo(){return this.$$.ctx[46]}get play(){return this.$$.ctx[47]}get pause(){return this.$$.ctx[48]}get setMuted(){return this.$$.ctx[49]}get setVolume(){return this.$$.ctx[50]}get seekTime(){return this.$$.ctx[32]}get seekEpisodeStartTime(){return this.$$.ctx[51]}get returnFocusToEpisodes(){return this.$$.ctx[52]}get setPlaybackRate(){return this.$$.ctx[53]}get setAutoQualityLimits(){return this.$$.ctx[54]}}function qh(t){let e,i;return{c(){e=R("svg"),i=R("path"),u(i,"fill",t[0]),u(i,"d","M38.245 6c3.566 0 4.859.371 6.162 1.069a7.27 7.27 0 0 1 3.025 3.024c.697 1.303 1.068 2.597 1.068 6.163v23.489c0 3.566-.371 4.859-1.069 6.162a7.27 7.27 0 0 1-3.024 3.025C43.104 49.629 41.811 50 38.245 50h-19.49c-3.565 0-4.859-.371-6.162-1.069a7.27 7.27 0 0 1-3.024-3.024C8.87 44.604 8.5 43.311 8.5 39.745v-23.49c0-3.565.371-4.859 1.069-6.162a7.27 7.27 0 0 1 3.024-3.024C13.896 6.37 15.19 6 18.756 6h19.489zm.314 3H18.756c-2.799 0-3.761.186-4.749.714a4.27 4.27 0 0 0-1.793 1.793c-.508.95-.7 1.876-.713 4.434L11.5 39.744c0 2.799.186 3.761.714 4.749a4.27 4.27 0 0 0 1.793 1.793c.988.528 1.95.714 4.749.714h19.489c2.798 0 3.76-.186 4.748-.714a4.27 4.27 0 0 0 1.793-1.793c.528-.988.714-1.95.714-4.748v-23.49c0-2.798-.186-3.76-.714-4.748a4.27 4.27 0 0 0-1.793-1.793c-.95-.508-1.876-.7-4.434-.713zM19.22 38c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436z"),u(e,"width","57"),u(e,"height","60"),u(e,"fill","none"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"aria-hidden","true"),u(e,"data-testid","stub-icon")},m(n,o){T(n,e,o),m(e,i)},p(n,[o]){o&1&&u(i,"fill",n[0])},i:Z,o:Z,d(n){n&&S(e)}}}function Zh(t,e,i){let{isWhite:n=!1}=e,o;return t.$$set=s=>{"isWhite"in s&&i(1,n=s.isWhite)},t.$$.update=()=>{t.$$.dirty&2&&i(0,o=n?"#fff":"#909499")},[o,n]}class Wh extends _e{constructor(e){super(),be(this,e,Zh,qh,ge,{isWhite:1})}}function Kh(t){Ze(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 c1(t){let e,i;return{c(){e=E("div"),i=ze(t[0]),u(e,"class","title v-1y9fytq")},m(n,o){T(n,e,o),m(e,i)},p(n,o){o&1&&Je(i,n[0])},d(n){n&&S(e)}}}function f1(t){let e,i;return e=new Wh({props:{isWhite:!!t[1]}}),{c(){F(e.$$.fragment)},m(n,o){z(e,n,o),i=!0},p(n,o){const s={};o&2&&(s.isWhite=!!n[1]),e.$set(s)},i(n){i||(d(e.$$.fragment,n),i=!0)},o(n){g(e.$$.fragment,n),i=!1},d(n){O(e,n)}}}function jh(t){let e,i,n,o,s=t[0]&&c1(t),l=(!t[0]||!t[1])&&f1(t);return{c(){e=E("div"),s&&s.c(),i=N(),l&&l.c(),u(e,"class","playerStub v-1y9fytq"),u(e,"style",n=t[1]?`background-image: url('${t[1]}')`:"")},m(r,a){T(r,e,a),s&&s.m(e,null),m(e,i),l&&l.m(e,null),o=!0},p(r,[a]){r[0]?s?s.p(r,a):(s=c1(r),s.c(),s.m(e,i)):s&&(s.d(1),s=null),!r[0]||!r[1]?l?(l.p(r,a),a&3&&d(l,1)):(l=f1(r),l.c(),d(l,1),l.m(e,null)):l&&(fe(),g(l,1,1,()=>{l=null}),de()),(!o||a&2&&n!==(n=r[1]?`background-image: url('${r[1]}')`:""))&&u(e,"style",n)},i(r){o||(d(l),o=!0)},o(r){g(l),o=!1},d(r){r&&S(e),s&&s.d(),l&&l.d()}}}function Gh(t,e,i){let{title:n}=e,{thumbUrl:o}=e;return t.$$set=s=>{"title"in s&&i(0,n=s.title),"thumbUrl"in s&&i(1,o=s.thumbUrl)},[n,o]}class Yh extends _e{constructor(e){super(),be(this,e,Gh,jh,ge,{title:0,thumbUrl:1},Kh)}}class Qh{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{throw new Error(`The media session action "${i}" is not supported yet.`)}}}function Xh(t){let e,i,n,o;return{c(){e=R("svg"),i=R("g"),n=R("path"),o=R("path"),u(n,"d","m30.744 4 .744.005c2.981.046 4.526.385 6.127 1.24a8.766 8.766 0 0 1 3.475 3.347l.174.312.15.292c.772 1.553 1.066 3.18 1.085 6.251v9.045a1.5 1.5 0 0 1-3 .016l-.008-9.651c-.04-2.032-.228-3.12-.627-4.035l-.126-.27-.13-.252A5.77 5.77 0 0 0 36.2 7.891c-1.187-.635-2.339-.873-5.115-.89L22.255 7c-2.737 0-4.003.2-5.071.698l-.133.064-.251.13a5.77 5.77 0 0 0-2.409 2.408c-.635 1.187-.873 2.339-.89 5.114l-.001 20.83c0 2.738.2 4.004.698 5.072l.064.133.13.251a5.769 5.769 0 0 0 2.408 2.409c1.1.588 2.134.825 4.438.88l.323.006 3.695.005H26a1.5 1.5 0 0 1 0 3h-.756l-3.718-.005c-2.989-.047-4.526-.377-6.14-1.24a8.766 8.766 0 0 1-3.476-3.347l-.174-.312-.15-.292c-.731-1.472-1.036-3.016-1.08-5.803l-.006-.756v-20.49l.005-.743c.046-2.981.385-4.526 1.24-6.127a8.765 8.765 0 0 1 3.347-3.475l.312-.174.292-.15c1.472-.731 3.016-1.036 5.803-1.08L22.256 4h8.488Z"),u(o,"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(s,l){T(s,e,l),m(e,i),m(i,n),m(i,o)},p:Z,i:Z,o:Z,d(s){s&&S(e)}}}class Jh extends _e{constructor(e){super(),be(this,e,null,Xh,ge,{})}}function xh(t){Ze(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 $h(t){let e,i,n,o,s,l,r;return n=new Jh({}),{c(){e=E("div"),i=E("div"),F(n.$$.fragment),o=N(),s=E("span"),l=ze(t[0]),u(i,"class","dummy-image v-1pbsod4"),B(i,"desktop",!t[1]),u(s,"class","title v-1pbsod4"),u(e,"class","player-pip-dummy v-1pbsod4"),B(e,"is-pip-api",t[2])},m(a,c){T(a,e,c),m(e,i),z(n,i,null),m(e,o),m(e,s),m(s,l),r=!0},p(a,[c]){(!r||c&2)&&B(i,"desktop",!a[1]),(!r||c&1)&&Je(l,a[0])},i(a){r||(d(n.$$.fragment,a),r=!0)},o(a){g(n.$$.fragment,a),r=!1},d(a){a&&S(e),O(n)}}}function e5(t,e,i){let n,o;const s=dt(),l=!!s.webApi.pictureInPictureApi,r=s.interfaceLanguage$;D(t,r,f=>i(5,n=f));const a=s.ui.isMobile;D(t,a,f=>i(1,o=f));let c;return t.$$.update=()=>{t.$$.dirty&32&&i(0,c=n&&W("pip_dummy_title"))},[c,o,l,r,a,n]}class t5 extends _e{constructor(e){super(),be(this,e,e5,$h,ge,{},xh)}}const i5=460,n5=280;class Wu{playerDomElement;playerParentShadowRoot;playerDummyElement;svelteContext;pipWindow;info={isActive$:new Al(!1),type:zn.DocumentPictureInPicture};isSupported(){const e=Ll().browser===m1.Yandex,{isEmbed:i}=Rc();return"documentPictureInPicture"in window&&!e&&!i}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:i5,height:n5,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";const e=[...this.playerParentShadowRoot.styleSheets].map(s=>[...s.cssRules].map(l=>l.cssText).join(" ")).filter(Boolean).join(`
51
- `),i=document.createElement("style");i.textContent=e;const n=this.createStretchedContainer(),o=n.attachShadow({mode:"open"});o.append(i),o.append(this.playerDomElement),this.playerDummyElement=new t5({target:this.playerParentShadowRoot,context:this.svelteContext}),this.pipWindow?.document.body.append(n),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{documentPictureInPicture.window?.close(),e()})}async dispose(){await this.remove()}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function o5(t){return t instanceof Wu}class l5{static getLatestSupportedVersion(){const e=new zl,i=new Wu;if(i.isSupported())return i;if(e.isSupported())return e}}function d1(t,e){const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const o of i)n[o]=e[o]??t[o]??void 0;return n}const s5="Inner error. Unexpectedly root annotation container null reference exception",r5="Annotation with such name already exists",a5="Annotation with such name does not exist";class yl extends Error{constructor(e){super(e),this.name="AnnotationError"}}const u5="1",c5=100;class f5{rootAnnotationsContainer;annotations=new Map;subscriptions=new Jn;mutationObserver;playerSize;constructor(e){this.rootAnnotationsContainer=e;const i=tl(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},c5);this.subscriptions.add(Nc(this.rootAnnotationsContainer).subscribe(({width:n,height:o})=>{this.playerSize={width:n,height:o},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){if(!this.rootAnnotationsContainer)throw new yl(s5);if(this.annotations.has(e))throw new yl(r5);i.style.zIndex=i.style.zIndex??u5,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 yl(a5);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 o=e.offsetTop,s=e.offsetLeft,l=e.offsetWidth,r=e.offsetHeight;return o<0||s<0||s+l>i||o+r>n}registryRootContainer(e){}addLayer(e){return new HTMLElement}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}}class Gl{stateName;state$;subscription;init(e,i){return ut(e),ut(i),this.subscription=new Jn,this.subscription}}class d5 extends Gl{stateName="fakeIsPlaying$";state$={...Ve(null),toggle:()=>this.state$.update(e=>!e)};init(e,i){const n=super.init(e,i),{isInteractiveExpectation$:o}=e.state;return n.add(o.subscribe(s=>{this.state$.set(s?!0:null)})),n}}class m5 extends Gl{stateName="interactiveControlsOpacity$";state$={...Ve(null),toggle:()=>this.state$.update(e=>!e)};init(e,i){const n=super.init(e,i),{fakeIsPlaying$:o}=i,{isInteractiveExpectation$:s,isPlaying$:l}=e.state,{controlsVisible:r,isMobile:a}=e.ui,c=xe(a),f=()=>c&&xe(r);return n.add(r.subscribe(p=>{if(!c)return;const h=xe(o);xe(l)?this.state$.set(p):h!==null&&this.state$.set(!h||p)})),n.add(l.subscribe(p=>{this.state$.set(!p||f())})),n.add(o.subscribe(p=>{if(p===null)return;const h=xe(s);if(f()){this.state$.set(!0);return}h&&this.state$.set(!p)})),n}}class p5 extends Gl{stateName="seekToInteractiveDisabledTooltip$";state$=Ve("tooltip_chapter_without_interactive");init(e,i){const n=super.init(e,i);return n.add(e.state.interactiveEpisodes$.subscribe(o=>{o.length&&(o.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}}const h5=()=>[d5,m5,p5].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}}),g5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Ao.RU,logoClickable:!1,logoHidden:!1,isMobile:Dc(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class b5 extends HTMLElement{svelteStubComponent;svelteRootComponent;store;microStoresRoot;statistics;sentry;_shadowRoot;playerContainer;rootContainer;uiConfig;coreConfig;statisticsConfig;interactiveController;interactiveContainer;graphMadePause;currentPlayingVideoIndex=0;needToRepeatPlaylist=!1;videoConfig=void 0;pictureInPictureApi=void 0;mediaSessionApi=void 0;unsubscribePlayerPhaseSubscription=void 0;logger;log;subscription;annotationsApi=void 0;createPlayerTimeout;prevIsid=void 0;isInited=!1;constructor(){super(),this.logger=new p1,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Jn,this.graphMadePause=!1,window?.videoPlayerConfig?.debugLogs&&this.subscription.add(this.logger.log$.subscribe(e=>{console.log("%c player web component ","background:#77dd77;",`${e.component}`,e.message)}))}connectedCallback(){if(this.isInited)return;this.initPlayerRootContainers();const e=this.getAttribute("stub-title")??void 0,i=this.getAttribute("stub-thumb-url")??void 0;this.svelteStubComponent=new Yh({target:this.playerContainer,props:{title:e,thumbUrl:i}})}disconnectedCallback(){this.annotationsApi?.destroy(),this.svelteRootComponent?.$destroy(),this.svelteStubComponent?.$destroy(),this.subscription.unsubscribe(),this.unsubscribePlayerPhaseSubscription?.(),this.interactiveController?.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){return this.store?.ui.controls.disabledControls$?.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){if(!this.videoConfig)return;const{albumId:o,statPlace:s,statUserSalt:l,statAuthToken:r,statTrackCode:a,refreshStatAuthToken:c,preload:f,autoplay:p,volume:h,muted:_,fromTime:b,canRewindLive:k,supportLink:v,showAds:P,adsSlotId:y,adsParams:C={},adsPreviewParam:I,interfaceLanguage:ie,logoClickable:M,logoHidden:U,isMobile:se,isAudioDisabled:x,isLiveCatchUpMode:w,fullScreenTarget:$,failoverHosts:G,canDownload:ne,callbacks:K,interactiveData:V,showThumbTimer:Y,additionalButtons:A=[],repeat:oe}=d1(this.videoConfig,i),{sources:Te,title:Re,thumbUrl:Me,videoLogoUrl:Ne,unitedVideoId:ce,isClip:ve=!1,duration:Q,adsParams:ee={},videoEpisodes:we,previewThumbsData:re,subtitles:Oe,live:Le}=e,Ie={...C,...ee},ue=this.getNextVideoInfo(),Ce={sources:Te,title:Re,thumbUrl:Me,subtitles:Oe,unitedVideoId:ce,isClip:ve,live:Le,albumId:o,statPlace:s,autoplay:p,muted:_,volume:h,fromTime:b,canRewindLive:k,showAds:P,adsSlotId:y,adsParams:Ie,adsPreviewParam:I,duration:Q,logoClickable:M,logoHidden:U,isMobile:se,repeat:oe,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ue.nextVideoTitle,endScreenVideoThumb:ue.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},he={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Ce)}`});const le=this.uiConfig.features.statistics&&!!ce,{pid:Be}=this.videoConfig?.interactiveData?.projectInfo||{};le&&(this.statistics=new t3({movieId:ce,albumId:o,place:s,trackCode:a,autoplay:(p&&!this.interactiveController)??!1,mobile:se,clip:ve,...Be&&!this.isInited&&{projectId:Number(Be)}},{refreshAuthToken:c,userSalt:l,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new El(this.uiConfig.sentry,{version:Rl,env:uf},{movieId:ce,albumId:o,place:s,autoplay:(p&&!this.interactiveController)??!1,mobile:se,clip:ve}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat.isid$.getValue()),this.sentry={...this.sentry,...El.getInstance()};const Pe=!!V,ye=[];let Ke="tooltip_interactive_go_back_disabled_first";if(Pe&&this.interactiveController){const Ye=this.interactiveController.state.isInitialChapter$.getValue(),et=this.interactiveController.getHistoryState();Ye&&ye.push(st.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||ye.push(st.SEEK_TO_INTERACTIVE_BUTTON),et.hasPrevChapter$.getValue()||(ye.push(st.PLAY_PREV_CHAPTER_BUTTON),Ye||(et.isGoBackLimited$.getValue()?Ke="tooltip_interactive_go_back_disabled_limit":Ke="tooltip_interactive_go_back_disabled"))}const it=()=>{this.isInited=!1,this.prevIsid=void 0;const Ye=n?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();K.onReplayInteractiveVideo&&!Ye?K.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=i3({player:n,interfaceLanguage:ie,videoId:ce,isClip:ve,isLiveCatchUpMode:w,isAudioDisabled:x,statAuthToken:r,callbacks:K,webApi:he,videoEpisodes:we,previewThumbsData:re,canDownload:ne,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:ye,isInteractive:Pe,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,replayInteractive:it,playPrevChapterDisabledTooltip:Ke,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?A:[],looped:oe&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:Xe}=this.microStoresRoot=h5();this.subscription.add(this.store.state.currentFormat$.subscribe(Ye=>K?.onCurrentFormatChanged?.(Ye))),this.subscription.add(Xe.interactiveControlsOpacity$.subscribe(Ye=>{Ye!==null&&this?.interactiveController?.setDisabledControls(Ye)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Ye=>K?.onThroughputEstimationChanged?.(Ye))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Ye=>K?.onTrafficSavingEnabledChanged?.(Ye))),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ye=>K?.onCurrentPlaybackRateChanged?.(Ye))),this.subscription.add(this.store.state.volume$.subscribe(Ye=>K?.onVolumeChange?.(Ye))),this.subscription.add(this.store.state.muted$.subscribe(Ye=>Ye?K?.onMute?.():K?.onUnmute?.())),this.subscription.add(this.store.state.videoBitrate$.subscribe(Ye=>K?.onVideoBitrateChanged?.(Ye))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Ye=>{const et=this.store?.ui.controls.disabledControls$;et&&(Ye&&!et.includes(Jo)&&et.add(Jo),Ye||et.remove(Jo))})),this.initMediaSession(),this.interactiveController&&le&&this.initInteractivesStatistics(),this.svelteRootComponent=new Uh({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Te,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:Re,thumbUrl:Me,videoLogoUrl:Ne,subtitles:Oe,live:Le,preload:f,autoplay:p,muted:_,volume:h,fromTime:b,canRewindLive:k,supportLink:v,showAds:P,adsSlotId:y,adsParams:Ie,adsPreviewParam:I,duration:Q,logoClickable:M,logoHidden:U,isMobile:se,failoverHosts:G,fullScreenTarget:$,showMiniTimer:Y,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ue.nextVideoTitle,endScreenVideoThumb:ue.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,this.videoConfig?.callbacks?.onInited?.())}addPlayerInfoSubscriptions(){const e=this.store;if(!e)return;const i=this.videoConfig?.callbacks;i&&this.subscription.add(e.playerPhase.subscribe(o=>i.onPlayerPhaseChanged?.(o))).add(e.state.playbackState$.subscribe(o=>i.onPlaybackStateChanged?.(o))).add(e.state.isLive$.subscribe(o=>i.onIsLiveChanged?.(o))).add(e.state.isActiveLive$.subscribe(o=>i.onIsActiveLiveChanged?.(o))).add(e.state.isAudioAvailable$.subscribe(o=>i.onIsAudioAvailableChanged?.(o))).add(e.state.currentQuality$.subscribe(o=>i.onCurrentQualityChanged?.(o))).add(e.state.availableQualities$.subscribe(o=>i.onAvailableQualitiesChanged?.(o.map(({value:s})=>s).filter(s=>s!==po.AUTO)))).add(e.ui.isPictureInPictureActive$.subscribe(o=>o?i.onPiPEnter?.():i.onPiPExit?.()));const n=i?.uiInfo;n&&this.subscription.add(e.ui.controlsVisible.subscribe(o=>n.onControlsVisibleChanged?.(o))).add(e.ui.isMobile.subscribe(o=>n.onIsMobileChanged?.(o))).add(e.ui.playerSize.subscribe(o=>n.onPlayerSizeChanged?.(o))).add(e.ui.controls.prevButton.subscribe(o=>n.onPrevButtonChanged?.(o))).add(e.ui.controls.playButton.subscribe(o=>n.onPlayButtonChanged?.(o))).add(e.ui.controls.replayButton.subscribe(o=>n.onReplayButtonChanged?.(o))).add(e.ui.controls.nextButton.subscribe(o=>n.onNextButtonChanged?.(o))).add(e.ui.controls.playPrevChapterButton.subscribe(o=>n.onPlayPrevChapterChanged?.(o))).add(e.ui.controls.seekToInteractiveButton.subscribe(o=>n.onSeekToInteractiveButtonChanged?.(o))).add(e.ui.controls.interactiveGraphButton.subscribe(o=>n.onGraphButtonChanged?.(o))).add(e.ui.controls.liveButton.subscribe(o=>n.onLiveButtonChanged?.(o))).add(e.ui.controls.time.subscribe(o=>n.onTimeUpdateChanged?.(o))).add(e.ui.controls.episodes.subscribe(o=>n.onEpisodesChanged?.(o))).add(e.ui.controls.subtitles.subscribe(o=>n.onSubtitlesChanged?.(o))).add(e.ui.controls.settings.subscribe(o=>n.onSettingsChanged?.(o))).add(e.ui.controls.fullscreen.subscribe(o=>n.onFullscreenChanged?.(o))).add(e.ui.controls.chromecast.subscribe(o=>n.onChromecastChanged?.(o))).add(e.ui.controls.pip.subscribe(o=>n.onPipChanged?.(o))).add(e.ui.controls.vkLogo.subscribe(o=>n.onVkLogoChanged?.(o))).add(e.ui.controls.interactiveTimeIcon.subscribe(o=>n.onInteractiveTimeIconChanged?.(o)))}playNextVideo(){if(!this.videoConfig)return;let e=!0;if(this.videoConfig.callbacks?.onNextVideoClick)try{e=this.videoConfig.callbacks.onNextVideoClick()}catch{this.log({message:"onNextVideoClick callback failed to execute"})}e&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){if(!this.videoConfig)return;let e=!0;if(this.videoConfig.callbacks?.onPrevVideoClick)try{e=this.videoConfig.callbacks.onPrevVideoClick()}catch{this.log({message:"onPrevVideoClick callback failed to execute"})}e&&(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){if(!this.videoConfig)return;const n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&vn(n.unitedVideoId)&&this.store.actions.internal.nextMovie(n.unitedVideoId),this.svelteRootComponent?.$destroy(),this.createPlayer(n,{autoplay:i,fromTime:0},e)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){const e=this.interactiveController?.getNextInteractiveStartTime();typeof e=="number"&&this.seekTime(e/1e3)}toggleGraph(){if(!this.isInited)return;const e=this.store,{isEnded$:i,playbackState$:n,graphIsOpened$:o}=e.state,{disabledControls$:s}=e.ui.controls,l=xe(i),r=xe(n);xe(o)?(o.set(!1),this.interactiveController?.toggleGraphView(!1),s.remove(as),!l&&this.graphMadePause&&this.play()):(this.graphMadePause=r==="playing",o.set(!0),this.interactiveController?.toggleGraphView(!0),s.add(as),!l&&this.graphMadePause&&this.pause())}async initInteractives(){if(this.videoConfig?.interactiveData)try{const{Interactives:e,EVENT_NAMES:i,CustomError:n}=await import("@vkontakte/videoplayer-interactive/evergreen.esm.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const o=this.store?.interfaceLanguage$,s=o?xe(o):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:r,historyApi:a,videoLoader:c}=this.videoConfig.interactiveData;this.interactiveController=new e({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:s,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:r,historyApi:a,vkVideoLoader:c,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:f}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(h=>{if(!this.isInited)return;const _=this.store;h?_.ui.controls.disabledControls$.remove(st.SEEK_TO_INTERACTIVE_BUTTON):_.ui.controls.disabledControls$.add(st.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(f.subscribe(h=>{this.store&&this.store.state.isInteractiveExpectation$.set(h)}));let p=!0;if(this.interactiveController.on(i.playerChanged,h=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...h.config,title:l?.title||h.config.title};const _=p?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(h.player,_),p&&(p=!1)}),this.interactiveController.on(i.interactives,({type:h,actionType:_})=>{if(!this.store)return;const b=f.getValue();if(h==="action-choice"&&_==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(S1)),h==="action-choice-canceled"){const k=xe(this.store.state.isPlaying$)||b;if(this.videoConfig?.isMobile&&k){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}}),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){const h=this.interactiveController.getHistoryState();this.subscription.add(h.history$.subscribe(_=>{_.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(_)}))}this.interactiveController.events.noInteraction$.subscribe(()=>{this.videoConfig?.callbacks.onInteractiveTimeIconClick?.()}),this.interactiveController.on(i.errors,h=>{this.log({message:h.toString()})})}catch(e){this.log({message:e.message})}}async initInteractivesStatistics(){const{statSubscription:e,oneStat:i}=this.statistics;if(!(!e||!i||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:n}=await import("@vkontakte/videoplayer-interactive/evergreen.esm.js"),o={[n.GO_NEXT_BUTTON]:So.NEXT_BUTTON,[n.GO_NEXT_AREA]:So.NEXT_AREA,[n.WATCH_AGAIN]:So.WATCH_AGAIN,[n.OPEN_GRAPH]:So.GRAPH_SHOW,[n.CLOSE_GRAPH]:So.GRAPH_HIDE},{click$:s,nextMovie$:l}=this.interactiveController.getStatEvents(),r=new cn;s.subscribe(a=>{a in o?r.next(o[a]):(i?.logError({errorType:"InteractiveVideosAction",fatal:!1}),this.sentry.report?.(new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),e.add(i.attachToInteractive({click$:r,nextMovie$:l}))}catch(n){i?.logError({errorType:"InteractiveVideos",fatal:!1}),this.sentry.report?.(n,{errorType:"InteractiveVideosAction",fatal:!1})}}initPlayer(e,i={}){if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=d1(g5,zc(e,n=>n instanceof HTMLElement?n:void 0)),this.uiConfig=$c(i.ui??{}),this.coreConfig=i.core??{configName:[]},this.statisticsConfig=i.statistics??{},this.sentry={config:this.uiConfig.sentry??{}},vn(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.videoConfig.isMediaSessionEnabled??!0),vn(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=this.uiConfig.features.pip??this.videoConfig.isPictureInPictureEnabled??!0,this.uiConfig.features.dpip=this.uiConfig.features.dpip??this.videoConfig.isPictureInPictureEnabled??!0),this.videoConfig.isMobile=this.uiConfig.isMobile??this.videoConfig.isMobile,this.videoConfig.autoplay&&=this.uiConfig.features.autoplay,this.videoConfig.showAds=this.uiConfig.ads.enable??this.videoConfig.showAds,this.videoConfig.adsSlotId=this.uiConfig.ads.slot??this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=this.uiConfig.ads.preview??this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!(this.uiConfig.showLogo??!this.videoConfig.logoHidden),this.videoConfig.canRewindLive&&=this.uiConfig.features.liveRewind,this.videoConfig.supportLink=this.videoConfig.supportLink??this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=l5.getLatestSupportedVersion():this.pictureInPictureApi=new zl),this.mediaSessionApi=this.uiConfig.features.mediaSession?new Qh:void 0,this.annotationsApi=this.uiConfig.features.annotations?new f5(this.rootContainer):void 0,this.svelteStubComponent?.$destroy(),this.svelteRootComponent?.$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]),o5(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){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 i=this.getNextVideoInfo();this.svelteRootComponent?.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:i.nextVideoTitle,endScreenVideoThumb:i.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(e=>{e===De.Video?this.setupMediaSessionForVideo():e===De.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",o=>this.seekTime(o.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(){this.isControlDisabled(st.PLAY_BUTTON)||this.store?.playerPhase.is(De.WaitingLive)||(this.log({message:"play"}),this.svelteRootComponent?.play())}pause(){this.log({message:"pause"}),this.svelteRootComponent?.pause()}stop(){if(!this.videoConfig)return;this.log({message:"stop"}),this.svelteStubComponent?.$destroy();const e=this.videoConfig.videos[0];e&&(this.svelteRootComponent?.$destroy(),this.createPlayer(e))}setMuted(e){this.log({message:`set muted, muted: ${e}`}),this.svelteRootComponent?.setMuted(e)}setVolume(e){this.log({message:`set volume, volume: ${e}`}),this.svelteRootComponent?.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,this.svelteRootComponent?.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){this.isControlDisabled(st.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),this.svelteRootComponent?.seekTime(e))}seekEpisodeStartTime(e){this.log({message:`seek episode start time, time: ${e}`}),this.svelteRootComponent?.seekEpisodeStartTime(e)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(e){this.log({message:`set playback rate to: ${e}`}),this.svelteRootComponent?.setPlaybackRate(e)}setAutoQualityLimits(e){this.log({message:`set auto quality limitation. Max: ${e.max??"none"}. Min: ${e.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(e)}addLanguage(e){this.store?.actions.internal.addLanguage(e)}async setLanguage(e){await this.store?.actions.internal.setLanguage(e)}setLiveStart(e){this.log({message:"live started"}),this.store?.actions.internal.setWaitingLive(!1),this.svelteRootComponent?.initVideo(e),this.play()}setWaitRecord(){this.log({message:"post live"}),this.store?.actions.internal.setWaitingRecord(!0),this.store?.destroy()}setLiveEnd(e){this.log({message:"live ended"}),this.store?.actions.internal.setWaitingRecord(!1),this.svelteRootComponent?.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){return this.statistics?.oneStat.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const C5=()=>{window.customElements.define("vk-video-player",b5)};export{vt as GridTypes,A5 as InterfaceLanguage,Rl as VERSION,L5 as VKNumericLanguage,T5 as VideoFormat,E5 as VideoQuality,V5 as loadVKLangPack,C5 as registerPlayerWebComponent};
51
+ `),i=document.createElement("style");i.textContent=e;const n=this.createStretchedContainer(),o=n.attachShadow({mode:"open"});o.append(i),o.append(this.playerDomElement),this.playerDummyElement=new t5({target:this.playerParentShadowRoot,context:this.svelteContext}),this.pipWindow?.document.body.append(n),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{documentPictureInPicture.window?.close(),e()})}async dispose(){await this.remove()}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function o5(t){return t instanceof Wu}class l5{static getLatestSupportedVersion(){const e=new zl,i=new Wu;if(i.isSupported())return i;if(e.isSupported())return e}}function d1(t,e){const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const o of i)n[o]=e[o]??t[o]??void 0;return n}const s5="Inner error. Unexpectedly root annotation container null reference exception",r5="Annotation with such name already exists",a5="Annotation with such name does not exist";class yl extends Error{constructor(e){super(e),this.name="AnnotationError"}}const u5="1",c5=100;class f5{rootAnnotationsContainer;annotations=new Map;subscriptions=new Jn;mutationObserver;playerSize;constructor(e){this.rootAnnotationsContainer=e;const i=tl(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},c5);this.subscriptions.add(Nc(this.rootAnnotationsContainer).subscribe(({width:n,height:o})=>{this.playerSize={width:n,height:o},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){if(!this.rootAnnotationsContainer)throw new yl(s5);if(this.annotations.has(e))throw new yl(r5);i.style.zIndex=i.style.zIndex??u5,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 yl(a5);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 o=e.offsetTop,s=e.offsetLeft,l=e.offsetWidth,r=e.offsetHeight;return o<0||s<0||s+l>i||o+r>n}registryRootContainer(e){}addLayer(e){return new HTMLElement}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}}class Gl{stateName;state$;subscription;init(e,i){return ut(e),ut(i),this.subscription=new Jn,this.subscription}}class d5 extends Gl{stateName="fakeIsPlaying$";state$={...Ve(null),toggle:()=>this.state$.update(e=>!e)};init(e,i){const n=super.init(e,i),{isInteractiveExpectation$:o}=e.state;return n.add(o.subscribe(s=>{this.state$.set(s?!0:null)})),n}}class m5 extends Gl{stateName="interactiveControlsOpacity$";state$={...Ve(null),toggle:()=>this.state$.update(e=>!e)};init(e,i){const n=super.init(e,i),{fakeIsPlaying$:o}=i,{isInteractiveExpectation$:s,isPlaying$:l}=e.state,{controlsVisible:r,isMobile:a}=e.ui,c=xe(a),f=()=>c&&xe(r);return n.add(r.subscribe(p=>{if(!c)return;const h=xe(o);xe(l)?this.state$.set(p):h!==null&&this.state$.set(!h||p)})),n.add(l.subscribe(p=>{this.state$.set(!p||f())})),n.add(o.subscribe(p=>{if(p===null)return;const h=xe(s);if(f()){this.state$.set(!0);return}h&&this.state$.set(!p)})),n}}class p5 extends Gl{stateName="seekToInteractiveDisabledTooltip$";state$=Ve("tooltip_chapter_without_interactive");init(e,i){const n=super.init(e,i);return n.add(e.state.interactiveEpisodes$.subscribe(o=>{o.length&&(o.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}}const h5=()=>[d5,m5,p5].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}}),g5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Ao.RU,logoClickable:!1,logoHidden:!1,isMobile:Dc(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class b5 extends HTMLElement{svelteStubComponent;svelteRootComponent;store;microStoresRoot;statistics;sentry;_shadowRoot;playerContainer;rootContainer;uiConfig;coreConfig;statisticsConfig;interactiveController;interactiveContainer;graphMadePause;currentPlayingVideoIndex=0;needToRepeatPlaylist=!1;videoConfig=void 0;pictureInPictureApi=void 0;mediaSessionApi=void 0;unsubscribePlayerPhaseSubscription=void 0;logger;log;subscription;annotationsApi=void 0;createPlayerTimeout;prevIsid=void 0;isInited=!1;constructor(){super(),this.logger=new p1,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Jn,this.graphMadePause=!1,window?.videoPlayerConfig?.debugLogs&&this.subscription.add(this.logger.log$.subscribe(e=>{console.log("%c player web component ","background:#77dd77;",`${e.component}`,e.message)}))}connectedCallback(){if(this.isInited)return;this.initPlayerRootContainers();const e=this.getAttribute("stub-title")??void 0,i=this.getAttribute("stub-thumb-url")??void 0;this.svelteStubComponent=new Yh({target:this.playerContainer,props:{title:e,thumbUrl:i}})}disconnectedCallback(){this.annotationsApi?.destroy(),this.svelteRootComponent?.$destroy(),this.svelteStubComponent?.$destroy(),this.subscription.unsubscribe(),this.unsubscribePlayerPhaseSubscription?.(),this.interactiveController?.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){return this.store?.ui.controls.disabledControls$?.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){if(!this.videoConfig)return;const{albumId:o,statPlace:s,statUserSalt:l,statAuthToken:r,statTrackCode:a,refreshStatAuthToken:c,preload:f,autoplay:p,volume:h,muted:_,fromTime:b,canRewindLive:k,supportLink:v,showAds:P,adsSlotId:y,adsParams:C={},adsPreviewParam:I,interfaceLanguage:ie,logoClickable:M,logoHidden:U,isMobile:se,isAudioDisabled:x,isLiveCatchUpMode:w,fullScreenTarget:$,failoverHosts:G,canDownload:ne,callbacks:K,interactiveData:V,showThumbTimer:Y,additionalButtons:A=[],repeat:oe}=d1(this.videoConfig,i),{sources:Te,title:Re,thumbUrl:Me,videoLogoUrl:Ne,unitedVideoId:ce,isClip:ve=!1,duration:Q,adsParams:ee={},videoEpisodes:we,previewThumbsData:re,subtitles:Oe,live:Le}=e,Ie={...C,...ee},ue=this.getNextVideoInfo(),Ce={sources:Te,title:Re,thumbUrl:Me,subtitles:Oe,unitedVideoId:ce,isClip:ve,live:Le,albumId:o,statPlace:s,autoplay:p,muted:_,volume:h,fromTime:b,canRewindLive:k,showAds:P,adsSlotId:y,adsParams:Ie,adsPreviewParam:I,duration:Q,logoClickable:M,logoHidden:U,isMobile:se,repeat:oe,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ue.nextVideoTitle,endScreenVideoThumb:ue.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},he={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Ce)}`});const le=this.uiConfig.features.statistics&&!!ce,{pid:Be}=this.videoConfig?.interactiveData?.projectInfo||{};le&&(this.statistics=new t3({movieId:ce,albumId:o,place:s,trackCode:a,autoplay:(p&&!this.interactiveController)??!1,mobile:se,clip:ve,refDomain:this.videoConfig.refDomain,...Be&&!this.isInited&&{projectId:Number(Be)}},{refreshAuthToken:c,userSalt:l,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new El(this.uiConfig.sentry,{version:Rl,env:uf},{movieId:ce,albumId:o,place:s,autoplay:(p&&!this.interactiveController)??!1,mobile:se,clip:ve}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat.isid$.getValue()),this.sentry={...this.sentry,...El.getInstance()};const Pe=!!V,ye=[];let Ke="tooltip_interactive_go_back_disabled_first";if(Pe&&this.interactiveController){const Ye=this.interactiveController.state.isInitialChapter$.getValue(),et=this.interactiveController.getHistoryState();Ye&&ye.push(st.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||ye.push(st.SEEK_TO_INTERACTIVE_BUTTON),et.hasPrevChapter$.getValue()||(ye.push(st.PLAY_PREV_CHAPTER_BUTTON),Ye||(et.isGoBackLimited$.getValue()?Ke="tooltip_interactive_go_back_disabled_limit":Ke="tooltip_interactive_go_back_disabled"))}const it=()=>{this.isInited=!1,this.prevIsid=void 0;const Ye=n?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();K.onReplayInteractiveVideo&&!Ye?K.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=i3({player:n,interfaceLanguage:ie,videoId:ce,isClip:ve,isLiveCatchUpMode:w,isAudioDisabled:x,statAuthToken:r,callbacks:K,webApi:he,videoEpisodes:we,previewThumbsData:re,canDownload:ne,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:ye,isInteractive:Pe,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,replayInteractive:it,playPrevChapterDisabledTooltip:Ke,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?A:[],looped:oe&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:Xe}=this.microStoresRoot=h5();this.subscription.add(this.store.state.currentFormat$.subscribe(Ye=>K?.onCurrentFormatChanged?.(Ye))),this.subscription.add(Xe.interactiveControlsOpacity$.subscribe(Ye=>{Ye!==null&&this?.interactiveController?.setDisabledControls(Ye)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Ye=>K?.onThroughputEstimationChanged?.(Ye))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Ye=>K?.onTrafficSavingEnabledChanged?.(Ye))),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ye=>K?.onCurrentPlaybackRateChanged?.(Ye))),this.subscription.add(this.store.state.volume$.subscribe(Ye=>K?.onVolumeChange?.(Ye))),this.subscription.add(this.store.state.muted$.subscribe(Ye=>Ye?K?.onMute?.():K?.onUnmute?.())),this.subscription.add(this.store.state.videoBitrate$.subscribe(Ye=>K?.onVideoBitrateChanged?.(Ye))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Ye=>{const et=this.store?.ui.controls.disabledControls$;et&&(Ye&&!et.includes(Jo)&&et.add(Jo),Ye||et.remove(Jo))})),this.initMediaSession(),this.interactiveController&&le&&this.initInteractivesStatistics(),this.svelteRootComponent=new Uh({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Te,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:Re,thumbUrl:Me,videoLogoUrl:Ne,subtitles:Oe,live:Le,preload:f,autoplay:p,muted:_,volume:h,fromTime:b,canRewindLive:k,supportLink:v,showAds:P,adsSlotId:y,adsParams:Ie,adsPreviewParam:I,duration:Q,logoClickable:M,logoHidden:U,isMobile:se,failoverHosts:G,fullScreenTarget:$,showMiniTimer:Y,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ue.nextVideoTitle,endScreenVideoThumb:ue.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,this.videoConfig?.callbacks?.onInited?.())}addPlayerInfoSubscriptions(){const e=this.store;if(!e)return;const i=this.videoConfig?.callbacks;i&&this.subscription.add(e.playerPhase.subscribe(o=>i.onPlayerPhaseChanged?.(o))).add(e.state.playbackState$.subscribe(o=>i.onPlaybackStateChanged?.(o))).add(e.state.isLive$.subscribe(o=>i.onIsLiveChanged?.(o))).add(e.state.isActiveLive$.subscribe(o=>i.onIsActiveLiveChanged?.(o))).add(e.state.isAudioAvailable$.subscribe(o=>i.onIsAudioAvailableChanged?.(o))).add(e.state.currentQuality$.subscribe(o=>i.onCurrentQualityChanged?.(o))).add(e.state.availableQualities$.subscribe(o=>i.onAvailableQualitiesChanged?.(o.map(({value:s})=>s).filter(s=>s!==po.AUTO)))).add(e.ui.isPictureInPictureActive$.subscribe(o=>o?i.onPiPEnter?.():i.onPiPExit?.()));const n=i?.uiInfo;n&&this.subscription.add(e.ui.controlsVisible.subscribe(o=>n.onControlsVisibleChanged?.(o))).add(e.ui.isMobile.subscribe(o=>n.onIsMobileChanged?.(o))).add(e.ui.playerSize.subscribe(o=>n.onPlayerSizeChanged?.(o))).add(e.ui.controls.prevButton.subscribe(o=>n.onPrevButtonChanged?.(o))).add(e.ui.controls.playButton.subscribe(o=>n.onPlayButtonChanged?.(o))).add(e.ui.controls.replayButton.subscribe(o=>n.onReplayButtonChanged?.(o))).add(e.ui.controls.nextButton.subscribe(o=>n.onNextButtonChanged?.(o))).add(e.ui.controls.playPrevChapterButton.subscribe(o=>n.onPlayPrevChapterChanged?.(o))).add(e.ui.controls.seekToInteractiveButton.subscribe(o=>n.onSeekToInteractiveButtonChanged?.(o))).add(e.ui.controls.interactiveGraphButton.subscribe(o=>n.onGraphButtonChanged?.(o))).add(e.ui.controls.liveButton.subscribe(o=>n.onLiveButtonChanged?.(o))).add(e.ui.controls.time.subscribe(o=>n.onTimeUpdateChanged?.(o))).add(e.ui.controls.episodes.subscribe(o=>n.onEpisodesChanged?.(o))).add(e.ui.controls.subtitles.subscribe(o=>n.onSubtitlesChanged?.(o))).add(e.ui.controls.settings.subscribe(o=>n.onSettingsChanged?.(o))).add(e.ui.controls.fullscreen.subscribe(o=>n.onFullscreenChanged?.(o))).add(e.ui.controls.chromecast.subscribe(o=>n.onChromecastChanged?.(o))).add(e.ui.controls.pip.subscribe(o=>n.onPipChanged?.(o))).add(e.ui.controls.vkLogo.subscribe(o=>n.onVkLogoChanged?.(o))).add(e.ui.controls.interactiveTimeIcon.subscribe(o=>n.onInteractiveTimeIconChanged?.(o)))}playNextVideo(){if(!this.videoConfig)return;let e=!0;if(this.videoConfig.callbacks?.onNextVideoClick)try{e=this.videoConfig.callbacks.onNextVideoClick()}catch{this.log({message:"onNextVideoClick callback failed to execute"})}e&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){if(!this.videoConfig)return;let e=!0;if(this.videoConfig.callbacks?.onPrevVideoClick)try{e=this.videoConfig.callbacks.onPrevVideoClick()}catch{this.log({message:"onPrevVideoClick callback failed to execute"})}e&&(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){if(!this.videoConfig)return;const n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&vn(n.unitedVideoId)&&this.store.actions.internal.nextMovie(n.unitedVideoId),this.svelteRootComponent?.$destroy(),this.createPlayer(n,{autoplay:i,fromTime:0},e)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){const e=this.interactiveController?.getNextInteractiveStartTime();typeof e=="number"&&this.seekTime(e/1e3)}toggleGraph(){if(!this.isInited)return;const e=this.store,{isEnded$:i,playbackState$:n,graphIsOpened$:o}=e.state,{disabledControls$:s}=e.ui.controls,l=xe(i),r=xe(n);xe(o)?(o.set(!1),this.interactiveController?.toggleGraphView(!1),s.remove(as),!l&&this.graphMadePause&&this.play()):(this.graphMadePause=r==="playing",o.set(!0),this.interactiveController?.toggleGraphView(!0),s.add(as),!l&&this.graphMadePause&&this.pause())}async initInteractives(){if(this.videoConfig?.interactiveData)try{const{Interactives:e,EVENT_NAMES:i,CustomError:n}=await import("@vkontakte/videoplayer-interactive/evergreen.esm.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const o=this.store?.interfaceLanguage$,s=o?xe(o):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:r,historyApi:a,videoLoader:c}=this.videoConfig.interactiveData;this.interactiveController=new e({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:s,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:r,historyApi:a,vkVideoLoader:c,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:f}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(h=>{if(!this.isInited)return;const _=this.store;h?_.ui.controls.disabledControls$.remove(st.SEEK_TO_INTERACTIVE_BUTTON):_.ui.controls.disabledControls$.add(st.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(f.subscribe(h=>{this.store&&this.store.state.isInteractiveExpectation$.set(h)}));let p=!0;if(this.interactiveController.on(i.playerChanged,h=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...h.config,title:l?.title||h.config.title};const _=p?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(h.player,_),p&&(p=!1)}),this.interactiveController.on(i.interactives,({type:h,actionType:_})=>{if(!this.store)return;const b=f.getValue();if(h==="action-choice"&&_==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(S1)),h==="action-choice-canceled"){const k=xe(this.store.state.isPlaying$)||b;if(this.videoConfig?.isMobile&&k){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}}),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){const h=this.interactiveController.getHistoryState();this.subscription.add(h.history$.subscribe(_=>{_.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(_)}))}this.interactiveController.events.noInteraction$.subscribe(()=>{this.videoConfig?.callbacks.onInteractiveTimeIconClick?.()}),this.interactiveController.on(i.errors,h=>{this.log({message:h.toString()})})}catch(e){this.log({message:e.message})}}async initInteractivesStatistics(){const{statSubscription:e,oneStat:i}=this.statistics;if(!(!e||!i||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:n}=await import("@vkontakte/videoplayer-interactive/evergreen.esm.js"),o={[n.GO_NEXT_BUTTON]:So.NEXT_BUTTON,[n.GO_NEXT_AREA]:So.NEXT_AREA,[n.WATCH_AGAIN]:So.WATCH_AGAIN,[n.OPEN_GRAPH]:So.GRAPH_SHOW,[n.CLOSE_GRAPH]:So.GRAPH_HIDE},{click$:s,nextMovie$:l}=this.interactiveController.getStatEvents(),r=new cn;s.subscribe(a=>{a in o?r.next(o[a]):(i?.logError({errorType:"InteractiveVideosAction",fatal:!1}),this.sentry.report?.(new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),e.add(i.attachToInteractive({click$:r,nextMovie$:l}))}catch(n){i?.logError({errorType:"InteractiveVideos",fatal:!1}),this.sentry.report?.(n,{errorType:"InteractiveVideosAction",fatal:!1})}}initPlayer(e,i={}){if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=d1(g5,zc(e,n=>n instanceof HTMLElement?n:void 0)),this.uiConfig=$c(i.ui??{}),this.coreConfig=i.core??{configName:[]},this.statisticsConfig=i.statistics??{},this.sentry={config:this.uiConfig.sentry??{}},vn(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.videoConfig.isMediaSessionEnabled??!0),vn(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=this.uiConfig.features.pip??this.videoConfig.isPictureInPictureEnabled??!0,this.uiConfig.features.dpip=this.uiConfig.features.dpip??this.videoConfig.isPictureInPictureEnabled??!0),this.videoConfig.isMobile=this.uiConfig.isMobile??this.videoConfig.isMobile,this.videoConfig.autoplay&&=this.uiConfig.features.autoplay,this.videoConfig.showAds=this.uiConfig.ads.enable??this.videoConfig.showAds,this.videoConfig.adsSlotId=this.uiConfig.ads.slot??this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=this.uiConfig.ads.preview??this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!(this.uiConfig.showLogo??!this.videoConfig.logoHidden),this.videoConfig.canRewindLive&&=this.uiConfig.features.liveRewind,this.videoConfig.supportLink=this.videoConfig.supportLink??this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=l5.getLatestSupportedVersion():this.pictureInPictureApi=new zl),this.mediaSessionApi=this.uiConfig.features.mediaSession?new Qh:void 0,this.annotationsApi=this.uiConfig.features.annotations?new f5(this.rootContainer):void 0,this.svelteStubComponent?.$destroy(),this.svelteRootComponent?.$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]),o5(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){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 i=this.getNextVideoInfo();this.svelteRootComponent?.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:i.nextVideoTitle,endScreenVideoThumb:i.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(e=>{e===De.Video?this.setupMediaSessionForVideo():e===De.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",o=>this.seekTime(o.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(){this.isControlDisabled(st.PLAY_BUTTON)||this.store?.playerPhase.is(De.WaitingLive)||(this.log({message:"play"}),this.svelteRootComponent?.play())}pause(){this.log({message:"pause"}),this.svelteRootComponent?.pause()}stop(){if(!this.videoConfig)return;this.log({message:"stop"}),this.svelteStubComponent?.$destroy();const e=this.videoConfig.videos[0];e&&(this.svelteRootComponent?.$destroy(),this.createPlayer(e))}setMuted(e){this.log({message:`set muted, muted: ${e}`}),this.svelteRootComponent?.setMuted(e)}setVolume(e){this.log({message:`set volume, volume: ${e}`}),this.svelteRootComponent?.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,this.svelteRootComponent?.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){this.isControlDisabled(st.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),this.svelteRootComponent?.seekTime(e))}seekEpisodeStartTime(e){this.log({message:`seek episode start time, time: ${e}`}),this.svelteRootComponent?.seekEpisodeStartTime(e)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(e){this.log({message:`set playback rate to: ${e}`}),this.svelteRootComponent?.setPlaybackRate(e)}setAutoQualityLimits(e){this.log({message:`set auto quality limitation. Max: ${e.max??"none"}. Min: ${e.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(e)}addLanguage(e){this.store?.actions.internal.addLanguage(e)}async setLanguage(e){await this.store?.actions.internal.setLanguage(e)}setLiveStart(e){this.log({message:"live started"}),this.store?.actions.internal.setWaitingLive(!1),this.svelteRootComponent?.initVideo(e),this.play()}setWaitRecord(){this.log({message:"post live"}),this.store?.actions.internal.setWaitingRecord(!0),this.store?.destroy()}setLiveEnd(e){this.log({message:"live ended"}),this.store?.actions.internal.setWaitingRecord(!1),this.svelteRootComponent?.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){return this.statistics?.oneStat.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const C5=()=>{window.customElements.define("vk-video-player",b5)};export{vt as GridTypes,A5 as InterfaceLanguage,Rl as VERSION,L5 as VKNumericLanguage,T5 as VideoFormat,E5 as VideoQuality,V5 as loadVKLangPack,C5 as registerPlayerWebComponent};
package/index.d.ts CHANGED
@@ -303,6 +303,7 @@ interface IVKVideoPlayerConfig {
303
303
  is3DVideo?: boolean;
304
304
  callbacks?: IVKVideoPlayerCallbacks;
305
305
  additionalButtons?: AdditionalButton[];
306
+ refDomain?: string;
306
307
  }
307
308
  interface IControlInfo {
308
309
  /** @deprecated Используйте новое поле left */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.36-dev.55db5eff.0",
3
+ "version": "1.1.36-dev.cdb7114a.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -49,9 +49,9 @@
49
49
  "**/*.d.ts"
50
50
  ],
51
51
  "dependencies": {
52
- "@vkontakte/videoplayer-core": "2.0.103-dev.cd1de8dc.0",
53
- "@vkontakte/videoplayer-interactive": "1.0.11-dev.b72fcea2.0",
54
- "@vkontakte/videoplayer-shared": "1.0.36-dev.ae47f304.0",
55
- "@vkontakte/videoplayer-statistics": "1.0.49-dev.c0d58556.0"
52
+ "@vkontakte/videoplayer-core": "2.0.103-dev.620e0c0f.0",
53
+ "@vkontakte/videoplayer-interactive": "1.0.11-dev.a84df2c4.0",
54
+ "@vkontakte/videoplayer-shared": "1.0.36-dev.0bff0a16.0",
55
+ "@vkontakte/videoplayer-statistics": "1.0.49-dev.19c9e410.0"
56
56
  }
57
57
  }