@vkontakte/videoplayer 1.1.44-dev.63a413bf.0 → 1.1.44-dev.871d1572.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.44-dev.63a413bf.0
3
- * Tue, 17 Sep 2024 05:40:47 GMT
2
+ * @vkontakte/videoplayer v1.1.44-dev.871d1572.0
3
+ * Tue, 17 Sep 2024 06:14:45 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-1-44/doc/
5
5
  */
6
- function Se(){}function ue(t,e){for(let i in e)t[i]=e[i];return t}function fs(t){return t()}function Kl(){return Object.create(null)}function tt(t){t.forEach(fs)}function Ii(t){return typeof t=="function"}function F(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}var Ul;function ds(t,e){return t===e?!0:(Ul||(Ul=document.createElement("a")),Ul.href=e,t===Ul.href)}function Pc(t){return Object.keys(t).length===0}function Ot(t,...e){if(t==null){for(let n of e)n(void 0);return Se}let i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function Je(t){let e;return Ot(t,i=>e=i)(),e}function q(t,e,i){t.$$.on_destroy.push(Ot(e,i))}function Ie(t,e,i,n){if(t){let o=Tc(t,e,i,n);return t[0](o)}}function Tc(t,e,i,n){return t[1]&&n?ue(i.ctx.slice(),t[1](n(e))):i.ctx}function Ee(t,e,i,n){if(t[2]&&n){let o=t[2](n(i));if(e.dirty===void 0)return o;if(typeof o=="object"){let l=[],r=Math.max(e.dirty.length,o.length);for(let a=0;a<r;a+=1)l[a]=e.dirty[a]|o[a];return l}return e.dirty|o}return e.dirty}function Ae(t,e,i,n,o,l){if(o){let r=Tc(e,i,n,l);t.p(r,o)}}function Le(t){if(t.ctx.length>32){let e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function ve(t){let e={};for(let i in t)i[0]!=="$"&&(e[i]=t[i]);return e}function Ic(t){return t??""}var ko=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;var Wl=class t{_listeners="WeakMap"in ko?new WeakMap:void 0;_observer=void 0;options;constructor(e){this.options=e}observe(e,i){return this._listeners.set(e,i),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(e=>{for(let i of e)t.entries.set(i.target,i),this._listeners.get(i.target)?.(i)}))}};Wl.entries="WeakMap"in ko?new WeakMap:void 0;var Ec=!1;function Ac(){Ec=!0}function Lc(){Ec=!1}function m(t,e){t.appendChild(e)}function Pe(t,e,i){let n=Mc(t);if(!n.getElementById(e)){let o=P("style");o.id=e,o.textContent=i,p_(n,o)}}function Mc(t){if(!t)return document;let e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function p_(t,e){return m(t.head||t,e),e.sheet}function w(t,e,i){t.insertBefore(e,i||null)}function k(t){t.parentNode&&t.parentNode.removeChild(t)}function Ei(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function P(t){return document.createElement(t)}function R(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Re(t){return document.createTextNode(t)}function M(){return Re(" ")}function ut(){return Re("")}function _e(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Ft(t){return function(e){return e.preventDefault(),t.call(this,e)}}function ot(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function c(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ye(t,e){for(let i in e)c(t,i,e[i])}function Vc(t){return Array.from(t.childNodes)}function je(t,e){e=""+e,t.data!==e&&(t.data=e)}function gi(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}var jl;function __(){if(jl===void 0){jl=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{jl=!0}}return jl}function Go(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");let n=P("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let o=__(),l;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",l=_e(window,"message",r=>{r.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{l=_e(n.contentWindow,"resize",e),e()}),m(t,n),()=>{(o||l&&n.contentWindow)&&l(),k(n)}}function D(t,e,i){t.classList.toggle(e,!!i)}function Rc(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}function gn(t,e){return new t(e)}var so;function Zn(t){so=t}function Qo(){if(!so)throw new Error("Function called outside component initialization");return so}function Pt(t){Qo().$$.on_mount.push(t)}function Hn(t){Qo().$$.on_destroy.push(t)}function Yo(t,e){return Qo().$$.context.set(t,e),e}function Zo(t){return Qo().$$.context.get(t)}function Cl(){return Qo().$$.context}function Cn(t,e){let i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}var wo=[];var be=[],Jo=[],ps=[],Dc=Promise.resolve(),_s=!1;function hs(){_s||(_s=!0,Dc.then(Gl))}function zn(){return hs(),Dc}function Un(t){Jo.push(t)}function Ne(t){ps.push(t)}var ms=new Set,Xo=0;function Gl(){if(Xo!==0)return;let t=so;do{try{for(;Xo<wo.length;){let e=wo[Xo];Xo++,Zn(e),k_(e.$$)}}catch(e){throw wo.length=0,Xo=0,e}for(Zn(null),wo.length=0,Xo=0;be.length;)be.pop()();for(let e=0;e<Jo.length;e+=1){let i=Jo[e];ms.has(i)||(ms.add(i),i())}Jo.length=0}while(wo.length);for(;ps.length;)ps.pop()();_s=!1,ms.clear(),Zn(t)}function k_(t){if(t.fragment!==null){t.update(),tt(t.before_update);let e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Un)}}function qc(t){let e=[],i=[];Jo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Jo=e}var Ql=new Set,Co;function me(){Co={r:0,c:[],p:Co}}function pe(){Co.r||tt(Co.c),Co=Co.p}function d(t,e){t&&t.i&&(Ql.delete(t),t.i(e))}function _(t,e,i,n){if(t&&t.o){if(Ql.has(t))return;Ql.add(t),Co.c.push(()=>{Ql.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function St(t){return t?.length!==void 0?t:Array.from(t)}function Be(t,e){let i={},n={},o={$$scope:1},l=t.length;for(;l--;){let r=t[l],a=e[l];if(a){for(let s in r)s in a||(n[s]=1);for(let s in a)o[s]||(i[s]=a[s],o[s]=1);t[l]=a}else for(let s in r)o[s]=1}for(let r in n)r in i||(i[r]=void 0);return i}function Nc(t){return typeof t=="object"&&t!==null?t:{}}var w_=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],C_=new Set([...w_]);function Oe(t,e,i){let n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function V(t){t&&t.c()}function A(t,e,i){let{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),Un(()=>{let l=t.$$.on_mount.map(fs).filter(Ii);t.$$.on_destroy?t.$$.on_destroy.push(...l):tt(l),t.$$.on_mount=[]}),o.forEach(Un)}function L(t,e){let i=t.$$;i.fragment!==null&&(qc(i.after_update),tt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function P_(t,e){t.$$.dirty[0]===-1&&(wo.push(t),hs(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(t,e,i,n,o,l,r=null,a=[-1]){let s=so;Zn(t);let u=t.$$={fragment:null,ctx:[],props:l,update:Se,not_equal:o,bound:Kl(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(s?s.$$.context:[])),callbacks:Kl(),dirty:a,skip_bound:!1,root:e.target||s.$$.root};r&&r(u.root);let f=!1;if(u.ctx=i?i(t,e.props||{},(p,h,...C)=>{let g=C.length?C[0]:h;return u.ctx&&o(u.ctx[p],u.ctx[p]=g)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](g),f&&P_(t,p)),h}):[],u.update(),f=!0,tt(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){Ac();let p=Vc(e.target);u.fragment&&u.fragment.l(p),p.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&d(t.$$.fragment),A(t,e.target,e.anchor),Lc(),Gl()}Zn(s)}var T_;typeof HTMLElement=="function"&&(T_=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,i){super(),this.$$ctor=t,this.$$s=e,i&&this.attachShadow({mode:"open"})}addEventListener(t,e,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,i)}removeEventListener(t,e,i){if(super.removeEventListener(t,e,i),this.$$c){let n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let r;return{c:function(){r=P("slot"),l!=="default"&&c(r,"name",l)},m:function(u,f){w(u,r,f)},d:function(u){u&&k(r)}}}};var t=e;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let i={},n=Rc(this);for(let l of this.$$s)l in n&&(i[l]=[e(l)]);for(let l of this.attributes){let r=this.$$g_p(l.name);r in this.$$d||(this.$$d[r]=gs(r,l.value,this.$$p_d,"toProp"))}for(let l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$scope:{ctx:[]}}});let o=()=>{this.$$r=!0;for(let l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){let r=gs(l,this.$$d[l],this.$$p_d,"toAttribute");r==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,r)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(let l in this.$$l)for(let r of this.$$l[l]){let a=this.$$c.$on(l,r);this.$$l_u.set(r,a)}this.$$l={}}}attributeChangedCallback(t,e,i){this.$$r||(t=this.$$g_p(t),this.$$d[t]=gs(t,i,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function gs(t,e,i,n){let o=i[t]?.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!i[t])return e;if(n==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var H=class{$$=void 0;$$set=void 0;$destroy(){L(this,1),this.$destroy=Se}$on(e,i){if(!Ii(i))return Se;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{let o=n.indexOf(i);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!Pc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Oc="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Oc);import"@vkontakte/videoplayer-core";import{noop as _l,safeStorage as D6,throttleFn as q6}from"@vkontakte/videoplayer-shared";import{SeekAction as N6}from"@vkontakte/videoplayer-statistics";import{InterfaceLanguage as I_,fillWithDefault as E_,VideoQuality as A_}from"@vkontakte/videoplayer-shared";var L_={isMobile:void 0,defaultLanguage:I_.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:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:A_.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,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1},controls:{showOnStartupAtAutoplay:!0,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,runtimeTimeout:5e3,slot:void 0,preview:void 0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},Fc=t=>E_(t,L_),Hc=t=>Yo("ui-config",t),Mt=()=>Zo("ui-config");var Sl="vk_player_debug_panel_opened";var zc="videoplayer",Uc="videoplayer";var Gn={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Kc=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Wc=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),jc=new Set(["ShiftRight","ShiftLeft"]);var Gc=["TIMELINE"],Pl=[...Gc,"GRAPH_BUTTON"],bs=[...Gc,"PLAY_BUTTON"],Yl=[...Pl,"PLAY_BUTTON"];var Po=(l=>(l.XS="xs",l.S="s",l.M="m",l.L="l",l.XL="xl",l))(Po||{}),To={xs:0,s:1,m:2,l:3,xl:4};var xo=[];function Bn(t,e){return{subscribe:De(t,e).subscribe}}function De(t,e=Se){let i,n=new Set;function o(a){if(F(t,a)&&(t=a,i)){let s=!xo.length;for(let u of n)u[1](),xo.push(u,t);if(s){for(let u=0;u<xo.length;u+=2)xo[u][0](xo[u+1]);xo.length=0}}}function l(a){o(a(t))}function r(a,s=Se){let u=[a,s];return n.add(u),n.size===1&&(i=e(o,l)||Se),a(t),()=>{n.delete(u),n.size===0&&i&&(i(),i=null)}}return{set:o,update:l,subscribe:r}}function Ai(t,e,i){let n=!Array.isArray(t),o=n?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let l=e.length<2;return Bn(i,(r,a)=>{let s=!1,u=[],f=0,p=Se,h=()=>{if(f)return;p();let g=e(n?u[0]:u,r,a);l?r(g):p=Ii(g)?g:Se},C=o.map((g,S)=>Ot(g,b=>{u[S]=b,f&=~(1<<S),s&&h()},()=>{f|=1<<S}));return s=!0,h(),function(){tt(C),p(),s=!1}})}import{assertNonNullable as Qc,VERSION as M_}from"@vkontakte/videoplayer-shared";import{VERSION as V_}from"@vkontakte/videoplayer-core";import{VERSION as R_}from"@vkontakte/videoplayer-statistics";var Zl="prod",$o="1.1.44-dev.63a413bf.0";var Io=(t,e,i)=>{let n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()};var Yc=Symbol("storeContext"),Zc=Symbol("microStoresContext"),Xc=(t,e)=>{Yo(Yc,t),Yo(Zc,e),Zl==="dev"&&(window.app={store:t,microStores:e})},it=()=>{let t=Zo(Yc);return Qc(t,"Store context is empty!"),t},Dn=()=>{let t=Zo(Zc);return Qc(t,"MicroStores context is empty!"),t},gt=(t,e)=>vs(t,t.getValue(),e),vs=(t,e,i)=>Bn(e,n=>{let o=t.subscribe(l=>{n(l),i?.(l)});return()=>o.unsubscribe()}),Jc=(t,e,i)=>{let n=t.info,{width:o,height:l}=Je(i.ui.playerSize),r=n.throughputEstimation$.getValue()?.toFixed(0)??0,a=n.rttEstimation$.getValue()?.toFixed(0)??0,s=n.isAutoQualityEnabled$.getValue()?"auto":"manual",u=`${$o} (core: ${V_}, stat: ${R_}, shared: ${M_})`,f=Je(i.state.errorLog$),p=f.length?`
6
+ function Se(){}function ue(t,e){for(let i in e)t[i]=e[i];return t}function fs(t){return t()}function Kl(){return Object.create(null)}function tt(t){t.forEach(fs)}function Ii(t){return typeof t=="function"}function F(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}var Ul;function ds(t,e){return t===e?!0:(Ul||(Ul=document.createElement("a")),Ul.href=e,t===Ul.href)}function Pc(t){return Object.keys(t).length===0}function Ot(t,...e){if(t==null){for(let n of e)n(void 0);return Se}let i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function Je(t){let e;return Ot(t,i=>e=i)(),e}function q(t,e,i){t.$$.on_destroy.push(Ot(e,i))}function Ie(t,e,i,n){if(t){let o=Tc(t,e,i,n);return t[0](o)}}function Tc(t,e,i,n){return t[1]&&n?ue(i.ctx.slice(),t[1](n(e))):i.ctx}function Ee(t,e,i,n){if(t[2]&&n){let o=t[2](n(i));if(e.dirty===void 0)return o;if(typeof o=="object"){let l=[],r=Math.max(e.dirty.length,o.length);for(let a=0;a<r;a+=1)l[a]=e.dirty[a]|o[a];return l}return e.dirty|o}return e.dirty}function Ae(t,e,i,n,o,l){if(o){let r=Tc(e,i,n,l);t.p(r,o)}}function Le(t){if(t.ctx.length>32){let e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function ve(t){let e={};for(let i in t)i[0]!=="$"&&(e[i]=t[i]);return e}function Ic(t){return t??""}var ko=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;var Wl=class t{_listeners="WeakMap"in ko?new WeakMap:void 0;_observer=void 0;options;constructor(e){this.options=e}observe(e,i){return this._listeners.set(e,i),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(e=>{for(let i of e)t.entries.set(i.target,i),this._listeners.get(i.target)?.(i)}))}};Wl.entries="WeakMap"in ko?new WeakMap:void 0;var Ec=!1;function Ac(){Ec=!0}function Lc(){Ec=!1}function m(t,e){t.appendChild(e)}function Pe(t,e,i){let n=Mc(t);if(!n.getElementById(e)){let o=P("style");o.id=e,o.textContent=i,p_(n,o)}}function Mc(t){if(!t)return document;let e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function p_(t,e){return m(t.head||t,e),e.sheet}function w(t,e,i){t.insertBefore(e,i||null)}function k(t){t.parentNode&&t.parentNode.removeChild(t)}function Ei(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function P(t){return document.createElement(t)}function R(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Re(t){return document.createTextNode(t)}function M(){return Re(" ")}function ut(){return Re("")}function _e(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Ft(t){return function(e){return e.preventDefault(),t.call(this,e)}}function ot(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function c(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ye(t,e){for(let i in e)c(t,i,e[i])}function Vc(t){return Array.from(t.childNodes)}function je(t,e){e=""+e,t.data!==e&&(t.data=e)}function gi(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}var jl;function __(){if(jl===void 0){jl=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{jl=!0}}return jl}function Go(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");let n=P("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let o=__(),l;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",l=_e(window,"message",r=>{r.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{l=_e(n.contentWindow,"resize",e),e()}),m(t,n),()=>{(o||l&&n.contentWindow)&&l(),k(n)}}function D(t,e,i){t.classList.toggle(e,!!i)}function Rc(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}function gn(t,e){return new t(e)}var so;function Zn(t){so=t}function Qo(){if(!so)throw new Error("Function called outside component initialization");return so}function Pt(t){Qo().$$.on_mount.push(t)}function Hn(t){Qo().$$.on_destroy.push(t)}function Yo(t,e){return Qo().$$.context.set(t,e),e}function Zo(t){return Qo().$$.context.get(t)}function Cl(){return Qo().$$.context}function Cn(t,e){let i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}var wo=[];var be=[],Jo=[],ps=[],Dc=Promise.resolve(),_s=!1;function hs(){_s||(_s=!0,Dc.then(Gl))}function zn(){return hs(),Dc}function Un(t){Jo.push(t)}function Ne(t){ps.push(t)}var ms=new Set,Xo=0;function Gl(){if(Xo!==0)return;let t=so;do{try{for(;Xo<wo.length;){let e=wo[Xo];Xo++,Zn(e),k_(e.$$)}}catch(e){throw wo.length=0,Xo=0,e}for(Zn(null),wo.length=0,Xo=0;be.length;)be.pop()();for(let e=0;e<Jo.length;e+=1){let i=Jo[e];ms.has(i)||(ms.add(i),i())}Jo.length=0}while(wo.length);for(;ps.length;)ps.pop()();_s=!1,ms.clear(),Zn(t)}function k_(t){if(t.fragment!==null){t.update(),tt(t.before_update);let e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Un)}}function qc(t){let e=[],i=[];Jo.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Jo=e}var Ql=new Set,Co;function me(){Co={r:0,c:[],p:Co}}function pe(){Co.r||tt(Co.c),Co=Co.p}function d(t,e){t&&t.i&&(Ql.delete(t),t.i(e))}function _(t,e,i,n){if(t&&t.o){if(Ql.has(t))return;Ql.add(t),Co.c.push(()=>{Ql.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function St(t){return t?.length!==void 0?t:Array.from(t)}function Be(t,e){let i={},n={},o={$$scope:1},l=t.length;for(;l--;){let r=t[l],a=e[l];if(a){for(let s in r)s in a||(n[s]=1);for(let s in a)o[s]||(i[s]=a[s],o[s]=1);t[l]=a}else for(let s in r)o[s]=1}for(let r in n)r in i||(i[r]=void 0);return i}function Nc(t){return typeof t=="object"&&t!==null?t:{}}var w_=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],C_=new Set([...w_]);function Oe(t,e,i){let n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function V(t){t&&t.c()}function A(t,e,i){let{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),Un(()=>{let l=t.$$.on_mount.map(fs).filter(Ii);t.$$.on_destroy?t.$$.on_destroy.push(...l):tt(l),t.$$.on_mount=[]}),o.forEach(Un)}function L(t,e){let i=t.$$;i.fragment!==null&&(qc(i.after_update),tt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function P_(t,e){t.$$.dirty[0]===-1&&(wo.push(t),hs(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(t,e,i,n,o,l,r=null,a=[-1]){let s=so;Zn(t);let u=t.$$={fragment:null,ctx:[],props:l,update:Se,not_equal:o,bound:Kl(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(s?s.$$.context:[])),callbacks:Kl(),dirty:a,skip_bound:!1,root:e.target||s.$$.root};r&&r(u.root);let f=!1;if(u.ctx=i?i(t,e.props||{},(p,h,...C)=>{let g=C.length?C[0]:h;return u.ctx&&o(u.ctx[p],u.ctx[p]=g)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](g),f&&P_(t,p)),h}):[],u.update(),f=!0,tt(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){Ac();let p=Vc(e.target);u.fragment&&u.fragment.l(p),p.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&d(t.$$.fragment),A(t,e.target,e.anchor),Lc(),Gl()}Zn(s)}var T_;typeof HTMLElement=="function"&&(T_=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,i){super(),this.$$ctor=t,this.$$s=e,i&&this.attachShadow({mode:"open"})}addEventListener(t,e,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,i)}removeEventListener(t,e,i){if(super.removeEventListener(t,e,i),this.$$c){let n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let r;return{c:function(){r=P("slot"),l!=="default"&&c(r,"name",l)},m:function(u,f){w(u,r,f)},d:function(u){u&&k(r)}}}};var t=e;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let i={},n=Rc(this);for(let l of this.$$s)l in n&&(i[l]=[e(l)]);for(let l of this.attributes){let r=this.$$g_p(l.name);r in this.$$d||(this.$$d[r]=gs(r,l.value,this.$$p_d,"toProp"))}for(let l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$scope:{ctx:[]}}});let o=()=>{this.$$r=!0;for(let l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){let r=gs(l,this.$$d[l],this.$$p_d,"toAttribute");r==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,r)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(let l in this.$$l)for(let r of this.$$l[l]){let a=this.$$c.$on(l,r);this.$$l_u.set(r,a)}this.$$l={}}}attributeChangedCallback(t,e,i){this.$$r||(t=this.$$g_p(t),this.$$d[t]=gs(t,i,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function gs(t,e,i,n){let o=i[t]?.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!i[t])return e;if(n==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var H=class{$$=void 0;$$set=void 0;$destroy(){L(this,1),this.$destroy=Se}$on(e,i){if(!Ii(i))return Se;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{let o=n.indexOf(i);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!Pc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Oc="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Oc);import"@vkontakte/videoplayer-core";import{noop as _l,safeStorage as D6,throttleFn as q6}from"@vkontakte/videoplayer-shared";import{SeekAction as N6}from"@vkontakte/videoplayer-statistics";import{InterfaceLanguage as I_,fillWithDefault as E_,VideoQuality as A_}from"@vkontakte/videoplayer-shared";var L_={isMobile:void 0,defaultLanguage:I_.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:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:A_.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,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1},controls:{showOnStartupAtAutoplay:!0,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,runtimeTimeout:5e3,slot:void 0,preview:void 0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},Fc=t=>E_(t,L_),Hc=t=>Yo("ui-config",t),Mt=()=>Zo("ui-config");var Sl="vk_player_debug_panel_opened";var zc="videoplayer",Uc="videoplayer";var Gn={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Kc=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Wc=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),jc=new Set(["ShiftRight","ShiftLeft"]);var Gc=["TIMELINE"],Pl=[...Gc,"GRAPH_BUTTON"],bs=[...Gc,"PLAY_BUTTON"],Yl=[...Pl,"PLAY_BUTTON"];var Po=(l=>(l.XS="xs",l.S="s",l.M="m",l.L="l",l.XL="xl",l))(Po||{}),To={xs:0,s:1,m:2,l:3,xl:4};var xo=[];function Bn(t,e){return{subscribe:De(t,e).subscribe}}function De(t,e=Se){let i,n=new Set;function o(a){if(F(t,a)&&(t=a,i)){let s=!xo.length;for(let u of n)u[1](),xo.push(u,t);if(s){for(let u=0;u<xo.length;u+=2)xo[u][0](xo[u+1]);xo.length=0}}}function l(a){o(a(t))}function r(a,s=Se){let u=[a,s];return n.add(u),n.size===1&&(i=e(o,l)||Se),a(t),()=>{n.delete(u),n.size===0&&i&&(i(),i=null)}}return{set:o,update:l,subscribe:r}}function Ai(t,e,i){let n=!Array.isArray(t),o=n?[t]:t;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let l=e.length<2;return Bn(i,(r,a)=>{let s=!1,u=[],f=0,p=Se,h=()=>{if(f)return;p();let g=e(n?u[0]:u,r,a);l?r(g):p=Ii(g)?g:Se},C=o.map((g,S)=>Ot(g,b=>{u[S]=b,f&=~(1<<S),s&&h()},()=>{f|=1<<S}));return s=!0,h(),function(){tt(C),p(),s=!1}})}import{assertNonNullable as Qc,VERSION as M_}from"@vkontakte/videoplayer-shared";import{VERSION as V_}from"@vkontakte/videoplayer-core";import{VERSION as R_}from"@vkontakte/videoplayer-statistics";var Zl="prod",$o="1.1.44-dev.871d1572.0";var Io=(t,e,i)=>{let n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()};var Yc=Symbol("storeContext"),Zc=Symbol("microStoresContext"),Xc=(t,e)=>{Yo(Yc,t),Yo(Zc,e),Zl==="dev"&&(window.app={store:t,microStores:e})},it=()=>{let t=Zo(Yc);return Qc(t,"Store context is empty!"),t},Dn=()=>{let t=Zo(Zc);return Qc(t,"MicroStores context is empty!"),t},gt=(t,e)=>vs(t,t.getValue(),e),vs=(t,e,i)=>Bn(e,n=>{let o=t.subscribe(l=>{n(l),i?.(l)});return()=>o.unsubscribe()}),Jc=(t,e,i)=>{let n=t.info,{width:o,height:l}=Je(i.ui.playerSize),r=n.throughputEstimation$.getValue()?.toFixed(0)??0,a=n.rttEstimation$.getValue()?.toFixed(0)??0,s=n.isAutoQualityEnabled$.getValue()?"auto":"manual",u=`${$o} (core: ${V_}, stat: ${R_}, shared: ${M_})`,f=Je(i.state.errorLog$),p=f.length?`
7
7
  `+f.map((E,v)=>{let y=`${v}) Type: ${E.id}
8
8
  `,T=`Message: ${E.message} (${E.thrown})
9
9
  `,W=`Trace: ${E.thrown?.stack}
@@ -50,4 +50,4 @@ function Se(){}function ue(t,e){for(let i in e)t[i]=e[i];return t}function fs(t)
50
50
  rgba(0, 0, 0, 0.99) 93.33%,
51
51
  #000 100%
52
52
  );--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;--controls-container-z-index:1;--ads-container-z-index:1;--mobile-settings-menu-z-index:1;--thumb-timer-z-index:2;--debug-panel-z-index:2;--context-menu-z-index:3;--hot-key-helpers-container-z-index:3;--overlay-container-z-index:4;--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)}*{-webkit-tap-highlight-color:transparent}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:var(--overlay-container-z-index)}.out-of-view{position:absolute !important;left:-1000vh !important}`)}function F6(t){let e,i,n;function o(r){t[61](r)}let l={store:t[0],uiConfig:t[35],title:t[1],thumbUrl:t[2],interactiveContainer:t[3],live:t[4],autoplay:t[5],canRewindLive:t[6],showAds:t[7],adsSlotId:t[8],adsParams:t[9],adsPreviewParam:t[10],duration:t[11],logoClickable:t[12],logoHidden:t[13],logoTargetUrl:t[36],showNextPrevButtons:t[15],nextButtonActive:t[16],prevButtonActive:t[17],endScreenVideoTitle:t[18],endScreenVideoThumb:t[19],isOneVideoPlaylist:t[20],supportLink:t[21],shadowRootContainer: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[38]};return t[33]!==void 0&&(l.videoContainer=t[33]),e=new lp({props:l}),be.push(()=>Oe(e,"videoContainer",o)),{c(){V(e.$$.fragment)},m(r,a){A(e,r,a),n=!0},p(r,a){let s={};a[0]&1&&(s.store=r[0]),a[0]&2&&(s.title=r[1]),a[0]&4&&(s.thumbUrl=r[2]),a[0]&8&&(s.interactiveContainer=r[3]),a[0]&16&&(s.live=r[4]),a[0]&32&&(s.autoplay=r[5]),a[0]&64&&(s.canRewindLive=r[6]),a[0]&128&&(s.showAds=r[7]),a[0]&256&&(s.adsSlotId=r[8]),a[0]&512&&(s.adsParams=r[9]),a[0]&1024&&(s.adsPreviewParam=r[10]),a[0]&2048&&(s.duration=r[11]),a[0]&4096&&(s.logoClickable=r[12]),a[0]&8192&&(s.logoHidden=r[13]),a[0]&32768&&(s.showNextPrevButtons=r[15]),a[0]&65536&&(s.nextButtonActive=r[16]),a[0]&131072&&(s.prevButtonActive=r[17]),a[0]&262144&&(s.endScreenVideoTitle=r[18]),a[0]&524288&&(s.endScreenVideoThumb=r[19]),a[0]&1048576&&(s.isOneVideoPlaylist=r[20]),a[0]&2097152&&(s.supportLink=r[21]),a[0]&4194304&&(s.shadowRootContainer=r[22]),a[0]&8388608&&(s.outerContainerRef=r[23]),a[0]&16777216&&(s.fullScreenTarget=r[24]),a[0]&33554432&&(s.showMiniTimer=r[25]),a[1]&8&&(s.playerStarted=r[34]),a[0]&67108864&&(s.playNextVideo=r[26]),a[0]&134217728&&(s.playPrevVideo=r[27]),a[0]&268435456&&(s.repeatPlaylist=r[28]),a[0]&536870912&&(s.seekToInteractive=r[29]),a[0]&1073741824&&(s.toggleGraph=r[30]),a[1]&1&&(s.playPrevChapter=r[31]),!i&&a[1]&4&&(i=!0,s.videoContainer=r[33],Ne(()=>i=!1)),e.$set(s)},i(r){n||(d(e.$$.fragment,r),n=!0)},o(r){_(e.$$.fragment,r),n=!1},d(r){L(e,r)}}}function H6(t){let e,i,n;function o(r){t[60](r)}let l={store:t[0],uiConfig:t[35],thumbUrl:t[2],interactiveContainer:t[3],live:t[4],autoplay:t[5],canRewindLive:t[6],showAds:t[7],adsSlotId:t[8],adsParams:t[9],adsPreviewParam:t[10],duration:t[11],logoClickable:t[12],logoHidden:t[13],logoTargetUrl:t[36],showNextPrevButtons:t[15],nextButtonActive:t[16],prevButtonActive:t[17],endScreenVideoTitle:t[18],endScreenVideoThumb:t[19],isOneVideoPlaylist:t[20],supportLink:t[21],shadowRootContainer: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[38],seekTime:t[32]};return t[33]!==void 0&&(l.videoContainer=t[33]),e=new Sp({props:l}),be.push(()=>Oe(e,"videoContainer",o)),{c(){V(e.$$.fragment)},m(r,a){A(e,r,a),n=!0},p(r,a){let s={};a[0]&1&&(s.store=r[0]),a[0]&4&&(s.thumbUrl=r[2]),a[0]&8&&(s.interactiveContainer=r[3]),a[0]&16&&(s.live=r[4]),a[0]&32&&(s.autoplay=r[5]),a[0]&64&&(s.canRewindLive=r[6]),a[0]&128&&(s.showAds=r[7]),a[0]&256&&(s.adsSlotId=r[8]),a[0]&512&&(s.adsParams=r[9]),a[0]&1024&&(s.adsPreviewParam=r[10]),a[0]&2048&&(s.duration=r[11]),a[0]&4096&&(s.logoClickable=r[12]),a[0]&8192&&(s.logoHidden=r[13]),a[0]&32768&&(s.showNextPrevButtons=r[15]),a[0]&65536&&(s.nextButtonActive=r[16]),a[0]&131072&&(s.prevButtonActive=r[17]),a[0]&262144&&(s.endScreenVideoTitle=r[18]),a[0]&524288&&(s.endScreenVideoThumb=r[19]),a[0]&1048576&&(s.isOneVideoPlaylist=r[20]),a[0]&2097152&&(s.supportLink=r[21]),a[0]&4194304&&(s.shadowRootContainer=r[22]),a[0]&8388608&&(s.outerContainerRef=r[23]),a[0]&16777216&&(s.fullScreenTarget=r[24]),a[0]&33554432&&(s.showMiniTimer=r[25]),a[1]&8&&(s.playerStarted=r[34]),a[0]&67108864&&(s.playNextVideo=r[26]),a[0]&134217728&&(s.playPrevVideo=r[27]),a[0]&268435456&&(s.repeatPlaylist=r[28]),a[0]&536870912&&(s.seekToInteractive=r[29]),a[0]&1073741824&&(s.toggleGraph=r[30]),a[1]&1&&(s.playPrevChapter=r[31]),!i&&a[1]&4&&(i=!0,s.videoContainer=r[33],Ne(()=>i=!1)),e.$set(s)},i(r){n||(d(e.$$.fragment,r),n=!0)},o(r){_(e.$$.fragment,r),n=!1},d(r){L(e,r)}}}function z6(t){let e,i,n,o,l=[H6,F6],r=[];function a(s,u){return s[14]?0:1}return i=a(t,[-1,-1,-1]),n=r[i]=l[i](t),{c(){e=P("div"),n.c(),c(e,"class","root svelte-1tl3een")},m(s,u){w(s,e,u),r[i].m(e,null),o=!0},p(s,u){let f=i;i=a(s,u),i===f?r[i].p(s,u):(me(),_(r[f],1,1,()=>{r[f]=null}),pe(),n=r[i],n?n.p(s,u):(n=r[i]=l[i](s),n.c()),d(n,1),n.m(e,null))},i(s){o||(d(n),o=!0)},o(s){_(n),o=!1},d(s){s&&k(e),r[i].d()}}}function U6(t,e,i){let n,{sources:o}=e,{store:l}=e,{microStoresRoot:r}=e,{videoConfig:a}=e,{uiConfig:s}=e,{title:u}=e,{thumbUrl:f}=e,{interactiveContainer:p}=e,{subtitles:h}=e,{live:C}=e,{preload:g}=e,{autoplay:S}=e,{volume:b=void 0}=e,{muted:E=void 0}=e,{fromTime:v}=e,{canRewindLive:y}=e,{showAds:T}=e,{adsSlotId:W=void 0}=e,{adsParams:B=void 0}=e,{adsPreviewParam:O=void 0}=e,{duration:ne=void 0}=e,{logoClickable:ge}=e,{logoHidden:G}=e,{isMobile:X}=e,{showNextPrevButtons:se=!1}=e,{nextButtonActive:j=!1}=e,{prevButtonActive:z=!1}=e,{endScreenVideoTitle:Q=void 0}=e,{endScreenVideoThumb:$=void 0}=e,{isOneVideoPlaylist:K=!1}=e,{supportLink:Y}=e,{shadowRootContainer:te=void 0}=e,{outerContainerRef:oe=void 0}=e,{fullScreenTarget:Ve=void 0}=e,{failoverHosts:Xe=void 0}=e,{showMiniTimer:Ce=!1}=e,{saveRate:Me}=e,{playNextVideo:ze=_l}=e,{playPrevVideo:$e=_l}=e,{repeatPlaylist:ce=_l}=e,{seekToInteractive:he=_l}=e,{toggleGraph:at=_l}=e,{playPrevChapter:we=_l}=e,{volumeMultiplier:Fe}=e,{subscribers:ct,stores:Ge}=r;Hc(s);let Ke=Mt(),Ze=s.logoLink,xe=l.ui.debugPanelVisible,x=l.ui.playerSize,qe=l.state.isLive$;q(t,qe,ke=>i(63,n=ke));let He,fe=null,le=!1;l.getAdmanWrapper().init({switchFromAdsToVideo:l.actions.internal.switchFromAdsToVideo,switchFromVideoToAds:l.actions.internal.switchFromVideoToAds,setMuted:l.actions.external.setMuted},l.ads,{isMobile:l.ui.isMobile,mobileUnmuteButtonVisible:l.ui.mobileUnmuteButtonVisible,vsid:l.vsid}),Xc(l,Ge);let nt=(ke=!1)=>{i(34,le=!0),ke?l.actions.external.firstStart(T):l.actions.internal.firstStart(T)};function de(ke){let ht=o||ke;ht&&l.initVideo({container:He,sources:ht,failoverHosts:Xe,subtitles:h,volumeMultiplier:Fe});let wt=D6.get(Sl)==="true";xe.set(wt),v>0&&l.actions.external.seekTime(v);let Zt=X?Ke.volumeDefault:b??Xl()??Ke.volumeDefault,Ct=E??ff();if(l.actions.external.setVolume(Zt),l.actions.external.setMuted(Ct),l.getAdmanWrapper().setInitialVolume(Ct?0:Zt),Ke.features.trafficSaving){let Ut=mf();Ut&&l.actions.internal.setTrafficSavingEnabled(Ut)}if(Ke.features.saveRate&&Me){let Ut=hf();Ut&&!n&&l.actions.internal.setPlaybackRate(Ut)}let zt=af(l.videoId);zt&&l.actions.internal.setQuality(zt),l.ui.isAutoplay.set(S),S?nt():g&&Ke.features.preload&&l.actions.internal.preload()}let lt=ke=>{if(window.ResizeObserver){let ht,wt;fe=new ResizeObserver(q6(Zt=>{let Ct=Zt[0];if(Ct){if(Ct.contentBoxSize){let zt=Array.isArray(Ct.contentBoxSize)?Ct.contentBoxSize[0]:Ct.contentBoxSize;ht=zt.inlineSize,wt=zt.blockSize}else Ct.contentRect&&(ht=Ct.contentRect.width,wt=Ct.contentRect.height);x.set({width:ht,height:wt})}},300)),fe.observe(ke)}x.set({width:ke.clientWidth,height:ke.clientHeight})};Pt(()=>{lt(He);let ke=ct.map(wt=>wt.init({store:l,microStores:Ge,config:a}));if(C?.status==="upcoming"){l.actions.internal.setLiveWaitingStart(!0);return}if(C?.status==="waiting"){l.actions.internal.setLiveWaitingRecover(!0);return}if((C?.status==="finished"||C?.status==="postlive")&&!Object.keys(o||[]).length){l.actions.internal.setLiveWaitingRecord(!0);return}return de(),()=>{fe?.disconnect(),ke.forEach(wt=>wt.unsubscribe()),l.destroy()}});function rt(){le?l.actions.external.play():nt(!0)}function dt(){l.actions.external.pause()}function bt(ke){X||l.actions.external.setMuted(ke)}function Tt(ke){X||ke>=0&&ke<=1&&l.actions.external.setVolume(ke)}function Qe(ke){l.actions.internal.seekTime(ke,N6.UNKNOWN)}function Ht(ke){l.actions.external.seekEpisodeStartTime(ke)}function Vt(){l.actions.external.returnFocusToEpisodes()}function kt(ke){l.actions.external.setPlaybackRate(ke)}function ri(ke){l.actions.external.setAutoQualityLimits(ke)}function st(ke){He=ke,i(33,He)}function vt(ke){He=ke,i(33,He)}return t.$$set=ke=>{"sources"in ke&&i(39,o=ke.sources),"store"in ke&&i(0,l=ke.store),"microStoresRoot"in ke&&i(40,r=ke.microStoresRoot),"videoConfig"in ke&&i(41,a=ke.videoConfig),"uiConfig"in ke&&i(42,s=ke.uiConfig),"title"in ke&&i(1,u=ke.title),"thumbUrl"in ke&&i(2,f=ke.thumbUrl),"interactiveContainer"in ke&&i(3,p=ke.interactiveContainer),"subtitles"in ke&&i(43,h=ke.subtitles),"live"in ke&&i(4,C=ke.live),"preload"in ke&&i(44,g=ke.preload),"autoplay"in ke&&i(5,S=ke.autoplay),"volume"in ke&&i(45,b=ke.volume),"muted"in ke&&i(46,E=ke.muted),"fromTime"in ke&&i(47,v=ke.fromTime),"canRewindLive"in ke&&i(6,y=ke.canRewindLive),"showAds"in ke&&i(7,T=ke.showAds),"adsSlotId"in ke&&i(8,W=ke.adsSlotId),"adsParams"in ke&&i(9,B=ke.adsParams),"adsPreviewParam"in ke&&i(10,O=ke.adsPreviewParam),"duration"in ke&&i(11,ne=ke.duration),"logoClickable"in ke&&i(12,ge=ke.logoClickable),"logoHidden"in ke&&i(13,G=ke.logoHidden),"isMobile"in ke&&i(14,X=ke.isMobile),"showNextPrevButtons"in ke&&i(15,se=ke.showNextPrevButtons),"nextButtonActive"in ke&&i(16,j=ke.nextButtonActive),"prevButtonActive"in ke&&i(17,z=ke.prevButtonActive),"endScreenVideoTitle"in ke&&i(18,Q=ke.endScreenVideoTitle),"endScreenVideoThumb"in ke&&i(19,$=ke.endScreenVideoThumb),"isOneVideoPlaylist"in ke&&i(20,K=ke.isOneVideoPlaylist),"supportLink"in ke&&i(21,Y=ke.supportLink),"shadowRootContainer"in ke&&i(22,te=ke.shadowRootContainer),"outerContainerRef"in ke&&i(23,oe=ke.outerContainerRef),"fullScreenTarget"in ke&&i(24,Ve=ke.fullScreenTarget),"failoverHosts"in ke&&i(48,Xe=ke.failoverHosts),"showMiniTimer"in ke&&i(25,Ce=ke.showMiniTimer),"saveRate"in ke&&i(49,Me=ke.saveRate),"playNextVideo"in ke&&i(26,ze=ke.playNextVideo),"playPrevVideo"in ke&&i(27,$e=ke.playPrevVideo),"repeatPlaylist"in ke&&i(28,ce=ke.repeatPlaylist),"seekToInteractive"in ke&&i(29,he=ke.seekToInteractive),"toggleGraph"in ke&&i(30,at=ke.toggleGraph),"playPrevChapter"in ke&&i(31,we=ke.playPrevChapter),"volumeMultiplier"in ke&&i(50,Fe=ke.volumeMultiplier)},t.$$.update=()=>{t.$$.dirty[0]&16385&&l.ui.isMobile.set(X)},[l,u,f,p,C,S,y,T,W,B,O,ne,ge,G,X,se,j,z,Q,$,K,Y,te,oe,Ve,Ce,ze,$e,ce,he,at,we,Qe,He,le,Ke,Ze,qe,nt,o,r,a,s,h,g,b,E,v,Xe,Me,Fe,de,rt,dt,bt,Tt,Ht,Vt,kt,ri,st,vt]}var hc=class extends H{constructor(e){super(),U(this,e,U6,z6,F,{sources:39,store:0,microStoresRoot:40,videoConfig:41,uiConfig:42,title:1,thumbUrl:2,interactiveContainer:3,subtitles:43,live:4,preload:44,autoplay:5,volume:45,muted:46,fromTime:47,canRewindLive:6,showAds:7,adsSlotId:8,adsParams:9,adsPreviewParam:10,duration:11,logoClickable:12,logoHidden:13,isMobile:14,showNextPrevButtons:15,nextButtonActive:16,prevButtonActive:17,endScreenVideoTitle:18,endScreenVideoThumb:19,isOneVideoPlaylist:20,supportLink:21,shadowRootContainer:22,outerContainerRef:23,fullScreenTarget:24,failoverHosts:48,showMiniTimer:25,saveRate:49,playNextVideo:26,playPrevVideo:27,repeatPlaylist:28,seekToInteractive:29,toggleGraph:30,playPrevChapter:31,volumeMultiplier:50,initVideo:51,play:52,pause:53,setMuted:54,setVolume:55,seekTime:32,seekEpisodeStartTime:56,returnFocusToEpisodes:57,setPlaybackRate:58,setAutoQualityLimits:59},O6,[-1,-1,-1])}get initVideo(){return this.$$.ctx[51]}get play(){return this.$$.ctx[52]}get pause(){return this.$$.ctx[53]}get setMuted(){return this.$$.ctx[54]}get setVolume(){return this.$$.ctx[55]}get seekTime(){return this.$$.ctx[32]}get seekEpisodeStartTime(){return this.$$.ctx[56]}get returnFocusToEpisodes(){return this.$$.ctx[57]}get setPlaybackRate(){return this.$$.ctx[58]}get setAutoQualityLimits(){return this.$$.ctx[59]}},Pp=hc;function K6(t){let e,i,n,o=t[2].default,l=Ie(o,t,t[1],null),r=[{xmlns:"http://www.w3.org/2000/svg"},{width:"57"},{height:"60"},{fill:"none"},{"aria-hidden":"true"},{"data-testid":"stub-icon"},{role:"img"},t[0]],a={};for(let s=0;s<r.length;s+=1)a=ue(a,r[s]);return{c(){e=R("svg"),l&&l.c(),i=R("path"),c(i,"fill","currentColor"),c(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 6zm.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.9.9 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134z"),ye(e,a)},m(s,u){w(s,e,u),l&&l.m(e,null),m(e,i),n=!0},p(s,[u]){l&&l.p&&(!n||u&2)&&Ae(l,o,s,s[1],n?Ee(o,s[1],u,null):Le(s[1]),null),ye(e,a=Be(r,[{xmlns:"http://www.w3.org/2000/svg"},{width:"57"},{height:"60"},{fill:"none"},{"aria-hidden":"true"},{"data-testid":"stub-icon"},{role:"img"},u&1&&s[0]]))},i(s){n||(d(l,s),n=!0)},o(s){_(l,s),n=!1},d(s){s&&k(e),l&&l.d(s)}}}function W6(t,e,i){let{$$slots:n={},$$scope:o}=e;return t.$$set=l=>{i(0,e=ue(ue({},e),ve(l))),"$$scope"in l&&i(1,o=l.$$scope)},e=ve(e),[e,o,n]}var gc=class extends H{constructor(e){super(),U(this,e,W6,K6,F,{})}},Tp=gc;function j6(t){let e,i;return e=new Tp({props:{style:t[0]}}),{c(){V(e.$$.fragment)},m(n,o){A(e,n,o),i=!0},p(n,[o]){let l={};o&1&&(l.style=n[0]),e.$set(l)},i(n){i||(d(e.$$.fragment,n),i=!0)},o(n){_(e.$$.fragment,n),i=!1},d(n){L(e,n)}}}function G6(t,e,i){let n,{isWhite:o=!1}=e;return t.$$set=l=>{"isWhite"in l&&i(1,o=l.isWhite)},t.$$.update=()=>{t.$$.dirty&2&&i(0,n=o?"color: #fff;":"color: #909499;")},[n,o]}var bc=class extends H{constructor(e){super(),U(this,e,G6,j6,F,{isWhite:1})}},Ip=bc;function Q6(t){Pe(t,"svelte-1y9fytq",".playerStub.svelte-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.svelte-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 Ep(t){let e,i;return{c(){e=P("div"),i=Re(t[0]),c(e,"class","title svelte-1y9fytq")},m(n,o){w(n,e,o),m(e,i)},p(n,o){o&1&&je(i,n[0])},d(n){n&&k(e)}}}function Ap(t){let e,i;return e=new Ip({props:{isWhite:!!t[1]}}),{c(){V(e.$$.fragment)},m(n,o){A(e,n,o),i=!0},p(n,o){let l={};o&2&&(l.isWhite=!!n[1]),e.$set(l)},i(n){i||(d(e.$$.fragment,n),i=!0)},o(n){_(e.$$.fragment,n),i=!1},d(n){L(e,n)}}}function Y6(t){let e,i,n,o,l=t[0]&&Ep(t),r=(!t[0]||!t[1])&&Ap(t);return{c(){e=P("div"),l&&l.c(),i=M(),r&&r.c(),c(e,"class","playerStub svelte-1y9fytq"),c(e,"style",n=t[1]?`background-image: url('${t[1]}')`:"")},m(a,s){w(a,e,s),l&&l.m(e,null),m(e,i),r&&r.m(e,null),o=!0},p(a,[s]){a[0]?l?l.p(a,s):(l=Ep(a),l.c(),l.m(e,i)):l&&(l.d(1),l=null),!a[0]||!a[1]?r?(r.p(a,s),s&3&&d(r,1)):(r=Ap(a),r.c(),d(r,1),r.m(e,null)):r&&(me(),_(r,1,1,()=>{r=null}),pe()),(!o||s&2&&n!==(n=a[1]?`background-image: url('${a[1]}')`:""))&&c(e,"style",n)},i(a){o||(d(r),o=!0)},o(a){_(r),o=!1},d(a){a&&k(e),l&&l.d(),r&&r.d()}}}function Z6(t,e,i){let{title:n}=e,{thumbUrl:o}=e;return t.$$set=l=>{"title"in l&&i(0,n=l.title),"thumbUrl"in l&&i(1,o=l.thumbUrl)},[n,o]}var vc=class extends H{constructor(e){super(),U(this,e,Z6,Y6,F,{title:0,thumbUrl:1},Q6)}},Lp=vc;import{cloneDeepWith as p8,InterfaceLanguage as _8,clientChecker as h8,isMobile as g8,isNonNullable as Sc,Logger as b8,Subscription as v8}from"@vkontakte/videoplayer-shared";import"@vkontakte/videoplayer-core";import{OneStat as y8}from"@vkontakte/videoplayer-statistics";import{Subscription as X6}from"@vkontakte/videoplayer-shared";var os=class{constructor(){this.subscription=new X6}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(){let 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(let[i,n]of e)try{navigator.mediaSession.setActionHandler(i,n)}catch{throw new Error(`The media session action "${i}" is not supported yet.`)}}attachToStore(e){!this.isSupported()||!e||this.subscription.add(e.state.positionExact$.subscribe(i=>{let n=Je(e.state.currentPlaybackRate$),o=Je(e.state.duration$);!isFinite(i)||!isFinite(o)||navigator.mediaSession.setPositionState({position:i,playbackRate:n,duration:o})}))}clearSubscriptions(){this.subscription.unsubscribe()}destroy(){this.resetActionHandlers(),this.clearSubscriptions()}};import{ValueSubject as i8,clientChecker as n8,detectEmbed as o8}from"@vkontakte/videoplayer-shared";function J6(t){let e,i,n,o,l,r=t[2].default,a=Ie(r,t,t[1],null),s=[{xmlns:"http://www.w3.org/2000/svg"},{width:"57"},{height:"56"},{fill:"none"},{"aria-label":"dummy-image"},{"data-testid":"pip-dummy-icon"},{role:"img"},t[0]],u={};for(let f=0;f<s.length;f+=1)u=ue(u,s[f]);return{c(){e=R("svg"),a&&a.c(),i=R("g"),n=R("path"),o=R("path"),c(n,"d","m30.744 4 .744.005c2.981.046 4.526.385 6.127 1.24a8.77 8.77 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.77 5.77 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.77 8.77 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.77 8.77 0 0 1 3.347-3.475l.312-.174.292-.15c1.472-.731 3.016-1.036 5.803-1.08L22.256 4z"),c(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.2z"),c(i,"fill","#fff"),ye(e,u)},m(f,p){w(f,e,p),a&&a.m(e,null),m(e,i),m(i,n),m(i,o),l=!0},p(f,[p]){a&&a.p&&(!l||p&2)&&Ae(a,r,f,f[1],l?Ee(r,f[1],p,null):Le(f[1]),null),ye(e,u=Be(s,[{xmlns:"http://www.w3.org/2000/svg"},{width:"57"},{height:"56"},{fill:"none"},{"aria-label":"dummy-image"},{"data-testid":"pip-dummy-icon"},{role:"img"},p&1&&f[0]]))},i(f){l||(d(a,f),l=!0)},o(f){_(a,f),l=!1},d(f){f&&k(e),a&&a.d(f)}}}function x6(t,e,i){let{$$slots:n={},$$scope:o}=e;return t.$$set=l=>{i(0,e=ue(ue({},e),ve(l))),"$$scope"in l&&i(1,o=l.$$scope)},e=ve(e),[e,o,n]}var yc=class extends H{constructor(e){super(),U(this,e,x6,J6,F,{})}},Mp=yc;function $6(t){Pe(t,"svelte-1pbsod4",".player-pip-dummy.svelte-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.svelte-1pbsod4{position:relative}.dummy-image.svelte-1pbsod4 svg{transform:scale(1.07143)}.dummy-image.desktop.svelte-1pbsod4{transform:scale(1.07143) rotate(-90deg) rotateY(180deg)}.title.svelte-1pbsod4{font-size:16px;color:#fff;padding:18px 20px 10px;text-align:center}")}function e8(t){let e,i,n,o,l,r,a;return n=new Mp({}),{c(){e=P("div"),i=P("div"),V(n.$$.fragment),o=M(),l=P("span"),r=Re(t[0]),c(i,"class","dummy-image svelte-1pbsod4"),D(i,"desktop",!t[1]),c(l,"class","title svelte-1pbsod4"),c(e,"class","player-pip-dummy svelte-1pbsod4"),D(e,"is-pip-api",t[2])},m(s,u){w(s,e,u),m(e,i),A(n,i,null),m(e,o),m(e,l),m(l,r),a=!0},p(s,[u]){(!a||u&2)&&D(i,"desktop",!s[1]),(!a||u&1)&&je(r,s[0])},i(s){a||(d(n.$$.fragment,s),a=!0)},o(s){_(n.$$.fragment,s),a=!1},d(s){s&&k(e),L(n)}}}function t8(t,e,i){let n,o,l=it(),r=!!l.webApi.pictureInPictureApi,a=l.interfaceLanguage$;q(t,a,f=>i(5,n=f));let s=l.ui.isMobile;q(t,s,f=>i(1,o=f));let u;return t.$$.update=()=>{t.$$.dirty&32&&i(0,u=n&&N("pip_dummy_title"))},[u,o,r,a,s,n]}var kc=class extends H{constructor(e){super(),U(this,e,t8,e8,F,{},$6)}},Vp=kc;var l8=460,r8=280,Bl=class{constructor(){this.info={isActive$:new i8(!1),type:1}}isSupported(){let{isEmbed:e}=o8();return"documentPictureInPicture"in window&&!n8.isYandex&&!e}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:l8,height:r8,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let e=[...this.playerParentShadowRoot.styleSheets].map(l=>[...l.cssRules].map(r=>r.cssText).join(" ")).filter(Boolean).join(`
53
- `),i=document.createElement("style");i.textContent=e;let n=this.createStretchedContainer(),o=n.attachShadow({mode:"open"});o.append(i),o.append(this.playerDomElement),this.playerDummyElement=new Vp({target:this.playerParentShadowRoot,context:this.svelteContext}),this.pipWindow?.document.body.append(n),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",l=>{!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(){let e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}};function Rp(t){return t instanceof Bl}var ls=class{static getLatestSupportedVersion(){let e=new Ao,i=new Bl;if(i.isSupported())return i;if(e.isSupported())return e}};function rs(t,e){let i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(let o of i)n[o]=e[o]??t[o]??void 0;return n}var Bp="Inner error. Unexpectedly root annotation container null reference exception",Dp="Annotation with such name already exists",qp="Annotation with such name does not exist";var hl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as s8,Subscription as a8,throttleFn as u8}from"@vkontakte/videoplayer-shared";var c8="1",f8=100,ss=class{constructor(){this.annotations=new Map;this.subscriptions=new a8}init(e){this.rootAnnotationsContainer=e;let i=u8(()=>{for(let n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},f8);this.subscriptions.add(s8(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 hl(Bp);if(this.annotations.has(e))throw new hl(Dp);i.style.zIndex=i.style.zIndex??c8,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){let i=this.annotations.get(e);if(!i)throw new hl(qp);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let 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){let o=e.offsetTop,l=e.offsetLeft,r=e.offsetWidth,a=e.offsetHeight;return o<0||l<0||l+r>i||o+a>n}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as wc,Subscription as d8}from"@vkontakte/videoplayer-shared";var Qn=class{init({store:e,microStores:i,config:n}){return wc(e),wc(i),wc(n),this.subscription=new d8,this.subscription}};var Dl=class extends Qn{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...De(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let n=super.init(i),{isInteractiveExpectation$:o}=i.store.state;return n.add(o.subscribe(l=>{this.state$.set(l?!0:null)})),n}};var ql=class extends Qn{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...De(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let n=super.init(i),{microStores:o,store:l}=i,{fakeIsPlaying$:r}=o,{isInteractiveExpectation$:a,isPlaying$:s}=l.state,{controlsVisible:u,isMobile:f}=l.ui,p=Je(f),h=()=>p&&Je(u);return n.add(u.subscribe(C=>{if(!p)return;let g=Je(r);Je(s)?this.state$.set(C):g!==null&&this.state$.set(!g||C)})),n.add(s.subscribe(C=>{this.state$.set(!C||h())})),n.add(r.subscribe(C=>{if(C===null)return;let g=Je(a);if(h()){this.state$.set(!0);return}g&&this.state$.set(!C)})),n}};var Nl=class extends Qn{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=De("tooltip_chapter_without_interactive")}init(i){let n=super.init(i),{store:o}=i;return n.add(o.state.interactiveEpisodes$.subscribe(l=>{l.length&&(l.every(r=>r.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}};import{combine as m8}from"@vkontakte/videoplayer-shared";var Cc=De(!1),as=null,Ol=class extends Qn{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Cc,set:(i,n=!1)=>{i!==Je(Cc)&&(this.clearTimeout(),Cc.set(i),!i&&as&&(as=!1),i&&n&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let n=super.init(i),{store:o,config:l}=i,{isInteractiveTime$:r,isPlaying$:a}=o.state,s=o.ui.controlsVisible,{interactiveTimeIndicator:u}=o.ui.controls;n.add(s.subscribe(p=>{Je(r)&&p&&this.state$.set(!1)}));let f=l?.interactiveData||{tooltipHelpHintActive:!1};return n.add(m8({isPlaying$:a,isInteractiveTime$:r,interactiveTimeIndicator:u}).subscribe(({isPlaying$:p,isInteractiveTime$:h,interactiveTimeIndicator:C})=>{if(!(!p||!C?.isDisplayed)){if(!h)return this.state$.set(!1);f.tooltipHelpHintActive&&as===null&&(as=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),o.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),n}clearTimeout(){window.clearTimeout(this.timeout)}};var Np=()=>[Dl,ql,Nl,Ol].reduce(({subscribers:t,stores:e},i)=>{let n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}});var k8={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:_8.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isMobile:g8(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1},us=class extends HTMLElement{constructor(){super();this.currentPlayingVideoIndex=0;this.needToRepeatPlaylist=!1;this.videoConfig=void 0;this.pictureInPictureApi=void 0;this.mediaSessionApi=void 0;this.unsubscribePlayerPhaseSubscription=void 0;this.annotationsApi=void 0;this.prevIsid=void 0;this.isInited=!1;this.createOneStat=(i,n={})=>{let{albumId:o,statPlace:l,statUserSalt:r,statTrackCode:a,refreshStatAuthToken:s,autoplay:u,isMobile:f,refDomain:p,deviceId:h,interactiveData:C}=rs(this.videoConfig,n),g=C?.projectInfo?.pid,{unitedVideoId:S,isClip:b=!1}=i;if(this.uiConfig.features.statistics&&S)return new y8({movieId:S,albumId:o,place:l,trackCode:a,autoplay:(u&&!this.interactiveController)??!1,mobile:f,clip:b,refDomain:p,deviceId:h,...g&&!this.isInited&&{projectId:Number(g)}},{refreshAuthToken:s,userSalt:r,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})};this.logger=new b8,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new v8,this.graphMadePause=!1,window?.videoPlayerConfig?.debugLogs&&this.subscription.add(this.logger.log$.subscribe(i=>{console.log("%c player web component ","background:#77dd77;",`${i.component}`,i.message)}))}connectedCallback(){if(this.isInited)return;this.initPlayerRootContainers();let i=this.getAttribute("stub-title")??void 0,n=this.getAttribute("stub-thumb-url")??void 0;this.svelteStubComponent=new Lp({target:this.playerContainer,props:{title:i,thumbUrl:n}})}disconnectedCallback(){this.annotationsApi?.destroy(),this.mediaSessionApi?.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%",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.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(this.shadowRootContainer),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(i){return this.store?.ui.controls.disabledControls$?.includes(i)||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let i=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:i.title,nextVideoThumb:i.thumbUrl}}createPlayer(i,n={},o){if(!this.videoConfig)return;let{albumId:l,statPlace:r,statAuthToken:a,preload:s,autoplay:u,volume:f,muted:p,fromTime:h,canRewindLive:C,supportLink:g,showAds:S,adsSlotId:b,adsParams:E={},adsPreviewParam:v,interfaceLanguage:y,isCyrillicRelatedInterface:T,logoClickable:W,logoHidden:B,isMobile:O,isAudioDisabled:ne,isLiveCatchUpMode:ge,fullScreenTarget:G,failoverHosts:X,canDownload:se,callbacks:j,interactiveData:z,showThumbTimer:Q,additionalButtons:$=[],repeat:K,saveRate:Y,volumeMultiplier:te}=rs(this.videoConfig,n),{sources:oe,title:Ve,thumbUrl:Xe,unitedVideoId:Ce,isClip:Me=!1,duration:ze,adsParams:$e={},videoEpisodes:ce,previewThumbsData:he,subtitles:at,live:we}=i,Fe={...E,...$e},ct=this.getNextVideoInfo(),Ge={sources:oe,title:Ve,thumbUrl:Xe,subtitles:at,unitedVideoId:Ce,isClip:Me,live:we,albumId:l,statPlace:r,autoplay:u,muted:p,volume:f,fromTime:h,canRewindLive:C,showAds:S,adsSlotId:b,adsParams:Fe,adsPreviewParam:v,duration:ze,logoClickable:W,logoHidden:B,isMobile:O,repeat:K,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ct.nextVideoTitle,endScreenVideoThumb:ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Ke={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Ge)}`});let Ze=this.interactiveController?.state.statistics$.getValue(),xe=Ze?.oneStat||this.createOneStat(i,n);xe&&(this.statistics=new Wr(xe,Ze?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Eo(this.uiConfig.sentry,{version:$o,env:Zl},{movieId:Ce,albumId:l,place:r,autoplay:(u&&!this.interactiveController)??!1,mobile:O,clip:Me}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat.isid$.getValue()),this.sentry={...this.sentry,...Eo.getInstance()};let qe=!!z,He=[],fe="tooltip_interactive_go_back_disabled_first";if(qe&&this.interactiveController){let de=this.interactiveController.state.isInitialChapter$.getValue(),lt=this.interactiveController.getHistoryState();de&&He.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||He.push("SEEK_TO_INTERACTIVE_BUTTON"),lt.hasPrevChapter$.getValue()||(He.push("PLAY_PREV_CHAPTER_BUTTON"),de||(lt.isGoBackLimited$.getValue()?fe="tooltip_interactive_go_back_disabled_limit":fe="tooltip_interactive_go_back_disabled"))}let le=()=>{this.isInited=!1,this.prevIsid=void 0;let de=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();j.onReplayInteractiveVideo&&!de?j.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=am({player:o,interfaceLanguage:y,isCyrillicRelatedInterface:T,videoId:Ce,isClip:Me,isLiveCatchUpMode:ge,isAudioDisabled:ne,statAuthToken:a,callbacks:j,webApi:Ke,videoEpisodes:ce,previewThumbsData:he,canDownload:se,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:He,isInteractive:qe,saveRate:Y,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,replayInteractive:le,playPrevChapterDisabledTooltip:fe,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?$:[],looped:K&&this.videoConfig.videos.length===1,statistics:this.statistics});let{stores:nt}=this.microStoresRoot=Np();this.subscription.add(this.store.state.currentFormat$.subscribe(de=>j?.onCurrentFormatChanged?.(de))),this.subscription.add(nt.interactiveControlsOpacity$.subscribe(de=>{de!==null&&this?.interactiveController?.setDisabledControls(de)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(de=>j?.onThroughputEstimationChanged?.(de))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(de=>j?.onTrafficSavingEnabledChanged?.(de))),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(de=>j?.onCurrentPlaybackRateChanged?.(de))),this.subscription.add(this.store.state.volume$.subscribe(de=>j?.onVolumeChange?.(de))),this.subscription.add(this.store.state.muted$.subscribe(de=>de?j?.onMute?.():j?.onUnmute?.())),this.subscription.add(this.store.state.videoBitrate$.subscribe(de=>j?.onVideoBitrateChanged?.(de))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(de=>{let lt=this.store?.ui.controls.disabledControls$;lt&&(de&&!lt.includes(Pl)&&lt.add(Pl),de||lt.remove(Pl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async de=>{if(!h8.isSamsungBrowser||!de||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter(this.videoConfig?.callbacks.onExternalFullscreenExit)})),this.statistics&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(de=>j?.onVSIDChanged?.(de))),this.initMediaSession(),this.svelteRootComponent=new Pp({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:oe,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:Ve,thumbUrl:Xe,subtitles:at,live:we,preload:s,autoplay:u,muted:p,volume:f,fromTime:h,canRewindLive:C,supportLink:g,showAds:S,adsSlotId:b,adsParams:Fe,adsPreviewParam:v,duration:ze,logoClickable:W,logoHidden:B,isMobile:O,failoverHosts:X,fullScreenTarget:G,saveRate:Y,shadowRootContainer:this.shadowRootContainer,showMiniTimer:Q,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ct.nextVideoTitle,endScreenVideoThumb:ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playNextVideo:()=>this.playNextVideo(),playPrevVideo:()=>this.playPrevVideo(),repeatPlaylist:()=>this.repeatPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),toggleGraph:()=>this.toggleGraph(),volumeMultiplier:te}}),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,this.videoConfig?.callbacks?.onInited?.())}addPlayerInfoSubscriptions(){let i=this.store;if(!i)return;let n=this.videoConfig?.callbacks;n&&this.subscription.add(i.playerPhase.subscribe(l=>n.onPlayerPhaseChanged?.(l))).add(i.state.playbackState$.subscribe(l=>n.onPlaybackStateChanged?.(l))).add(i.state.isLive$.subscribe(l=>n.onIsLiveChanged?.(l))).add(i.state.isActiveLive$.subscribe(l=>n.onIsActiveLiveChanged?.(l))).add(i.state.isAudioAvailable$.subscribe(l=>n.onIsAudioAvailableChanged?.(l))).add(i.state.currentQuality$.subscribe(l=>n.onCurrentQualityChanged?.(l))).add(i.state.availableQualities$.subscribe(l=>n.onAvailableQualitiesChanged?.(l.map(({value:r})=>r).filter(r=>r!=="auto")))).add(i.state.availableAudioStreams$.subscribe(l=>{l.length>1&&n.onAudioLanguagesAvailable&&n.onAudioLanguagesAvailable()})).add(i.ui.isPictureInPictureActive$.subscribe(l=>l?n.onPiPEnter?.():n.onPiPExit?.()));let o=n?.uiInfo;o&&this.subscription.add(i.ui.controlsVisible.subscribe(l=>o.onControlsVisibleChanged?.(l))).add(i.ui.isMobile.subscribe(l=>o.onIsMobileChanged?.(l))).add(i.ui.playerSize.subscribe(l=>o.onPlayerSizeChanged?.(l))).add(i.ui.controls.prevButton.subscribe(l=>o.onPrevButtonChanged?.(l))).add(i.ui.controls.playButton.subscribe(l=>o.onPlayButtonChanged?.(l))).add(i.ui.controls.replayButton.subscribe(l=>o.onReplayButtonChanged?.(l))).add(i.ui.controls.nextButton.subscribe(l=>o.onNextButtonChanged?.(l))).add(i.ui.controls.playPrevChapterButton.subscribe(l=>o.onPlayPrevChapterChanged?.(l))).add(i.ui.controls.seekToInteractiveButton.subscribe(l=>o.onSeekToInteractiveButtonChanged?.(l))).add(i.ui.controls.interactiveGraphButton.subscribe(l=>o.onGraphButtonChanged?.(l))).add(i.ui.controls.liveButton.subscribe(l=>o.onLiveButtonChanged?.(l))).add(i.ui.controls.time.subscribe(l=>o.onTimeUpdateChanged?.(l))).add(i.ui.controls.episodes.subscribe(l=>o.onEpisodesChanged?.(l))).add(i.ui.controls.subtitles.subscribe(l=>o.onSubtitlesChanged?.(l))).add(i.ui.controls.settings.subscribe(l=>o.onSettingsChanged?.(l))).add(i.ui.controls.fullscreen.subscribe(l=>o.onFullscreenChanged?.(l))).add(i.ui.controls.chromecast.subscribe(l=>o.onChromecastChanged?.(l))).add(i.ui.controls.pip.subscribe(l=>o.onPipChanged?.(l))).add(i.ui.controls.vkLogo.subscribe(l=>o.onVkLogoChanged?.(l))).add(i.ui.controls.interactiveTimeIndicator.subscribe(l=>o.onInteractiveTimeIndicatorChanged?.(l))).add(i.ui.controls.timeline.subscribe(l=>o.onTimelineChanged?.(l)))}playNextVideo(){if(!this.videoConfig)return;let i=!0;if(this.videoConfig.callbacks?.onNextVideoClick)try{i=this.videoConfig.callbacks.onNextVideoClick()}catch{this.log({message:"onNextVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){if(!this.videoConfig)return;let i=!0;if(this.videoConfig.callbacks?.onPrevVideoClick)try{i=this.videoConfig.callbacks.onPrevVideoClick()}catch{this.log({message:"onPrevVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}repeatPlaylist(){this.currentPlayingVideoIndex=0,this.log({message:"repeat playlist"}),this.createPlayerWithCurrentVideo()}createPlayerWithCurrentVideo(i,n=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&Sc(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.svelteRootComponent?.$destroy(),this.createPlayer(o,{autoplay:n,fromTime:0},i)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){let i=this.interactiveController?.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}toggleGraph(){if(!this.isInited)return;let i=this.store,{isEnded$:n,playbackState$:o,graphIsOpened$:l}=i.state,{disabledControls$:r}=i.ui.controls,a=Je(n),s=Je(o);Je(l)?(l.set(!1),this.interactiveController?.toggleGraphView(!1),r.remove(bs),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=s==="playing",l.set(!0),this.interactiveController?.toggleGraphView(!0),r.add(bs),!a&&this.graphMadePause&&this.pause())}async initInteractives(){if(this.videoConfig?.interactiveData)try{let{Interactives:i,EVENT_NAMES:n,CustomError:o}=await import("@vkontakte/videoplayer-interactive");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");let l=this.store?.interfaceLanguage$,r=l?Je(l):this.videoConfig.interfaceLanguage,{projectInfo:a,initChapterId:s,historyApi:u,videoLoader:f}=this.videoConfig.interactiveData;this.interactiveController=new i({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:r,graph:this.uiConfig.features.interactiveGraph,projectInfo:a,initChapterId:s,historyApi:u,vkVideoLoader:f,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat});let{isInteractiveExpectation$:p}=this.interactiveController.state;if(this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(h=>{if(!this.isInited)return;let C=this.store;h?C.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):C.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(p.subscribe(h=>{this.store&&this.store.state.isInteractiveExpectation$.set(h)})),this.interactiveController.on(n.playerChanged,h=>{if(!this.videoConfig)return;let C=this.interactiveController?.state.isFirstChapter$.getValue()||!0;this.videoConfig.videos[this.currentPlayingVideoIndex]={...h.config,title:a?.title||h.config.title};let g=C?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(h.player,g)}),this.interactiveController.on(n.interactives,({type:h,actionType:C})=>{if(!this.store)return;let g=p.getValue();if(h==="action-choice"&&C==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Yl)),h==="action-choice-canceled"){let S=Je(this.store.state.isPlaying$)||g;if(this.videoConfig?.isMobile&&S){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){let h=this.interactiveController.getHistoryState();this.subscription.add(h.history$.subscribe(C=>{C.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(C)}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),this.videoConfig?.callbacks.onInteractiveTimeIndicatorClick?.()})),this.interactiveController.on(n.errors,h=>{this.log({message:h.toString()})})}catch(i){this.log({message:i.message})}}initPlayer(i,n={}){if(!Array.isArray(i.videos)||i.videos.length===0&&!i.interactiveData)throw new Error("empty videos");this.videoConfig=rs(k8,p8(i,o=>o instanceof HTMLElement?o:void 0)),this.uiConfig=Fc(n.ui??{}),this.coreConfig=n.core??{configName:[]},this.statisticsConfig=n.statistics??{},this.sentry={config:this.uiConfig.sentry??{}},Sc(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.videoConfig.isMediaSessionEnabled??!0),Sc(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=ls.getLatestSupportedVersion():this.pictureInPictureApi=new Ao),this.mediaSessionApi=this.uiConfig.features.mediaSession?new os:void 0,this.annotationsApi=this.uiConfig.features.annotations?new ss:void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.svelteStubComponent?.$destroy(),this.svelteRootComponent?.$destroy(),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0),i.interactiveData?this.initInteractives():this.createPlayer(i.videos[0]),Rp(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(i){if(!this.videoConfig)return;this.log({message:`update next videos, videos: ${JSON.stringify(i)}`}),this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...i);let n=this.getNextVideoInfo();this.svelteRootComponent?.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(i=>{i==="video"?this.setupMediaSessionForVideo():i==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:i,thumbUrl:n}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",l=>this.seekTime(l.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:i,thumbUrl:n}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(i){this.log({message:i.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let i="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",n=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:i}),this.mediaSessionApi.updateActionHandlers(n),this.mediaSessionApi.attachToStore(this.store)}catch(i){this.log({message:i.message})}}play(){this.isControlDisabled("PLAY_BUTTON")||this.store?.playerPhase.is("LiveWaitingStart")||this.store?.playerPhase.is("LiveWaitingRecover")||this.store?.playerPhase.is("LiveWaitingRecord")||(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(),this.mediaSessionApi?.destroy();let i=this.videoConfig.videos[0];i&&(this.svelteRootComponent?.$destroy(),this.createPlayer(i))}setMuted(i){this.log({message:`set muted, muted: ${i}`}),this.svelteRootComponent?.setMuted(i)}setVolume(i){this.log({message:`set volume, volume: ${i}`}),this.svelteRootComponent?.setVolume(i)}setRepeat(i){this.log({message:`set repeat, repeat: ${i}`}),this.needToRepeatPlaylist=i,this.svelteRootComponent?.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(i){this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${i}`}),this.svelteRootComponent?.seekTime(i))}seekEpisodeStartTime(i){this.log({message:`seek episode start time, time: ${i}`}),this.svelteRootComponent?.seekEpisodeStartTime(i)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(i){this.log({message:`set playback rate to: ${i}`}),this.svelteRootComponent?.setPlaybackRate(i)}setAutoQualityLimits(i){this.log({message:`set auto quality limitation. Max: ${i.max??"none"}. Min: ${i.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(i)}addLanguage(i){this.store?.actions.internal.addLanguage(i)}async setLanguage(i){await this.store?.actions.internal.setLanguage(i)}setLiveStart(i){this.log({message:"live started"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingStart(!1),this.svelteRootComponent?.$destroy(),this.createPlayer(i,{autoplay:!0})}setLiveWaitingRecover(){this.log({message:"live waiting"}),this.store?.actions.internal.setLiveWaitingRecover(!0),this.store?.destroy()}setLiveWaitingRecord(){this.log({message:"post live"}),this.store?.actions.internal.setLiveWaitingRecord(!0),this.store?.destroy()}setLiveEnd(i){this.log({message:"live ended"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingRecord(!1),this.svelteRootComponent?.$destroy(),this.createPlayer(i,{autoplay:!1})}getDeviceId(){return this.statistics?.oneStat.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(i){if(this.interactiveController&&this.store?.state.positionExact$){let{EVENT_NAMES:n}=await import("@vkontakte/videoplayer-interactive"),o=Je(this.store.state.positionExact$),r=Je(this.store.state.interactiveEpisodes$).find(s=>!s.completed);this.interactiveController.once(n.playerChanged,()=>{r&&o>=r.time?this.seekTime(r.time):this.seekTime(o),i?.()});let a=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:a.chapter.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(i,n=!1){this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(i,n)}switchToActiveLive(){this.store?.actions.internal.switchToActiveLive()}updateStatContext(i){this.statistics&&this.statistics.oneStat.updateContext(i)}};import{InterfaceLanguage as $N,VKNumericLanguage as eO,loadVKLangPack as tO}from"@vkontakte/videoplayer-shared";import{VideoQuality as nO,VideoFormat as oO}from"@vkontakte/videoplayer-core";var ZN=()=>{window.customElements.define("vk-video-player",us)};export{Po as GridTypes,$N as InterfaceLanguage,$o as VERSION,eO as VKNumericLanguage,oO as VideoFormat,nO as VideoQuality,tO as loadVKLangPack,ZN as registerPlayerWebComponent};
53
+ `),i=document.createElement("style");i.textContent=e;let n=this.createStretchedContainer(),o=n.attachShadow({mode:"open"});o.append(i),o.append(this.playerDomElement),this.playerDummyElement=new Vp({target:this.playerParentShadowRoot,context:this.svelteContext}),this.pipWindow?.document.body.append(n),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",l=>{!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(){let e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}};function Rp(t){return t instanceof Bl}var ls=class{static getLatestSupportedVersion(){let e=new Ao,i=new Bl;if(i.isSupported())return i;if(e.isSupported())return e}};function rs(t,e){let i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(let o of i)n[o]=e[o]??t[o]??void 0;return n}var Bp="Inner error. Unexpectedly root annotation container null reference exception",Dp="Annotation with such name already exists",qp="Annotation with such name does not exist";var hl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as s8,Subscription as a8,throttleFn as u8}from"@vkontakte/videoplayer-shared";var c8="1",f8=100,ss=class{constructor(){this.annotations=new Map;this.subscriptions=new a8}init(e){this.rootAnnotationsContainer=e;let i=u8(()=>{for(let n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},f8);this.subscriptions.add(s8(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 hl(Bp);if(this.annotations.has(e))throw new hl(Dp);i.style.zIndex=i.style.zIndex??c8,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){let i=this.annotations.get(e);if(!i)throw new hl(qp);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let 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){let o=e.offsetTop,l=e.offsetLeft,r=e.offsetWidth,a=e.offsetHeight;return o<0||l<0||l+r>i||o+a>n}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as wc,Subscription as d8}from"@vkontakte/videoplayer-shared";var Qn=class{init({store:e,microStores:i,config:n}){return wc(e),wc(i),wc(n),this.subscription=new d8,this.subscription}};var Dl=class extends Qn{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...De(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let n=super.init(i),{isInteractiveExpectation$:o}=i.store.state;return n.add(o.subscribe(l=>{this.state$.set(l?!0:null)})),n}};var ql=class extends Qn{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...De(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let n=super.init(i),{microStores:o,store:l}=i,{fakeIsPlaying$:r}=o,{isInteractiveExpectation$:a,isPlaying$:s}=l.state,{controlsVisible:u,isMobile:f}=l.ui,p=Je(f),h=()=>p&&Je(u);return n.add(u.subscribe(C=>{if(!p)return;let g=Je(r);Je(s)?this.state$.set(C):g!==null&&this.state$.set(!g||C)})),n.add(s.subscribe(C=>{this.state$.set(!C||h())})),n.add(r.subscribe(C=>{if(C===null)return;let g=Je(a);if(h()){this.state$.set(!0);return}g&&this.state$.set(!C)})),n}};var Nl=class extends Qn{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=De("tooltip_chapter_without_interactive")}init(i){let n=super.init(i),{store:o}=i;return n.add(o.state.interactiveEpisodes$.subscribe(l=>{l.length&&(l.every(r=>r.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}};import{combine as m8}from"@vkontakte/videoplayer-shared";var Cc=De(!1),as=null,Ol=class extends Qn{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Cc,set:(i,n=!1)=>{i!==Je(Cc)&&(this.clearTimeout(),Cc.set(i),!i&&as&&(as=!1),i&&n&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let n=super.init(i),{store:o,config:l}=i,{isInteractiveTime$:r,isPlaying$:a}=o.state,s=o.ui.controlsVisible,{interactiveTimeIndicator:u}=o.ui.controls;n.add(s.subscribe(p=>{Je(r)&&p&&this.state$.set(!1)}));let f=l?.interactiveData||{tooltipHelpHintActive:!1};return n.add(m8({isPlaying$:a,isInteractiveTime$:r,interactiveTimeIndicator:u}).subscribe(({isPlaying$:p,isInteractiveTime$:h,interactiveTimeIndicator:C})=>{if(!(!p||!C?.isDisplayed)){if(!h)return this.state$.set(!1);f.tooltipHelpHintActive&&as===null&&(as=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),o.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),n}clearTimeout(){window.clearTimeout(this.timeout)}};var Np=()=>[Dl,ql,Nl,Ol].reduce(({subscribers:t,stores:e},i)=>{let n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}});var k8={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:_8.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isMobile:g8(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1},us=class extends HTMLElement{constructor(){super();this.currentPlayingVideoIndex=0;this.needToRepeatPlaylist=!1;this.videoConfig=void 0;this.pictureInPictureApi=void 0;this.mediaSessionApi=void 0;this.unsubscribePlayerPhaseSubscription=void 0;this.annotationsApi=void 0;this.prevIsid=void 0;this.isInited=!1;this.createOneStat=(i,n={})=>{let{albumId:o,statPlace:l,statUserSalt:r,statTrackCode:a,refreshStatAuthToken:s,autoplay:u,isMobile:f,refDomain:p,deviceId:h,interactiveData:C}=rs(this.videoConfig,n),g=C?.projectInfo?.pid,{unitedVideoId:S,isClip:b=!1}=i;if(this.uiConfig.features.statistics&&S)return new y8({movieId:S,albumId:o,place:l,trackCode:a,autoplay:(u&&!this.interactiveController)??!1,mobile:f,clip:b,refDomain:p,deviceId:h,...g&&!this.isInited&&{projectId:Number(g)}},{refreshAuthToken:s,userSalt:r,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})};this.logger=new b8,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new v8,this.graphMadePause=!1,window?.videoPlayerConfig?.debugLogs&&this.subscription.add(this.logger.log$.subscribe(i=>{console.log("%c player web component ","background:#77dd77;",`${i.component}`,i.message)}))}connectedCallback(){if(this.isInited)return;this.initPlayerRootContainers();let i=this.getAttribute("stub-title")??void 0,n=this.getAttribute("stub-thumb-url")??void 0;this.svelteStubComponent=new Lp({target:this.playerContainer,props:{title:i,thumbUrl:n}})}disconnectedCallback(){this.annotationsApi?.destroy(),this.mediaSessionApi?.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%",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.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(this.shadowRootContainer),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(i){return this.store?.ui.controls.disabledControls$?.includes(i)||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let i=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:i.title,nextVideoThumb:i.thumbUrl}}createPlayer(i,n={},o){if(!this.videoConfig)return;let{albumId:l,statPlace:r,statAuthToken:a,preload:s,autoplay:u,volume:f,muted:p,fromTime:h,canRewindLive:C,supportLink:g,showAds:S,adsSlotId:b,adsParams:E={},adsPreviewParam:v,interfaceLanguage:y,isCyrillicRelatedInterface:T,logoClickable:W,logoHidden:B,isMobile:O,isAudioDisabled:ne,isLiveCatchUpMode:ge,fullScreenTarget:G,failoverHosts:X,canDownload:se,callbacks:j,interactiveData:z,showThumbTimer:Q,additionalButtons:$=[],repeat:K,saveRate:Y,volumeMultiplier:te}=rs(this.videoConfig,n),{sources:oe,title:Ve,thumbUrl:Xe,unitedVideoId:Ce,isClip:Me=!1,duration:ze,adsParams:$e={},videoEpisodes:ce,previewThumbsData:he,subtitles:at,live:we}=i,Fe={...E,...$e},ct=this.getNextVideoInfo(),Ge={sources:oe,title:Ve,thumbUrl:Xe,subtitles:at,unitedVideoId:Ce,isClip:Me,live:we,albumId:l,statPlace:r,autoplay:u,muted:p,volume:f,fromTime:h,canRewindLive:C,showAds:S,adsSlotId:b,adsParams:Fe,adsPreviewParam:v,duration:ze,logoClickable:W,logoHidden:B,isMobile:O,repeat:K,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ct.nextVideoTitle,endScreenVideoThumb:ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Ke={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Ge)}`});let Ze=this.interactiveController?.state.statistics$.getValue(),xe=Ze?.oneStat||this.createOneStat(i,n);xe&&(this.statistics=new Wr(xe,Ze?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Eo(this.uiConfig.sentry,{version:$o,env:Zl},{movieId:Ce,albumId:l,place:r,autoplay:(u&&!this.interactiveController)??!1,mobile:O,clip:Me}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat.isid$.getValue()),this.sentry={...this.sentry,...Eo.getInstance()};let qe=!!z,He=[],fe="tooltip_interactive_go_back_disabled_first";if(qe&&this.interactiveController){let de=this.interactiveController.state.isInitialChapter$.getValue(),lt=this.interactiveController.getHistoryState();de&&He.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||He.push("SEEK_TO_INTERACTIVE_BUTTON"),lt.hasPrevChapter$.getValue()||(He.push("PLAY_PREV_CHAPTER_BUTTON"),de||(lt.isGoBackLimited$.getValue()?fe="tooltip_interactive_go_back_disabled_limit":fe="tooltip_interactive_go_back_disabled"))}let le=()=>{this.isInited=!1,this.prevIsid=void 0;let de=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();j.onReplayInteractiveVideo&&!de?j.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=am({player:o,interfaceLanguage:y,isCyrillicRelatedInterface:T,videoId:Ce,isClip:Me,isLiveCatchUpMode:ge,isAudioDisabled:ne,statAuthToken:a,callbacks:j,webApi:Ke,videoEpisodes:ce,previewThumbsData:he,canDownload:se,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:He,isInteractive:qe,saveRate:Y,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,replayInteractive:le,playPrevChapterDisabledTooltip:fe,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?$:[],looped:K&&this.videoConfig.videos.length===1,statistics:this.statistics});let{stores:nt}=this.microStoresRoot=Np();this.subscription.add(this.store.state.currentFormat$.subscribe(de=>j?.onCurrentFormatChanged?.(de))),this.subscription.add(nt.interactiveControlsOpacity$.subscribe(de=>{de!==null&&this?.interactiveController?.setDisabledControls(de)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(de=>j?.onThroughputEstimationChanged?.(de))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(de=>j?.onTrafficSavingEnabledChanged?.(de))),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(de=>j?.onCurrentPlaybackRateChanged?.(de))),this.subscription.add(this.store.state.volume$.subscribe(de=>j?.onVolumeChange?.(de))),this.subscription.add(this.store.state.muted$.subscribe(de=>de?j?.onMute?.():j?.onUnmute?.())),this.subscription.add(this.store.state.videoBitrate$.subscribe(de=>j?.onVideoBitrateChanged?.(de))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(de=>{let lt=this.store?.ui.controls.disabledControls$;lt&&(de&&!lt.includes(Pl)&&lt.add(Pl),de||lt.remove(Pl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async de=>{if(!h8.isSamsungBrowser||!de||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter(this.videoConfig?.callbacks.onExternalFullscreenExit)})),this.statistics&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(de=>j?.onVSIDChanged?.(de))),this.initMediaSession(),this.svelteRootComponent=new Pp({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:oe,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:Ve,thumbUrl:Xe,subtitles:at,live:we,preload:s,autoplay:u,muted:p,volume:f,fromTime:h,canRewindLive:C,supportLink:g,showAds:S,adsSlotId:b,adsParams:Fe,adsPreviewParam:v,duration:ze,logoClickable:W,logoHidden:B,isMobile:O,failoverHosts:X,fullScreenTarget:G,saveRate:Y,shadowRootContainer:this.shadowRootContainer,showMiniTimer:Q,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ct.nextVideoTitle,endScreenVideoThumb:ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playNextVideo:()=>this.playNextVideo(),playPrevVideo:()=>this.playPrevVideo(),repeatPlaylist:()=>this.repeatPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),toggleGraph:()=>this.toggleGraph(),volumeMultiplier:te}}),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,this.videoConfig?.callbacks?.onInited?.())}addPlayerInfoSubscriptions(){let i=this.store;if(!i)return;let n=this.videoConfig?.callbacks;n&&this.subscription.add(i.playerPhase.subscribe(l=>n.onPlayerPhaseChanged?.(l))).add(i.state.playbackState$.subscribe(l=>n.onPlaybackStateChanged?.(l))).add(i.state.isLive$.subscribe(l=>n.onIsLiveChanged?.(l))).add(i.state.isActiveLive$.subscribe(l=>n.onIsActiveLiveChanged?.(l))).add(i.state.isAudioAvailable$.subscribe(l=>n.onIsAudioAvailableChanged?.(l))).add(i.state.currentQuality$.subscribe(l=>n.onCurrentQualityChanged?.(l))).add(i.state.availableQualities$.subscribe(l=>n.onAvailableQualitiesChanged?.(l.map(({value:r})=>r).filter(r=>r!=="auto")))).add(i.state.availableAudioStreams$.subscribe(l=>{l.length>1&&n.onAudioLanguagesAvailable&&n.onAudioLanguagesAvailable()})).add(i.ui.isPictureInPictureActive$.subscribe(l=>l?n.onPiPEnter?.():n.onPiPExit?.()));let o=n?.uiInfo;o&&this.subscription.add(i.ui.controlsVisible.subscribe(l=>o.onControlsVisibleChanged?.(l))).add(i.ui.isMobile.subscribe(l=>o.onIsMobileChanged?.(l))).add(i.ui.playerSize.subscribe(l=>o.onPlayerSizeChanged?.(l))).add(i.ui.controls.prevButton.subscribe(l=>o.onPrevButtonChanged?.(l))).add(i.ui.controls.playButton.subscribe(l=>o.onPlayButtonChanged?.(l))).add(i.ui.controls.replayButton.subscribe(l=>o.onReplayButtonChanged?.(l))).add(i.ui.controls.nextButton.subscribe(l=>o.onNextButtonChanged?.(l))).add(i.ui.controls.playPrevChapterButton.subscribe(l=>o.onPlayPrevChapterChanged?.(l))).add(i.ui.controls.seekToInteractiveButton.subscribe(l=>o.onSeekToInteractiveButtonChanged?.(l))).add(i.ui.controls.interactiveGraphButton.subscribe(l=>o.onGraphButtonChanged?.(l))).add(i.ui.controls.liveButton.subscribe(l=>o.onLiveButtonChanged?.(l))).add(i.ui.controls.time.subscribe(l=>o.onTimeUpdateChanged?.(l))).add(i.ui.controls.episodes.subscribe(l=>o.onEpisodesChanged?.(l))).add(i.ui.controls.subtitles.subscribe(l=>o.onSubtitlesChanged?.(l))).add(i.ui.controls.settings.subscribe(l=>o.onSettingsChanged?.(l))).add(i.ui.controls.fullscreen.subscribe(l=>o.onFullscreenChanged?.(l))).add(i.ui.controls.chromecast.subscribe(l=>o.onChromecastChanged?.(l))).add(i.ui.controls.pip.subscribe(l=>o.onPipChanged?.(l))).add(i.ui.controls.vkLogo.subscribe(l=>o.onVkLogoChanged?.(l))).add(i.ui.controls.interactiveTimeIndicator.subscribe(l=>o.onInteractiveTimeIndicatorChanged?.(l))).add(i.ui.controls.timeline.subscribe(l=>o.onTimelineChanged?.(l)))}playNextVideo(){if(!this.videoConfig)return;let i=!0;if(this.videoConfig.callbacks?.onNextVideoClick)try{i=this.videoConfig.callbacks.onNextVideoClick()}catch{this.log({message:"onNextVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){if(!this.videoConfig)return;let i=!0;if(this.videoConfig.callbacks?.onPrevVideoClick)try{i=this.videoConfig.callbacks.onPrevVideoClick()}catch{this.log({message:"onPrevVideoClick callback failed to execute"})}i&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}repeatPlaylist(){this.currentPlayingVideoIndex=0,this.log({message:"repeat playlist"}),this.createPlayerWithCurrentVideo()}createPlayerWithCurrentVideo(i,n=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&Sc(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.svelteRootComponent?.$destroy(),this.createPlayer(o,{autoplay:n,fromTime:0},i)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){let i=this.interactiveController?.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}toggleGraph(){if(!this.isInited)return;let i=this.store,{isEnded$:n,playbackState$:o,graphIsOpened$:l}=i.state,{disabledControls$:r}=i.ui.controls,a=Je(n),s=Je(o);Je(l)?(l.set(!1),this.interactiveController?.toggleGraphView(!1),r.remove(bs),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=s==="playing",l.set(!0),this.interactiveController?.toggleGraphView(!0),r.add(bs),!a&&this.graphMadePause&&this.pause())}async initInteractives(){if(this.videoConfig?.interactiveData)try{let{Interactives:i,EVENT_NAMES:n,CustomError:o}=await import("@vkontakte/videoplayer-interactive");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");let l=this.store?.interfaceLanguage$,r=l?Je(l):this.videoConfig.interfaceLanguage,{projectInfo:a,initChapterId:s,historyApi:u,videoLoader:f}=this.videoConfig.interactiveData;this.interactiveController=new i({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:r,graph:this.uiConfig.features.interactiveGraph,projectInfo:a,initChapterId:s,historyApi:u,vkVideoLoader:f,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat});let{isInteractiveExpectation$:p}=this.interactiveController.state;if(this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(h=>{if(!this.isInited)return;let C=this.store;h?C.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):C.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(p.subscribe(h=>{this.store&&this.store.state.isInteractiveExpectation$.set(h)})),this.interactiveController.on(n.playerChanged,h=>{if(!this.videoConfig)return;let C=this.interactiveController?.state.isFirstChapter$.getValue()??!0;this.videoConfig.videos[this.currentPlayingVideoIndex]={...h.config,title:a?.title||h.config.title};let g=C?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(h.player,g)}),this.interactiveController.on(n.interactives,({type:h,actionType:C})=>{if(!this.store)return;let g=p.getValue();if(h==="action-choice"&&C==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Yl)),h==="action-choice-canceled"){let S=Je(this.store.state.isPlaying$)||g;if(this.videoConfig?.isMobile&&S){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){let h=this.interactiveController.getHistoryState();this.subscription.add(h.history$.subscribe(C=>{C.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(C)}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),this.videoConfig?.callbacks.onInteractiveTimeIndicatorClick?.()})),this.interactiveController.on(n.errors,h=>{this.log({message:h.toString()})})}catch(i){this.log({message:i.message})}}initPlayer(i,n={}){if(!Array.isArray(i.videos)||i.videos.length===0&&!i.interactiveData)throw new Error("empty videos");this.videoConfig=rs(k8,p8(i,o=>o instanceof HTMLElement?o:void 0)),this.uiConfig=Fc(n.ui??{}),this.coreConfig=n.core??{configName:[]},this.statisticsConfig=n.statistics??{},this.sentry={config:this.uiConfig.sentry??{}},Sc(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.videoConfig.isMediaSessionEnabled??!0),Sc(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=ls.getLatestSupportedVersion():this.pictureInPictureApi=new Ao),this.mediaSessionApi=this.uiConfig.features.mediaSession?new os:void 0,this.annotationsApi=this.uiConfig.features.annotations?new ss:void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.svelteStubComponent?.$destroy(),this.svelteRootComponent?.$destroy(),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0),i.interactiveData?this.initInteractives():this.createPlayer(i.videos[0]),Rp(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(i){if(!this.videoConfig)return;this.log({message:`update next videos, videos: ${JSON.stringify(i)}`}),this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...i);let n=this.getNextVideoInfo();this.svelteRootComponent?.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(i=>{i==="video"?this.setupMediaSessionForVideo():i==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:i,thumbUrl:n}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",l=>this.seekTime(l.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:i,thumbUrl:n}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(i){this.log({message:i.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let i="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",n=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:i}),this.mediaSessionApi.updateActionHandlers(n),this.mediaSessionApi.attachToStore(this.store)}catch(i){this.log({message:i.message})}}play(){this.isControlDisabled("PLAY_BUTTON")||this.store?.playerPhase.is("LiveWaitingStart")||this.store?.playerPhase.is("LiveWaitingRecover")||this.store?.playerPhase.is("LiveWaitingRecord")||(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(),this.mediaSessionApi?.destroy();let i=this.videoConfig.videos[0];i&&(this.svelteRootComponent?.$destroy(),this.createPlayer(i))}setMuted(i){this.log({message:`set muted, muted: ${i}`}),this.svelteRootComponent?.setMuted(i)}setVolume(i){this.log({message:`set volume, volume: ${i}`}),this.svelteRootComponent?.setVolume(i)}setRepeat(i){this.log({message:`set repeat, repeat: ${i}`}),this.needToRepeatPlaylist=i,this.svelteRootComponent?.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(i){this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${i}`}),this.svelteRootComponent?.seekTime(i))}seekEpisodeStartTime(i){this.log({message:`seek episode start time, time: ${i}`}),this.svelteRootComponent?.seekEpisodeStartTime(i)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(i){this.log({message:`set playback rate to: ${i}`}),this.svelteRootComponent?.setPlaybackRate(i)}setAutoQualityLimits(i){this.log({message:`set auto quality limitation. Max: ${i.max??"none"}. Min: ${i.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(i)}addLanguage(i){this.store?.actions.internal.addLanguage(i)}async setLanguage(i){await this.store?.actions.internal.setLanguage(i)}setLiveStart(i){this.log({message:"live started"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingStart(!1),this.svelteRootComponent?.$destroy(),this.createPlayer(i,{autoplay:!0})}setLiveWaitingRecover(){this.log({message:"live waiting"}),this.store?.actions.internal.setLiveWaitingRecover(!0),this.store?.destroy()}setLiveWaitingRecord(){this.log({message:"post live"}),this.store?.actions.internal.setLiveWaitingRecord(!0),this.store?.destroy()}setLiveEnd(i){this.log({message:"live ended"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingRecord(!1),this.svelteRootComponent?.$destroy(),this.createPlayer(i,{autoplay:!1})}getDeviceId(){return this.statistics?.oneStat.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(i){if(this.interactiveController&&this.store?.state.positionExact$){let{EVENT_NAMES:n}=await import("@vkontakte/videoplayer-interactive"),o=Je(this.store.state.positionExact$),r=Je(this.store.state.interactiveEpisodes$).find(s=>!s.completed);this.interactiveController.once(n.playerChanged,()=>{r&&o>=r.time?this.seekTime(r.time):this.seekTime(o),i?.()});let a=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:a.chapter.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(i,n=!1){this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(i,n)}switchToActiveLive(){this.store?.actions.internal.switchToActiveLive()}updateStatContext(i){this.statistics&&this.statistics.oneStat.updateContext(i)}};import{InterfaceLanguage as $N,VKNumericLanguage as eO,loadVKLangPack as tO}from"@vkontakte/videoplayer-shared";import{VideoQuality as nO,VideoFormat as oO}from"@vkontakte/videoplayer-core";var ZN=()=>{window.customElements.define("vk-video-player",us)};export{Po as GridTypes,$N as InterfaceLanguage,$o as VERSION,eO as VKNumericLanguage,oO as VideoFormat,nO as VideoQuality,tO as loadVKLangPack,ZN as registerPlayerWebComponent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.44-dev.63a413bf.0",
3
+ "version": "1.1.44-dev.871d1572.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -50,7 +50,7 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "@vkontakte/videoplayer-core": "^2.0.110",
53
- "@vkontakte/videoplayer-interactive": "1.0.19-dev.100e5528.0",
53
+ "@vkontakte/videoplayer-interactive": "1.0.19-dev.546be670.0",
54
54
  "@vkontakte/videoplayer-shared": "^1.0.42",
55
55
  "@vkontakte/videoplayer-statistics": "^1.0.57"
56
56
  }