@vkontakte/videoplayer 1.1.72-dev.c0dc5218.0 → 1.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +19 -19
- package/es2015.esm.js +19 -19
- package/es2018.cjs.js +4 -4
- package/es2018.esm.js +4 -4
- package/es2024.cjs.js +4 -4
- package/es2024.esm.js +4 -4
- package/esnext.cjs.js +4 -4
- package/esnext.esm.js +4 -4
- package/evergreen.esm.js +4 -4
- package/package.json +5 -5
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.72
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer v1.1.72
|
|
3
|
+
* Tue, 23 Sep 2025 10:50:27 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-72/doc/
|
|
5
5
|
*/
|
|
6
6
|
"use strict";var U0=Object.create;var Hl=Object.defineProperty;var z0=Object.getOwnPropertyDescriptor;var W0=Object.getOwnPropertyNames;var K0=Object.getPrototypeOf,q0=Object.prototype.hasOwnProperty;var Wv=t=>{throw TypeError(t)};var Q0=(t,e,i)=>e in t?Hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var G0=(t,e)=>{for(var i in e)Hl(t,i,{get:e[i],enumerable:!0})},Kv=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of W0(e))!q0.call(t,n)&&n!==i&&Hl(t,n,{get:()=>e[n],enumerable:!(o=z0(e,n))||o.enumerable});return t};var qv=(t,e,i)=>(i=t!=null?U0(K0(t)):{},Kv(e||!t||!t.__esModule?Hl(i,"default",{value:t,enumerable:!0}):i,t)),j0=t=>Kv(Hl({},"__esModule",{value:!0}),t);var Yn=(t,e,i)=>Q0(t,typeof e!="symbol"?e+"":e,i),fp=(t,e,i)=>e.has(t)||Wv("Cannot "+i);var Ai=(t,e,i)=>(fp(t,e,"read from private field"),i?i.call(t):e.get(t)),Ts=(t,e,i)=>e.has(t)?Wv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),za=(t,e,i,o)=>(fp(t,e,"write to private field"),o?o.call(t,i):e.set(t,i),i),Qv=(t,e,i)=>(fp(t,e,"access private method"),i);var c5={};G0(c5,{ControlButtonType:()=>zd,GridTypes:()=>Hr,InterfaceLanguage:()=>Bl.InterfaceLanguage,MenuItemType:()=>$l,PlayerPhase:()=>ss,VERSION:()=>pa,VKNumericLanguage:()=>Bl.VKNumericLanguage,VideoFormat:()=>np.VideoFormat,VideoQuality:()=>np.VideoQuality,loadVKLangPack:()=>Bl.loadVKLangPack,registerPlayerWebComponent:()=>d5});module.exports=j0(c5);var Es="[",Is="[!",Gs="]",Xr={};var Xi=Symbol(),Vn=Symbol("filename"),Gv=Symbol("hmr"),jv="http://www.w3.org/1999/xhtml",Ec="http://www.w3.org/2000/svg";var mp="@attach";var Ic=!0;var Zv,Xv,Yv=(Xv=(Zv=globalThis.process)==null?void 0:Zv.env)==null?void 0:Xv.NODE_ENV,Me=Yv&&!Yv.toLowerCase().startsWith("prod");var Zn=Array.isArray,Jv=Array.prototype.indexOf,Fl=Array.from,vp=Object.keys,lo=Object.defineProperty,en=Object.getOwnPropertyDescriptor,kc=Object.getOwnPropertyDescriptors,gp=Object.prototype,eg=Array.prototype,js=Object.getPrototypeOf,hp=Object.isExtensible;function ks(t){return typeof t=="function"}var de=()=>{};function tg(t){return t()}function Ps(t){for(var e=0;e<t.length;e++)t[e]()}var Uo=Symbol("$state"),Wa=Symbol("legacy props"),ig=Symbol(""),Pc=Symbol("proxy path"),Ac=1,Ka=3,Xn=8;function Mc(t){return t===this.v}function qa(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function og(t,e){return t!==e}function Qa(t){return!qa(t,this.v)}function ng(){if(Me){let t=new Error(`derived_references_self
|
|
@@ -41,7 +41,7 @@ ${n}
|
|
|
41
41
|
`}),t.stack&&lo(t,"stack",{value:t.stack.split(`
|
|
42
42
|
`).filter(a=>!a.includes("svelte/src/internal")).join(`
|
|
43
43
|
`)})}}var oa=!1,ol=null,na=!1,us=!1;function Ip(t){us=t}var od=[],nd=[],Et=null,ir=!1;function Hi(t){Et=t}var _t=null;function co(t){_t=t}var Ko=null;function Nc(t){Et!==null&&Et.f&2097152&&(Ko===null?Ko=[Et,[t]]:Ko[1].push(t))}var $n=null,or=0,tr=null;function $g(t){tr=t}var Dg=1,Kc=0,ps=!1,qc=null;function ql(){return++Dg}function Js(t){var v,u;var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){var i=t.deps,o=(e&256)!==0;if(i!==null){var n,s,l=(e&512)!==0,d=o&&_t!==null&&!ps,a=i.length;if(l||d){var p=t,f=p.parent;for(n=0;n<a;n++)s=i[n],(l||!((v=s==null?void 0:s.reactions)!=null&&v.includes(p)))&&((u=s.reactions)!=null?u:s.reactions=[]).push(p);l&&(p.f^=512),d&&f!==null&&(f.f&256)===0&&(p.f^=256)}for(n=0;n<a;n++)if(s=i[n],Js(s)&&Ep(s),s.wv>t.wv)return!0}(!o||_t!==null&&!ps)&&hn(t,1024)}return!1}function Hg(t,e,i=!0){var o=t.reactions;if(o!==null)for(var n=0;n<o.length;n++){var s=o[n];Ko!=null&&Ko[1].includes(t)&&Ko[0]===Et||((s.f&2)!==0?Hg(s,e,!1):e===s&&(i?hn(s,2048):(s.f&1024)!==0&&hn(s,4096),Gl(s)))}}function Rc(t){var y,w;var e=$n,i=or,o=tr,n=Et,s=ps,l=Ko,d=Nt,a=ir,p=t.f;$n=null,or=0,tr=null,ps=(p&256)!==0&&(ir||!na||Et===null),Et=(p&96)===0?t:null,Ko=null,zl(t.ctx),ir=!1,Kc++,t.f|=2097152;try{var f=(0,t.fn)(),v=t.deps;if($n!==null){var u;if(ed(t,or),v!==null&&or>0)for(v.length=or+$n.length,u=0;u<$n.length;u++)v[or+u]=$n[u];else t.deps=v=$n;if(!ps||(p&2)!==0&&t.reactions!==null)for(u=or;u<v.length;u++)((w=(y=v[u]).reactions)!=null?w:y.reactions=[]).push(t)}else v!==null&&or<v.length&&(ed(t,or),v.length=or);if(ts()&&tr!==null&&!ir&&v!==null&&(t.f&6146)===0)for(u=0;u<tr.length;u++)Hg(tr[u],t);return n!==null&&n!==t&&(Kc++,tr!==null&&(o===null?o=tr:o.push(...tr))),f}catch(x){Ng(x)}finally{$n=e,or=i,tr=o,Et=n,ps=s,Ko=l,zl(d),ir=a,t.f^=2097152}}function o_(t,e){let i=e.reactions;if(i!==null){var o=Jv.call(i,t);if(o!==-1){var n=i.length-1;n===0?i=e.reactions=null:(i[o]=i[n],i.pop())}}i===null&&(e.f&2)!==0&&($n===null||!$n.includes(e))&&(hn(e,4096),(e.f&768)===0&&(e.f^=512),Vc(e),ed(e,0))}function ed(t,e){var i=t.deps;if(i!==null)for(var o=e;o<i.length;o++)o_(t,i[o])}function el(t){var e=t.f;if((e&16384)===0){hn(t,1024);var i=_t,o=na;if(_t=t,na=!0,Me){var n=Jn;Wl(t.component_function)}try{(e&16)!==0?Ag(t):Mp(t),Ap(t);var s=Rc(t);if(t.teardown=typeof s=="function"?s:null,t.wv=Dg,Me&&es&&(t.f&2048)!==0&&t.deps!==null)for(var l of t.deps)l.set_during_effect&&(l.wv=ql(),l.set_during_effect=!1);Me&&nd.push(t)}finally{na=o,_t=i,Me&&Wl(n)}}}function Og(){console.error("Last ten effects were: ",nd.slice(-10).map(t=>t.fn)),nd=[]}function n_(){try{lg()}catch(t){if(Me&&lo(t,"stack",{value:""}),ol!==null)if(Me)try{id(t,ol)}catch(e){throw Og(),e}else id(t,ol);else throw Me&&Og(),t}}function Bp(){var t=na;try{var e=0;for(na=!0;od.length>0;){e++>1e3&&n_();var i=od,o=i.length;od=[];for(var n=0;n<o;n++){var s=s_(i[n]);r_(s)}Xa.clear()}}finally{oa=!1,na=t,ol=null,Me&&(nd=[])}}function r_(t){var e=t.length;if(e!==0)for(var i=0;i<e;i++){var o=t[i];(o.f&24576)===0&&Js(o)&&(el(o),o.deps===null&&o.first===null&&o.nodes_start===null&&(o.teardown===null?Vp(o):o.fn=null))}}function Gl(t){oa||(oa=!0,queueMicrotask(Bp));for(var e=ol=t;e.parent!==null;){e=e.parent;var i=e.f;if((i&96)!==0){if((i&1024)===0)return;e.f^=1024}}od.push(e)}function s_(t){for(var e=[],i=t;i!==null;){var o=i.f,n=(o&96)!==0,s=n&&(o&1024)!==0;if(!s&&(o&8192)===0){(o&4)!==0?e.push(i):n?i.f^=1024:Js(i)&&el(i);var l=i.first;if(l!==null){i=l;continue}}var d=i.parent;for(i=i.next;i===null&&d!==null;)i=d.next,d=d.parent}return e}function nl(t){var e;for(t&&(oa=!0,Bp(),oa=!0,e=t());;){if(Vg(),od.length===0)return oa=!1,ol=null,Me&&(nd=[]),e;oa=!0,Bp()}}async function Io(){await Promise.resolve(),nl()}function r(t){var e=t.f,i=(e&2)!==0;if(qc!==null&&qc.add(t),Et!==null&&!ir){if(!(Ko!=null&&Ko[1].includes(t))||Ko[0]!==Et){var o=Et.deps;t.rv<Kc&&(t.rv=Kc,$n===null&&o!==null&&o[or]===t?or++:$n===null?$n=[t]:(!ps||!$n.includes(t))&&$n.push(t))}}else if(i&&t.deps===null&&t.effects===null){var n=t,s=n.parent;s!==null&&(s.f&256)===0&&(n.f^=256)}if(i&&(n=t,Js(n)&&Ep(n)),Me&&es&&!ir&&Ul!==null&&Et!==null&&Ul.reaction===Et)if(t.trace)t.trace();else{var l=cs("TracedAt");if(l){var d=Ul.entries.get(t);d===void 0&&(d={traces:[]},Ul.entries.set(t,d));var a=d.traces[d.traces.length-1];l.stack!==(a==null?void 0:a.stack)&&d.traces.push(l)}}return us&&Xa.has(t)?Xa.get(t):t.v}function wt(t){var e=ir;try{return ir=!0,t()}finally{ir=e}}var a_=-7169;function hn(t,e){t.f=t.f&a_|e}function Gc(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Uo in t)Qc(t);else if(!Array.isArray(t))for(let e in t){let i=t[e];typeof i=="object"&&i&&Uo in i&&Qc(i)}}}function Qc(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let o in t)try{Qc(t[o],e)}catch(n){}let i=js(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){let o=kc(i);for(let n in o){let s=o[n].get;if(s)try{s.call(t)}catch(l){}}}}}function Dp(t,e){if(e){let i=document.body;t.autofocus=!0,bn(()=>{document.activeElement===i&&t.focus()})}}function rd(t){var e=Et,i=_t;Hi(null),co(null);try{return t()}finally{Hi(e),co(i)}}var Hp=new Set,jc=new Set;function ra(t){if(!Je)return;t.removeAttribute("onload"),t.removeAttribute("onerror");let e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function Fp(t,e,i,o={}){function n(s){if(o.capture||rl.call(e,s),!s.cancelBubble)return rd(()=>i==null?void 0:i.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?bn(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function St(t,e,i,o,n){var s={capture:o,passive:n},l=Fp(t,e,i,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&zo(()=>{e.removeEventListener(t,l,s)})}function dt(t){for(var e=0;e<t.length;e++)Hp.add(t[e]);for(var i of jc)i(t)}function rl(t){var E;var e=this,i=e.ownerDocument,o=t.type,n=((E=t.composedPath)==null?void 0:E.call(t))||[],s=n[0]||t.target,l=0,d=t.__root;if(d){var a=n.indexOf(d);if(a!==-1&&(e===document||e===window)){t.__root=e;return}var p=n.indexOf(e);if(p===-1)return;a<=p&&(l=a)}if(s=n[l]||t.target,s!==e){lo(t,"currentTarget",{configurable:!0,get(){return s||i}});var f=Et,v=_t;Hi(null),co(null);try{for(var u,y=[];s!==null;){var w=s.assignedSlot||s.parentNode||s.host||null;try{var x=s["__"+o];if(x!=null&&(!s.disabled||t.target===s))if(Zn(x)){var[S,...T]=x;S.apply(s,[t,...T])}else x.call(s,t)}catch(V){u?y.push(V):u=V}if(t.cancelBubble||w===e||w===null)break;s=w}if(u){for(let V of y)queueMicrotask(()=>{throw V});throw u}}finally{t.__root=e,delete t.currentTarget,Hi(f),co(v)}}}var d_;function Fg(){d_=void 0}function sl(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function ko(t,e){var i=_t;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function M(t,e){var i=(e&1)!==0,o=(e&2)!==0,n,s=!t.startsWith("<!>");return()=>{if(Je)return ko(bt,null),bt;n===void 0&&(n=sl(s?t:"<!>"+t),i||(n=wi(n)));var l=o||jl?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=wi(l),a=l.lastChild;ko(d,a)}else ko(l,l);return l}}function p_(t,e,i="svg"){var o=!t.startsWith("<!>"),n=(e&1)!==0,s=`<${i}>${o?t:"<!>"+t}</${i}>`,l;return()=>{if(Je)return ko(bt,null),bt;if(!l){var d=sl(s),a=wi(d);if(n)for(l=document.createDocumentFragment();wi(a);)l.appendChild(wi(a));else l=wi(a)}var p=l.cloneNode(!0);if(n){var f=wi(p),v=p.lastChild;ko(f,v)}else ko(p,p);return p}}function Te(t,e){return p_(t,e,"svg")}function os(t=""){if(!Je){var e=_n(t+"");return ko(e,e),e}var i=bt;return i.nodeType!==Ka&&(i.before(i=_n()),yi(i)),ko(i,i),i}function We(){if(Je)return ko(bt,null),bt;var t=document.createDocumentFragment(),e=document.createComment(""),i=_n();return t.append(e,i),ko(e,i),t}function $(t,e){if(Je){_t.nodes_end=bt,Ui();return}t!==null&&t.before(e)}var f_=/\r/g;function zg(t){t=t.replace(f_,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function Wg(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var m_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Kg(t){return m_.includes(t)}var v_=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var g_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function qg(t){var e;return t=t.toLowerCase(),(e=g_[t])!=null?e:t}var X6=[...v_,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var h_=["touchstart","touchmove"];function Qg(t){return h_.includes(t)}var __=["$state","$state.raw","$derived","$derived.by"],J6=[...__,"$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$inspect","$inspect().with","$inspect.trace","$host"];var b_=["textarea","script","style","title"];function Gg(t){return b_.includes(t)}function Yc(t){return t==null?void 0:t.replace(/\//g,"/\u200B")}var sd=!0;function Zc(t){sd=t}function be(t,e){var o;var i=e==null?"":typeof e=="object"?e+"":e;i!==((o=t.__t)!=null?o:t.__t=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}function ns(t,e){return jg(t,e)}function zp(t,e){var l;Dc(),e.intro=(l=e.intro)!=null?l:!1;let i=e.target,o=Je,n=bt;try{for(var s=wi(i);s&&(s.nodeType!==Xn||s.data!==Es);)s=qo(s);if(!s)throw Xr;uo(!0),yi(s),Ui();let d=jg(t,{...e,anchor:s});if(bt===null||bt.nodeType!==Xn||bt.data!==Gs)throw As(),Xr;return uo(!1),d}catch(d){if(d===Xr)return e.recover===!1&&dg(),Dc(),Yl(i),uo(!1),ns(t,e);throw d}finally{uo(o),yi(n),Fg()}}var al=new Map;function jg(t,{target:e,anchor:i,props:o={},events:n,context:s,intro:l=!0}){Dc();var d=new Set,a=v=>{for(var u=0;u<v.length;u++){var y=v[u];if(!d.has(y)){d.add(y);var w=Qg(y);e.addEventListener(y,rl,{passive:w});var x=al.get(y);x===void 0?(document.addEventListener(y,rl,{passive:w}),al.set(y,1)):al.set(y,x+1)}}};a(Fl(Hp)),jc.add(a);var p=void 0,f=Pg(()=>{var v=i!=null?i:e.appendChild(_n());return Mi(()=>{if(s){U({});var u=Nt;u.c=s}n&&(o.$$events=n),Je&&ko(v,null),sd=l,p=t(v,o)||{},sd=!0,Je&&(_t.nodes_end=bt),s&&z()}),()=>{var w;for(var u of d){e.removeEventListener(u,rl);var y=al.get(u);--y===0?(document.removeEventListener(u,rl),al.delete(u)):al.set(u,y)}jc.delete(a),v!==i&&((w=v.parentNode)==null||w.removeChild(v))}});return Up.set(p,f),p}var Up=new WeakMap;function sa(t,e){let i=Up.get(t);return i?(Up.delete(t),i(e)):(Me&&wg(),Promise.resolve())}function ye(t,e,...i){var o=t,n=de,s;zi(()=>{n!==(n=e())&&(s&&(Fi(s),s=null),Me&&n==null&&cg(),s=Mi(()=>n(o,...i)))},65536),Je&&(o=bt)}if(Me){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;fg(e)},set:o=>{i=o}})}};w_=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var w_;function Mt(t){Nt===null&&Ga("onMount"),Jr&&Nt.l!==null?x_(Nt).m.push(t):Ke(()=>{let e=wt(t);if(typeof e=="function")return e})}function nn(t){Nt===null&&Ga("onDestroy"),Mt(()=>()=>wt(t))}function x_(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}var Yg=new Map;function Zg(t,e){var i=Yg.get(t);i||(i=new Set,Yg.set(t,i)),i.add(e)}function L(t,e,[i,o]=[0,0]){Je&&i===0&&Ui();var n=t,s=null,l=null,d=Xi,a=i>0?65536:0,p=!1;let f=(u,y=!0)=>{p=!0,v(y,u)},v=(u,y)=>{if(d===(d=u))return;let w=!1;if(Je&&o!==-1){if(i===0){let S=Bc(n);S===Es?o=0:S===Is?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let x=o>i;!!d===x&&(n=ea(),yi(n),uo(!1),w=!0,o=-1)}d?(s?ms(s):y&&(s=Mi(()=>y(n))),l&&Bn(l,()=>{l=null})):(l?ms(l):y&&(l=Mi(()=>y(n,[i+1,o]))),s&&Bn(s,()=>{s=null})),w&&uo(!0)};zi(()=>{p=!1,e(f),p||v(null,null)},a),Je&&(n=bt)}function aa(t,e,i){Je&&Ui();var o=t,n=Xi,s,l=ts()?og:qa;zi(()=>{l(n,n=e())&&(s&&Bn(s),s=Mi(()=>i(o)))}),Je&&(o=bt)}var Ls=null;function qp(t){Ls=t}function ad(t,e){return e}function T_(t,e,i,o){for(var n=[],s=e.length,l=0;l<s;l++)zc(e[l].e,n,!0);var d=s>0&&n.length===0&&i!==null;if(d){var a=i.parentNode;Yl(a),a.append(i),o.clear(),Ms(t,e[0].prev,e[s-1].next)}Rp(n,()=>{for(var p=0;p<s;p++){var f=e[p];d||(o.delete(f.k),Ms(t,f.prev,f.next)),Fi(f.e,!d)}})}function Ti(t,e,i,o,n,s=null){var l=t,d={flags:e,items:new Map,first:null},a=(e&4)!==0;if(a){var p=t;l=Je?yi(wi(p)):p.appendChild(_n())}Je&&Ui();var f=null,v=!1,u=Rr(()=>{var y=i();return Zn(y)?y:y==null?[]:Fl(y)});zi(()=>{var y=r(u),w=y.length;if(v&&w===0)return;v=w===0;let x=!1;if(Je){var S=Bc(l)===Is;S!==(w===0)&&(l=ea(),yi(l),uo(!1),x=!0)}if(Je){for(var T=null,E,V=0;V<w;V++){if(bt.nodeType===Xn&&bt.data===Gs){l=bt,x=!0,uo(!1);break}var k=y[V],I=o(k,V);E=eh(bt,d,T,null,k,I,V,n,e,i),d.items.set(I,E),T=E}w>0&&yi(ea())}Je||E_(y,d,l,n,e,o,i),s!==null&&(w===0?f?ms(f):f=Mi(()=>s(l)):f!==null&&Bn(f,()=>{f=null})),x&&uo(!0),r(u)}),Je&&(l=bt)}function E_(t,e,i,o,n,s,l){var ie,ue,$e,fe;var d=(n&8)!==0,a=(n&3)!==0,p=t.length,f=e.items,v=e.first,u=v,y,w=null,x,S=[],T=[],E,V,k,I;if(d)for(I=0;I<p;I+=1)E=t[I],V=s(E,I),k=f.get(V),k!==void 0&&((ie=k.a)==null||ie.measure(),(x!=null?x:x=new Set).add(k));for(I=0;I<p;I+=1){if(E=t[I],V=s(E,I),k=f.get(V),k===void 0){var R=u?u.e.nodes_start:i;w=eh(R,e,w,w===null?e.first:w.next,E,V,I,o,n,l),f.set(V,w),S=[],T=[],u=w.next;continue}if(a&&I_(k,E,I,n),(k.e.f&8192)!==0&&(ms(k.e),d&&((ue=k.a)==null||ue.unfix(),(x!=null?x:x=new Set).delete(k))),k!==u){if(y!==void 0&&y.has(k)){if(S.length<T.length){var Y=T[0],H;w=Y.prev;var F=S[0],W=S[S.length-1];for(H=0;H<S.length;H+=1)Xg(S[H],Y,i);for(H=0;H<T.length;H+=1)y.delete(T[H]);Ms(e,F.prev,W.next),Ms(e,w,F),Ms(e,W,Y),u=Y,w=W,I-=1,S=[],T=[]}else y.delete(k),Xg(k,u,i),Ms(e,k.prev,k.next),Ms(e,k,w===null?e.first:w.next),Ms(e,w,k),w=k;continue}for(S=[],T=[];u!==null&&u.k!==V;)(u.e.f&8192)===0&&(y!=null?y:y=new Set).add(u),T.push(u),u=u.next;if(u===null)continue;k=u}S.push(k),w=k,u=k.next}if(u!==null||y!==void 0){for(var J=y===void 0?[]:Fl(y);u!==null;)(u.e.f&8192)===0&&J.push(u),u=u.next;var G=J.length;if(G>0){var ce=(n&4)!==0&&p===0?i:null;if(d){for(I=0;I<G;I+=1)($e=J[I].a)==null||$e.measure();for(I=0;I<G;I+=1)(fe=J[I].a)==null||fe.fix()}T_(e,J,ce,f)}}d&&bn(()=>{var ke;if(x!==void 0)for(k of x)(ke=k.a)==null||ke.apply()}),_t.first=e.first&&e.first.e,_t.last=w&&w.e}function I_(t,e,i,o){(o&1)!==0&&Ja(t.v,e),(o&2)!==0?Ja(t.i,i):t.i=i}function eh(t,e,i,o,n,s,l,d,a,p){var f=Ls,v=(a&1)!==0,u=(a&16)===0,y=v?u?is(n,!1,!1):gr(n):n,w=(a&2)===0?l:gr(l);Me&&v&&(y.trace=()=>{var S=typeof w=="number"?l:w.v;p()[S]});var x={i:w,v:y,k:s,a:null,e:null,prev:i,next:o};Ls=x;try{return x.e=Mi(()=>d(t,y,w,p),Je),x.e.prev=i&&i.e,x.e.next=o&&o.e,i===null?e.first=x:(i.next=x,i.e.next=x.e),o!==null&&(o.prev=x,o.e.prev=x.e),x}finally{Ls=f}}function Xg(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,s=t.e.nodes_start;s!==o;){var l=qo(s);n.before(s),s=l}}function Ms(t,e,i){e===null?t.first=i:(e.next=i,e.e.next=i&&i.e),i!==null&&(i.prev=e,i.e.prev=e&&e.e)}function k_(t,e,i){var s,l;if(!e||e===zg(String(i!=null?i:"")))return;let o,n=(s=t.__svelte_meta)==null?void 0:s.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:(l=Jn)!=null&&l[Vn]&&(o=`in ${Jn[Vn]}`),xg(Yc(o))}function ld(t,e,i=!1,o=!1,n=!1){var s=t,l="";B(()=>{var y;var d=_t;if(l===(l=(y=e())!=null?y:"")){Je&&Ui();return}if(d.nodes_start!==null&&(Lp(d.nodes_start,d.nodes_end),d.nodes_start=d.nodes_end=null),l!==""){if(Je){for(var a=bt.data,p=Ui(),f=p;p!==null&&(p.nodeType!==Xn||p.data!=="");)f=p,p=qo(p);if(p===null)throw As(),Xr;Me&&!n&&k_(p.parentNode,a,l),ko(bt,f),s=yi(p);return}var v=l+"";i?v=`<svg>${v}</svg>`:o&&(v=`<math>${v}</math>`);var u=sl(v);if((i||o)&&(u=wi(u)),ko(wi(u),u.lastChild),i||o)for(;wi(u);)s.before(wi(u));else s.before(u)}})}function Ei(t,e,i){Je&&Ui();var o=t,n,s;zi(()=>{n!==(n=e())&&(s&&(Bn(s),s=null),n&&(s=Mi(()=>i(o,n))))},65536),Je&&(o=bt)}function la(t,e,i,o,n,s){var w;let l=Je;Je&&Ui();var d=Me&&s&&((w=Nt)==null?void 0:w.function[Vn]),a,p,f=null;Je&&bt.nodeType===Ac&&(f=bt,Ui());var v=Je?bt:t,u,y=Ls;zi(()=>{let x=e()||null;var S=n?n():i||x==="svg"?Ec:null;if(x!==a){var T=Ls;qp(y),u&&(x===null?Bn(u,()=>{u=null,p=null}):x===p?ms(u):(Fi(u),Zc(!1))),x&&x!==p&&(u=Mi(()=>{if(f=Je?f:S?document.createElementNS(S,x):document.createElement(x),Me&&s&&(f.__svelte_meta={loc:{file:d,line:s[0],column:s[1]}}),ko(f,f),o){Je&&Gg(x)&&f.append(document.createComment(""));var E=Je?wi(f):f.appendChild(_n());Je&&(E===null?uo(!1):yi(E)),o(f,E)}_t.nodes_end=f,v.before(f)})),a=x,a&&(p=a),Zc(!0),qp(T)}},65536),l&&(uo(!0),yi(v))}var Gp;function th(t){return Gp=t.target,new Qp(t)}var vs,hr,Qp=class{constructor(e){Ts(this,vs);Ts(this,hr);var s,l;var i=new Map,o=(d,a)=>{var p=is(a,!1,!1);return i.set(d,p),p};let n=new Proxy({...e.props||{},$$events:{}},{get(d,a){var p;return r((p=i.get(a))!=null?p:o(a,Reflect.get(d,a)))},has(d,a){var p;return a===Wa?!0:(r((p=i.get(a))!=null?p:o(a,Reflect.get(d,a))),Reflect.has(d,a))},set(d,a,p){var f;return O((f=i.get(a))!=null?f:o(a,p),p),Reflect.set(d,a,p)}});za(this,hr,(e.hydrate?zp:ns)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover})),(!((l=e==null?void 0:e.props)!=null&&l.$$host)||e.sync===!1)&&nl(),za(this,vs,n.$$events);for(let d of Object.keys(Ai(this,hr)))d==="$set"||d==="$destroy"||d==="$on"||lo(this,d,{get(){return Ai(this,hr)[d]},set(a){Ai(this,hr)[d]=a},enumerable:!0});Ai(this,hr).$set=d=>{Object.assign(n,d)},Ai(this,hr).$destroy=()=>{sa(Ai(this,hr))}}$set(e){Ai(this,hr).$set(e)}$on(e,i){Ai(this,vs)[e]=Ai(this,vs)[e]||[];let o=(...n)=>i.call(this,...n);return Ai(this,vs)[e].push(o),()=>{Ai(this,vs)[e]=Ai(this,vs)[e].filter(n=>n!==o)}}$destroy(){Ai(this,hr).$destroy()}};vs=new WeakMap,hr=new WeakMap;function q(t,e){bn(()=>{var n,s,l;var i=t.getRootNode(),o=i.host?i:(l=(n=i.head)!=null?n:i.ownerDocument.head)!=null?l:(s=Gp)==null?void 0:s.parentNode;if(!(o!=null&&o.querySelector("#"+e.hash))){let d=document.createElement("style");d.id=e.hash,d.textContent=e.code,o.appendChild(d),Me&&Zg(e.hash,d)}})}function gs(t,e){var i=void 0,o;zi(()=>{i!==(i=e())&&(o&&(Fi(o),o=null),i&&(o=Mi(()=>{Eo(()=>i(t))})))})}function ih(t){var e,i,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(i=ih(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function oh(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=ih(t))&&(o&&(o+=" "),o+=e);return o}function dd(t){return typeof t=="object"?oh(t):t!=null?t:""}var nh=[...`
|
|
44
|
-
\r\f\xA0\v\uFEFF`];function sh(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var s=n.length,l=0;(l=o.indexOf(n,l))>=0;){var d=l+s;(l===0||nh.includes(o[l-1]))&&(d===o.length||nh.includes(o[d]))?o=(l===0?"":o.substring(0,l))+o.substring(d+1):l=d}}return o===""?null:o}function rh(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var s=t[n];s!=null&&s!==""&&(o+=" "+n+": "+s+i)}return o}function jp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ah(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,l=0,d=!1,a=[];o&&a.push(...Object.keys(o).map(jp)),n&&a.push(...Object.keys(n).map(jp));var p=0,f=-1;let x=t.length;for(var v=0;v<x;v++){var u=t[v];if(d?u==="/"&&t[v-1]==="*"&&(d=!1):s?s===u&&(s=!1):u==="/"&&t[v+1]==="*"?d=!0:u==='"'||u==="'"?s=u:u==="("?l++:u===")"&&l--,!d&&s===!1&&l===0){if(u===":"&&f===-1)f=v;else if(u===";"||v===x-1){if(f!==-1){var y=jp(t.substring(p,f).trim());if(!a.includes(y)){u!==";"&&v++;var w=t.substring(p,v).trim();i+=" "+w+";"}}p=v+1,f=-1}}}}return o&&(i+=rh(o)),n&&(i+=rh(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ee(t,e,i,o,n,s){var l=t.__className;if(Je||l!==i||l===void 0){var d=sh(i,o,s);(!Je||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(s&&n!==s)for(var a in s){var p=!!s[a];(n==null||p!==!!n[a])&&t.classList.toggle(a,p)}return s}function Yp(t,e={},i,o){for(var n in i){var s=i[n];e[n]!==s&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,s,o))}}function st(t,e,i,o){var n=t.__style;if(Je||n!==e){var s=ah(e,o);(!Je||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(Yp(t,i==null?void 0:i[0],o[0]),Yp(t,i==null?void 0:i[1],o[1],"important")):Yp(t,i,o));return o}function cd(t,e,i){if(t.multiple){if(e==null)return;if(!Zn(e))return Sg();for(var o of t.options)o.selected=e.includes(lh(o));return}for(o of t.options){var n=lh(o);if(xp(n,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Zp(t){var e=new MutationObserver(()=>{cd(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),zo(()=>{e.disconnect()})}function lh(t){return"__value"in t?t.__value:t.value}var ll=Symbol("class"),dl=Symbol("style"),uh=Symbol("is custom element"),ph=Symbol("is html");function fh(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Fe(t,e,i,o){var n=vh(t);if(Je&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||O_(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[ig]=i),i==null?t.removeAttribute(e):typeof i!="string"&&gh(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function mh(t,e,i,o,n=!1){var k;var s=vh(t),l=s[uh],d=!s[ph];let a=Je&&l;a&&uo(!1);var p=e||{},f=t.tagName==="OPTION";for(var v in e)v in i||(i[v]=null);i.class?i.class=dd(i.class):(o||i[ll])&&(i.class=null),i[dl]&&((k=i.style)!=null||(i.style=null));var u=gh(t);for(let I in i){let R=i[I];if(f&&I==="value"&&R==null){t.value=t.__value="",p[I]=R;continue}if(I==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";ee(t,y,R,o,e==null?void 0:e[ll],i[ll]),p[I]=R,p[ll]=i[ll];continue}if(I==="style"){st(t,R,e==null?void 0:e[dl],i[dl]),p[I]=R,p[dl]=i[dl];continue}var w=p[I];if(!(R===w&&!(R===void 0&&t.hasAttribute(I)))){p[I]=R;var x=I[0]+I[1];if(x!=="$$")if(x==="on"){let Y={},H="$$"+I,F=I.slice(2);var S=Kg(F);if(Wg(F)&&(F=F.slice(0,-7),Y.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(F,p[H],Y),p[H]=null}if(R!=null)if(S)t[`__${F}`]=R,dt([F]);else{let W=function(J){p[I].call(this,J)};var V=W;p[H]=Fp(F,t,W,Y)}else S&&(t[`__${F}`]=void 0)}else if(I==="style")Fe(t,I,R);else if(I==="autofocus")Dp(t,!!R);else if(!l&&(I==="__value"||I==="value"&&R!=null))t.value=t.__value=R;else if(I==="selected"&&f)fh(t,R);else{var T=I;d||(T=qg(T));var E=T==="defaultValue"||T==="defaultChecked";if(R==null&&!l&&!E)if(s[I]=null,T==="value"||T==="checked"){let Y=t,H=e===void 0;if(T==="value"){let F=Y.defaultValue;Y.removeAttribute(T),Y.defaultValue=F,Y.value=Y.__value=H?F:null}else{let F=Y.defaultChecked;Y.removeAttribute(T),Y.defaultChecked=F,Y.checked=H?F:!1}}else t.removeAttribute(I);else E||u.includes(T)&&(l||typeof R!="string")?t[T]=R:typeof R!="function"&&Fe(t,T,R,n)}}}return a&&uo(!0),p}function Pe(t,e,i=[],o,n=!1,s=Vr){let l=i.map(s);var d=void 0,a={},p=t.nodeName==="SELECT",f=!1;if(zi(()=>{var u=e(...l.map(r)),y=mh(t,d,u,o,n);f&&p&&"value"in u&&cd(t,u.value,!1);for(let x of Object.getOwnPropertySymbols(a))u[x]||Fi(a[x]);for(let x of Object.getOwnPropertySymbols(u)){var w=u[x];x.description===mp&&(!d||w!==d[x])&&(a[x]&&Fi(a[x]),a[x]=Mi(()=>gs(t,()=>w))),y[x]=w}d=y}),p){var v=t;Eo(()=>{cd(v,d.value),Zp(v)})}f=!0}function vh(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[uh]:t.nodeName.includes("-"),[ph]:t.namespaceURI===jv}}var dh=new Map;function gh(t){var e=dh.get(t.nodeName);if(e)return e;dh.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=kc(o);for(var s in i)i[s].set&&e.push(s);o=js(o)}return e}function O_(t,e,i){var o;Me&&(e==="srcset"&&B_(t,i)||Xp((o=t.getAttribute(e))!=null?o:"",i)||yg(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Xp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function ch(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function B_(t,e){var i=ch(t.srcset),o=ch(e);return o.length===i.length&&o.every(([n,s],l)=>s===i[l][1]&&(Xp(i[l][0],n)||Xp(n,i[l][0])))}var D_=Ic?()=>performance.now():()=>Date.now(),Br={tick:t=>(Ic?requestAnimationFrame:de)(t),now:()=>D_(),tasks:new Set};function hh(){let t=Br.now();Br.tasks.forEach(e=>{e.c(t)||(Br.tasks.delete(e),e.f())}),Br.tasks.size!==0&&Br.tick(hh)}function _h(t){let e;return Br.tasks.size===0&&Br.tick(hh),{promise:new Promise(i=>{Br.tasks.add(e={c:t,f:i})}),abort(){Br.tasks.delete(e)}}}function Xc(t,e){rd(()=>{t.dispatchEvent(new CustomEvent(e))})}function z_(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function bh(t){let e={},i=t.split(";");for(let o of i){let[n,s]=o.split(":");if(!n||s===void 0)break;let l=z_(n.trim());e[l]=s.trim()}return e}var W_=t=>t;function ef(t,e,i,o){var V;var n=(t&1)!==0,s=(t&2)!==0,l=n&&s,d=(t&4)!==0,a=l?"both":n?"in":"out",p,f=e.inert,v=e.style.overflow,u,y;function w(){var R;var k=Et,I=_t;Hi(null),co(null);try{return p!=null?p:p=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:a})}finally{Hi(k),co(I)}}var x={is_global:d,in(){var k;if(e.inert=f,!n){y==null||y.abort(),(k=y==null?void 0:y.reset)==null||k.call(y);return}s||u==null||u.abort(),Xc(e,"introstart"),u=Jp(e,w(),y,1,()=>{Xc(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=v})},out(k){if(!s){k==null||k(),p=void 0;return}e.inert=!0,Xc(e,"outrostart"),y=Jp(e,w(),u,0,()=>{Xc(e,"outroend"),k==null||k()})},stop:()=>{u==null||u.abort(),y==null||y.abort()}},S=_t;if(((V=S.transitions)!=null?V:S.transitions=[]).push(x),n&&sd){var T=d;if(!T){for(var E=S.parent;E&&(E.f&65536)!==0;)for(;(E=E.parent)&&(E.f&16)===0;);T=!E||(E.f&32768)!==0}T&&Eo(()=>{wt(()=>x.in())})}}function Jp(t,e,i,o,n){var s=o===1;if(ks(e)){var l,d=!1;return bn(()=>{if(!d){var S=e({direction:s?"in":"out"});l=Jp(t,S,i,o,n)}}),{abort:()=>{d=!0,l==null||l.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:de,deactivate:de,reset:de,t:()=>o};let{delay:a=0,css:p,tick:f,easing:v=W_}=e;var u=[];if(s&&i===void 0&&(f&&f(0,1),p)){var y=bh(p(0,1));u.push(y,y)}var w=()=>1-o,x=t.animate(u,{duration:a,fill:"forwards"});return x.onfinish=()=>{var F;x.cancel();var S=(F=i==null?void 0:i.t())!=null?F:1-o;i==null||i.abort();var T=o-S,E=e.duration*Math.abs(T),V=[];if(E>0){var k=!1;if(p)for(var I=Math.ceil(E/16.666666666666668),R=0;R<=I;R+=1){var Y=S+T*v(R/I),H=bh(p(Y,1-Y));V.push(H),k||(k=H.overflow==="hidden")}k&&(t.style.overflow="hidden"),w=()=>{var W=x.currentTime;return S+T*v(W/E)},f&&_h(()=>{if(x.playState!=="running")return!1;var W=w();return f(W,1-W),!0})}x=t.animate(V,{duration:E,fill:"forwards"}),x.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{x&&(x.cancel(),x.effect=null,x.onfinish=de)},deactivate:()=>{n=de},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var Vs,cl,ud,eu,$h,tu=class tu{constructor(e){Ts(this,eu);Ts(this,Vs,new WeakMap);Ts(this,cl);Ts(this,ud);za(this,ud,e)}observe(e,i){var o=Ai(this,Vs).get(e)||new Set;return o.add(i),Ai(this,Vs).set(e,o),Qv(this,eu,$h).call(this).observe(e,Ai(this,ud)),()=>{var n=Ai(this,Vs).get(e);n.delete(i),n.size===0&&(Ai(this,Vs).delete(e),Ai(this,cl).unobserve(e))}}};Vs=new WeakMap,cl=new WeakMap,ud=new WeakMap,eu=new WeakSet,$h=function(){var e;return(e=Ai(this,cl))!=null?e:za(this,cl,new ResizeObserver(i=>{for(var o of i){tu.entries.set(o.target,o);for(var n of Ai(this,Vs).get(o.target)||[])n(o)}}))},Yn(tu,"entries",new WeakMap);var tf=tu;var K_=new tf({box:"border-box"});function nr(t,e,i){var o=K_.observe(t,()=>i(t[e]));Eo(()=>(wt(()=>i(t[e])),o))}function yh(t,e){return t===e||(t==null?void 0:t[Uo])===e}function ot(t={},e,i,o){return Eo(()=>{var n,s;return Qo(()=>{n=s,s=(o==null?void 0:o())||[],wt(()=>{t!==i(...s)&&(e(t,...s),n&&yh(i(...n),t)&&e(null,...n))})}),()=>{bn(()=>{s&&yh(i(...s),t)&&e(null,...s)})}}),t}function Dr(t=!1){let e=Nt,i=e.l.u;if(!i)return;let o=()=>Gc(e.s);if(t){let n=0,s={},l=Vr(()=>{let d=!1,a=e.s;for(let p in a)a[p]!==s[p]&&(s[p]=a[p],d=!0);return d&&n++,n});o=()=>r(l)}i.b.length&&Jl(()=>{xh(e,o),Ps(i.b)}),Ke(()=>{let n=wt(()=>i.m.map(tg));return()=>{for(let s of n)typeof s=="function"&&s()}}),i.a.length&&Ke(()=>{xh(e,o),Ps(i.a)})}function xh(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}function pd(t,e,i){if(t==null)return e(void 0),i&&i(void 0),de;let o=wt(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var ul=[];function _r(t,e){return{subscribe:se(t,e).subscribe}}function se(t,e=de){let i=null,o=new Set;function n(d){if(qa(t,d)&&(t=d,i)){let a=!ul.length;for(let p of o)p[1](),ul.push(p,t);if(a){for(let p=0;p<ul.length;p+=2)ul[p][0](ul[p+1]);ul.length=0}}}function s(d){n(d(t))}function l(d,a=de){let p=[d,a];return o.add(p),o.size===1&&(i=e(n,s)||de),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:s,subscribe:l}}function Si(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let s=e.length<2;return _r(i,(l,d)=>{let a=!1,p=[],f=0,v=de,u=()=>{if(f)return;v();let w=e(o?p[0]:p,l,d);s?l(w):v=typeof w=="function"?w:de},y=n.map((w,x)=>pd(w,S=>{p[x]=S,f&=~(1<<x),a&&u()},()=>{f|=1<<x}));return a=!0,u(),function(){Ps(y),v(),a=!1}})}function xe(t){let e;return pd(t,i=>e=i)(),e}var iu=!1,of=Symbol();function C(t,e,i){var s;let o=(s=i[e])!=null?s:i[e]={store:null,source:is(void 0),unsubscribe:de};if(o.store!==t&&!(of in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=de;else{var n=!0;o.unsubscribe=pd(t,l=>{n?o.source.v=l:O(o.source,l)}),n=!1}return t&&of in i?xe(t):r(o.source)}function He(){let t={};function e(){zo(()=>{for(var i in t)t[i].unsubscribe();lo(t,of,{enumerable:!1,value:!0})})}return[t,e]}function nf(t){var e=iu;try{return iu=!1,[t(),iu]}finally{iu=e}}var X_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Me&&pg(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Ne(t,e,i){return new Proxy(Me?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},X_)}var J_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ks(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];ks(n)&&(n=n());let s=en(n,e);if(s&&s.set)return s.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ks(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=en(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Uo||e===Wa)return!1;for(let i of t.props)if(ks(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(ks(i)&&(i=i()),!!i){for(let o in i)e.includes(o)||e.push(o);for(let o of Object.getOwnPropertySymbols(i))e.includes(o)||e.push(o)}return e}};function hs(...t){return new Proxy({props:t},J_)}function wh(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function m(t,e,i,o){var Y,H;var n=(i&1)!==0,s=!Jr||(i&2)!==0,l=(i&8)!==0,d=(i&16)!==0,a=!1,p;l?[p,a]=nf(()=>t[e]):p=t[e];var f=Uo in t||Wa in t,v=l&&((H=(Y=en(t,e))==null?void 0:Y.set)!=null?H:f&&e in t&&(F=>t[e]=F))||void 0,u=o,y=!0,w=!1,x=()=>(w=!0,y&&(y=!1,d?u=wt(o):u=o),u);p===void 0&&o!==void 0&&(v&&s&&ug(e),p=x(),v&&v(p));var S;if(s)S=()=>{var F=t[e];return F===void 0?x():(y=!0,w=!1,F)};else{var T=(n?Vr:Rr)(()=>t[e]);T.f|=131072,S=()=>{var F=r(T);return F!==void 0&&(u=void 0),F===void 0?u:F}}if((i&4)===0&&s)return S;if(v){var E=t.$$legacy;return function(F,W){return arguments.length>0?((!s||!W||E||a)&&v(W?S():F),F):S()}}var V=!1,k=!1,I=is(p),R=Vr(()=>{var F=S(),W=r(I);return V?(V=!1,k=!0,W):(k=!1,I.v=F)});return l&&r(R),n||(R.equals=Qa),function(F,W){if(qc!==null&&(V=k,S(),r(I)),arguments.length>0){let J=W?r(R):s&&l?ni(F):F;if(!R.equals(J)){if(V=!0,O(I,J),w&&u!==void 0&&(u=J),wh(R))return F;wt(()=>r(R))}return F}return wh(R)?R.v:r(R)}}var eb;typeof HTMLElement=="function"&&(eb=class extends HTMLElement{constructor(e,i,o){super();Yn(this,"$$ctor");Yn(this,"$$s");Yn(this,"$$c");Yn(this,"$$cn",!1);Yn(this,"$$d",{});Yn(this,"$$r",!1);Yn(this,"$$p_d",{});Yn(this,"$$l",{});Yn(this,"$$l_u",new Map);Yn(this,"$$me");this.$$ctor=e,this.$$s=i,o&&this.attachShadow({mode:"open"})}addEventListener(e,i,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(i),this.$$c){let n=this.$$c.$on(e,i);this.$$l_u.set(i,n)}super.addEventListener(e,i,o)}removeEventListener(e,i,o){if(super.removeEventListener(e,i,o),this.$$c){let n=this.$$l_u.get(i);n&&(n(),this.$$l_u.delete(i))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(s){return l=>{let d=document.createElement("slot");s!=="default"&&(d.name=s),$(l,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=tb(this);for(let s of this.$$s)s in n&&(s==="default"&&!this.$$d.children?(this.$$d.children=i(s),o.default=!0):o[s]=i(s));for(let s of this.attributes){let l=this.$$g_p(s.name);l in this.$$d||(this.$$d[l]=rf(l,s.value,this.$$p_d,"toProp"))}for(let s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=th({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=Uc(()=>{Qo(()=>{var s;this.$$r=!0;for(let l of vp(this.$$c)){if(!((s=this.$$p_d[l])!=null&&s.reflect))continue;this.$$d[l]=this.$$c[l];let d=rf(l,this.$$d[l],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,d)}this.$$r=!1})});for(let s in this.$$l)for(let l of this.$$l[s]){let d=this.$$c.$on(s,l);this.$$l_u.set(l,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=rf(e,o,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return vp(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function rf(t,e,i,o){var s;let n=(s=i[t])==null?void 0:s.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function tb(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Sh="5";var Ch,Th,Eh;typeof window!="undefined"&&((Eh=(Th=(Ch=window.__svelte)!=null?Ch:window.__svelte={}).v)!=null?Eh:Th.v=new Set).add(Sh);var Al=require("@vkontakte/videoplayer-core/es2018"),Ij=require("@vkontakte/videoplayer-core/es2018"),Da=require("@vkontakte/videoplayer-shared/es2018"),T0=require("@vkontakte/videoplayer-statistics/es2018");var da=require("@vkontakte/videoplayer-shared/es2018");var ib={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:da.InterfaceLanguage.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:da.VideoQuality.Q_480P,highQualityLimit:da.VideoQuality.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,thinStatistics:!1,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,tracer:!1,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,interactiveControlsTapPlace:!1,interactiveControlsFillAnimation:!1,interactiveControlsHideAnimation:!1,interactiveHistoryEndChapterFix:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1,playbackStatusAnimationDuration:1e3,playbackStatusShow:!1,playbackStatusNextVideoShow:!1,playbackStatusNextVideoAnimationDuration:1e3,initSubtitles:!0,useCallbackForMediaSessionNextPrevClick:!1,usePerformanceFix:!1,userVideoPrefs:!1,savePreferredStatesOnUserActionOnly:!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,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1,usePuid:!0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null,font:null,focusedOutlineWidth:null,focusedOutlineRadius:null,controlsDesktopPaddingHorizontal:null,timelinePaddingHorizontal:null,settingsBackgroundColor:null,controlsGradientHeight:null,controlsGradient:null},userSalt:"0"},Ih=t=>(0,da.fillWithDefault)(t,ib),kh=t=>Ya("ui-config",t),kt=()=>ja("ui-config");var fd="vk_player_debug_panel_opened";var Ph="videoplayer",Ah="videoplayer";var rs={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Mh=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Lh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Vh=new Set(["ShiftRight","ShiftLeft"]);var Rh=["TIMELINE"],md=[...Rh,"GRAPH_BUTTON"],sf=[...Rh,"PLAY_BUTTON"],vd=[...md,"PLAY_BUTTON"];var Hr=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(Hr||{}),ua={xs:0,s:1,m:2,l:3,xl:4};var gd=require("@vkontakte/videoplayer-shared/es2018"),Nh=require("@vkontakte/videoplayer-core/es2018"),Oh=require("@vkontakte/videoplayer-statistics/es2018");var ou="prod",pa="1.1.72-dev.c0dc5218.0";var fa=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Bh=Symbol("storeContext"),Dh=Symbol("microStoresContext"),Hh=(t,e)=>{Ya(Bh,t),Ya(Dh,e),ou==="dev"&&(window.app={store:t,microStores:e})},Ee=()=>{let t=ja(Bh);return(0,gd.assertNonNullable)(t,"Store context is empty!"),t},ho=()=>{let t=ja(Dh);return(0,gd.assertNonNullable)(t,"MicroStores context is empty!"),t},ti=(t,e)=>ru(t,t.getValue(),e),ru=(t,e,i)=>_r(e,o=>{let n=t.subscribe(s=>{o(s),i==null||i(s)});return()=>n.unsubscribe()}),Fh=(t,e,i,o)=>{var R,Y,H,F,W,J,G,ce;let n=t.info,{width:s,height:l}=xe(i.ui.playerSize),d=(Y=(R=n.throughputEstimation$.getValue())==null?void 0:R.toFixed(0))!=null?Y:0,a=(F=(H=n.rttEstimation$.getValue())==null?void 0:H.toFixed(0))!=null?F:0,p=n.isAutoQualityEnabled$.getValue()?"auto":"manual",f=`${pa} (core: ${Nh.VERSION}, stat: ${Oh.VERSION}, shared: ${gd.VERSION})`,v=xe(i.state.errorLog$),u=v.length?`
|
|
44
|
+
\r\f\xA0\v\uFEFF`];function sh(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var s=n.length,l=0;(l=o.indexOf(n,l))>=0;){var d=l+s;(l===0||nh.includes(o[l-1]))&&(d===o.length||nh.includes(o[d]))?o=(l===0?"":o.substring(0,l))+o.substring(d+1):l=d}}return o===""?null:o}function rh(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var s=t[n];s!=null&&s!==""&&(o+=" "+n+": "+s+i)}return o}function jp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ah(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,l=0,d=!1,a=[];o&&a.push(...Object.keys(o).map(jp)),n&&a.push(...Object.keys(n).map(jp));var p=0,f=-1;let x=t.length;for(var v=0;v<x;v++){var u=t[v];if(d?u==="/"&&t[v-1]==="*"&&(d=!1):s?s===u&&(s=!1):u==="/"&&t[v+1]==="*"?d=!0:u==='"'||u==="'"?s=u:u==="("?l++:u===")"&&l--,!d&&s===!1&&l===0){if(u===":"&&f===-1)f=v;else if(u===";"||v===x-1){if(f!==-1){var y=jp(t.substring(p,f).trim());if(!a.includes(y)){u!==";"&&v++;var w=t.substring(p,v).trim();i+=" "+w+";"}}p=v+1,f=-1}}}}return o&&(i+=rh(o)),n&&(i+=rh(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ee(t,e,i,o,n,s){var l=t.__className;if(Je||l!==i||l===void 0){var d=sh(i,o,s);(!Je||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(s&&n!==s)for(var a in s){var p=!!s[a];(n==null||p!==!!n[a])&&t.classList.toggle(a,p)}return s}function Yp(t,e={},i,o){for(var n in i){var s=i[n];e[n]!==s&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,s,o))}}function st(t,e,i,o){var n=t.__style;if(Je||n!==e){var s=ah(e,o);(!Je||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(Yp(t,i==null?void 0:i[0],o[0]),Yp(t,i==null?void 0:i[1],o[1],"important")):Yp(t,i,o));return o}function cd(t,e,i){if(t.multiple){if(e==null)return;if(!Zn(e))return Sg();for(var o of t.options)o.selected=e.includes(lh(o));return}for(o of t.options){var n=lh(o);if(xp(n,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Zp(t){var e=new MutationObserver(()=>{cd(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),zo(()=>{e.disconnect()})}function lh(t){return"__value"in t?t.__value:t.value}var ll=Symbol("class"),dl=Symbol("style"),uh=Symbol("is custom element"),ph=Symbol("is html");function fh(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Fe(t,e,i,o){var n=vh(t);if(Je&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||O_(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[ig]=i),i==null?t.removeAttribute(e):typeof i!="string"&&gh(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function mh(t,e,i,o,n=!1){var k;var s=vh(t),l=s[uh],d=!s[ph];let a=Je&&l;a&&uo(!1);var p=e||{},f=t.tagName==="OPTION";for(var v in e)v in i||(i[v]=null);i.class?i.class=dd(i.class):(o||i[ll])&&(i.class=null),i[dl]&&((k=i.style)!=null||(i.style=null));var u=gh(t);for(let I in i){let R=i[I];if(f&&I==="value"&&R==null){t.value=t.__value="",p[I]=R;continue}if(I==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";ee(t,y,R,o,e==null?void 0:e[ll],i[ll]),p[I]=R,p[ll]=i[ll];continue}if(I==="style"){st(t,R,e==null?void 0:e[dl],i[dl]),p[I]=R,p[dl]=i[dl];continue}var w=p[I];if(!(R===w&&!(R===void 0&&t.hasAttribute(I)))){p[I]=R;var x=I[0]+I[1];if(x!=="$$")if(x==="on"){let Y={},H="$$"+I,F=I.slice(2);var S=Kg(F);if(Wg(F)&&(F=F.slice(0,-7),Y.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(F,p[H],Y),p[H]=null}if(R!=null)if(S)t[`__${F}`]=R,dt([F]);else{let W=function(J){p[I].call(this,J)};var V=W;p[H]=Fp(F,t,W,Y)}else S&&(t[`__${F}`]=void 0)}else if(I==="style")Fe(t,I,R);else if(I==="autofocus")Dp(t,!!R);else if(!l&&(I==="__value"||I==="value"&&R!=null))t.value=t.__value=R;else if(I==="selected"&&f)fh(t,R);else{var T=I;d||(T=qg(T));var E=T==="defaultValue"||T==="defaultChecked";if(R==null&&!l&&!E)if(s[I]=null,T==="value"||T==="checked"){let Y=t,H=e===void 0;if(T==="value"){let F=Y.defaultValue;Y.removeAttribute(T),Y.defaultValue=F,Y.value=Y.__value=H?F:null}else{let F=Y.defaultChecked;Y.removeAttribute(T),Y.defaultChecked=F,Y.checked=H?F:!1}}else t.removeAttribute(I);else E||u.includes(T)&&(l||typeof R!="string")?t[T]=R:typeof R!="function"&&Fe(t,T,R,n)}}}return a&&uo(!0),p}function Pe(t,e,i=[],o,n=!1,s=Vr){let l=i.map(s);var d=void 0,a={},p=t.nodeName==="SELECT",f=!1;if(zi(()=>{var u=e(...l.map(r)),y=mh(t,d,u,o,n);f&&p&&"value"in u&&cd(t,u.value,!1);for(let x of Object.getOwnPropertySymbols(a))u[x]||Fi(a[x]);for(let x of Object.getOwnPropertySymbols(u)){var w=u[x];x.description===mp&&(!d||w!==d[x])&&(a[x]&&Fi(a[x]),a[x]=Mi(()=>gs(t,()=>w))),y[x]=w}d=y}),p){var v=t;Eo(()=>{cd(v,d.value),Zp(v)})}f=!0}function vh(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[uh]:t.nodeName.includes("-"),[ph]:t.namespaceURI===jv}}var dh=new Map;function gh(t){var e=dh.get(t.nodeName);if(e)return e;dh.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=kc(o);for(var s in i)i[s].set&&e.push(s);o=js(o)}return e}function O_(t,e,i){var o;Me&&(e==="srcset"&&B_(t,i)||Xp((o=t.getAttribute(e))!=null?o:"",i)||yg(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Xp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function ch(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function B_(t,e){var i=ch(t.srcset),o=ch(e);return o.length===i.length&&o.every(([n,s],l)=>s===i[l][1]&&(Xp(i[l][0],n)||Xp(n,i[l][0])))}var D_=Ic?()=>performance.now():()=>Date.now(),Br={tick:t=>(Ic?requestAnimationFrame:de)(t),now:()=>D_(),tasks:new Set};function hh(){let t=Br.now();Br.tasks.forEach(e=>{e.c(t)||(Br.tasks.delete(e),e.f())}),Br.tasks.size!==0&&Br.tick(hh)}function _h(t){let e;return Br.tasks.size===0&&Br.tick(hh),{promise:new Promise(i=>{Br.tasks.add(e={c:t,f:i})}),abort(){Br.tasks.delete(e)}}}function Xc(t,e){rd(()=>{t.dispatchEvent(new CustomEvent(e))})}function z_(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function bh(t){let e={},i=t.split(";");for(let o of i){let[n,s]=o.split(":");if(!n||s===void 0)break;let l=z_(n.trim());e[l]=s.trim()}return e}var W_=t=>t;function ef(t,e,i,o){var V;var n=(t&1)!==0,s=(t&2)!==0,l=n&&s,d=(t&4)!==0,a=l?"both":n?"in":"out",p,f=e.inert,v=e.style.overflow,u,y;function w(){var R;var k=Et,I=_t;Hi(null),co(null);try{return p!=null?p:p=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:a})}finally{Hi(k),co(I)}}var x={is_global:d,in(){var k;if(e.inert=f,!n){y==null||y.abort(),(k=y==null?void 0:y.reset)==null||k.call(y);return}s||u==null||u.abort(),Xc(e,"introstart"),u=Jp(e,w(),y,1,()=>{Xc(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=v})},out(k){if(!s){k==null||k(),p=void 0;return}e.inert=!0,Xc(e,"outrostart"),y=Jp(e,w(),u,0,()=>{Xc(e,"outroend"),k==null||k()})},stop:()=>{u==null||u.abort(),y==null||y.abort()}},S=_t;if(((V=S.transitions)!=null?V:S.transitions=[]).push(x),n&&sd){var T=d;if(!T){for(var E=S.parent;E&&(E.f&65536)!==0;)for(;(E=E.parent)&&(E.f&16)===0;);T=!E||(E.f&32768)!==0}T&&Eo(()=>{wt(()=>x.in())})}}function Jp(t,e,i,o,n){var s=o===1;if(ks(e)){var l,d=!1;return bn(()=>{if(!d){var S=e({direction:s?"in":"out"});l=Jp(t,S,i,o,n)}}),{abort:()=>{d=!0,l==null||l.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:de,deactivate:de,reset:de,t:()=>o};let{delay:a=0,css:p,tick:f,easing:v=W_}=e;var u=[];if(s&&i===void 0&&(f&&f(0,1),p)){var y=bh(p(0,1));u.push(y,y)}var w=()=>1-o,x=t.animate(u,{duration:a,fill:"forwards"});return x.onfinish=()=>{var F;x.cancel();var S=(F=i==null?void 0:i.t())!=null?F:1-o;i==null||i.abort();var T=o-S,E=e.duration*Math.abs(T),V=[];if(E>0){var k=!1;if(p)for(var I=Math.ceil(E/16.666666666666668),R=0;R<=I;R+=1){var Y=S+T*v(R/I),H=bh(p(Y,1-Y));V.push(H),k||(k=H.overflow==="hidden")}k&&(t.style.overflow="hidden"),w=()=>{var W=x.currentTime;return S+T*v(W/E)},f&&_h(()=>{if(x.playState!=="running")return!1;var W=w();return f(W,1-W),!0})}x=t.animate(V,{duration:E,fill:"forwards"}),x.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{x&&(x.cancel(),x.effect=null,x.onfinish=de)},deactivate:()=>{n=de},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var Vs,cl,ud,eu,$h,tu=class tu{constructor(e){Ts(this,eu);Ts(this,Vs,new WeakMap);Ts(this,cl);Ts(this,ud);za(this,ud,e)}observe(e,i){var o=Ai(this,Vs).get(e)||new Set;return o.add(i),Ai(this,Vs).set(e,o),Qv(this,eu,$h).call(this).observe(e,Ai(this,ud)),()=>{var n=Ai(this,Vs).get(e);n.delete(i),n.size===0&&(Ai(this,Vs).delete(e),Ai(this,cl).unobserve(e))}}};Vs=new WeakMap,cl=new WeakMap,ud=new WeakMap,eu=new WeakSet,$h=function(){var e;return(e=Ai(this,cl))!=null?e:za(this,cl,new ResizeObserver(i=>{for(var o of i){tu.entries.set(o.target,o);for(var n of Ai(this,Vs).get(o.target)||[])n(o)}}))},Yn(tu,"entries",new WeakMap);var tf=tu;var K_=new tf({box:"border-box"});function nr(t,e,i){var o=K_.observe(t,()=>i(t[e]));Eo(()=>(wt(()=>i(t[e])),o))}function yh(t,e){return t===e||(t==null?void 0:t[Uo])===e}function ot(t={},e,i,o){return Eo(()=>{var n,s;return Qo(()=>{n=s,s=(o==null?void 0:o())||[],wt(()=>{t!==i(...s)&&(e(t,...s),n&&yh(i(...n),t)&&e(null,...n))})}),()=>{bn(()=>{s&&yh(i(...s),t)&&e(null,...s)})}}),t}function Dr(t=!1){let e=Nt,i=e.l.u;if(!i)return;let o=()=>Gc(e.s);if(t){let n=0,s={},l=Vr(()=>{let d=!1,a=e.s;for(let p in a)a[p]!==s[p]&&(s[p]=a[p],d=!0);return d&&n++,n});o=()=>r(l)}i.b.length&&Jl(()=>{xh(e,o),Ps(i.b)}),Ke(()=>{let n=wt(()=>i.m.map(tg));return()=>{for(let s of n)typeof s=="function"&&s()}}),i.a.length&&Ke(()=>{xh(e,o),Ps(i.a)})}function xh(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}function pd(t,e,i){if(t==null)return e(void 0),i&&i(void 0),de;let o=wt(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var ul=[];function _r(t,e){return{subscribe:se(t,e).subscribe}}function se(t,e=de){let i=null,o=new Set;function n(d){if(qa(t,d)&&(t=d,i)){let a=!ul.length;for(let p of o)p[1](),ul.push(p,t);if(a){for(let p=0;p<ul.length;p+=2)ul[p][0](ul[p+1]);ul.length=0}}}function s(d){n(d(t))}function l(d,a=de){let p=[d,a];return o.add(p),o.size===1&&(i=e(n,s)||de),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:s,subscribe:l}}function Si(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let s=e.length<2;return _r(i,(l,d)=>{let a=!1,p=[],f=0,v=de,u=()=>{if(f)return;v();let w=e(o?p[0]:p,l,d);s?l(w):v=typeof w=="function"?w:de},y=n.map((w,x)=>pd(w,S=>{p[x]=S,f&=~(1<<x),a&&u()},()=>{f|=1<<x}));return a=!0,u(),function(){Ps(y),v(),a=!1}})}function xe(t){let e;return pd(t,i=>e=i)(),e}var iu=!1,of=Symbol();function C(t,e,i){var s;let o=(s=i[e])!=null?s:i[e]={store:null,source:is(void 0),unsubscribe:de};if(o.store!==t&&!(of in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=de;else{var n=!0;o.unsubscribe=pd(t,l=>{n?o.source.v=l:O(o.source,l)}),n=!1}return t&&of in i?xe(t):r(o.source)}function He(){let t={};function e(){zo(()=>{for(var i in t)t[i].unsubscribe();lo(t,of,{enumerable:!1,value:!0})})}return[t,e]}function nf(t){var e=iu;try{return iu=!1,[t(),iu]}finally{iu=e}}var X_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Me&&pg(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Ne(t,e,i){return new Proxy(Me?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},X_)}var J_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ks(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];ks(n)&&(n=n());let s=en(n,e);if(s&&s.set)return s.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ks(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=en(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Uo||e===Wa)return!1;for(let i of t.props)if(ks(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(ks(i)&&(i=i()),!!i){for(let o in i)e.includes(o)||e.push(o);for(let o of Object.getOwnPropertySymbols(i))e.includes(o)||e.push(o)}return e}};function hs(...t){return new Proxy({props:t},J_)}function wh(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function m(t,e,i,o){var Y,H;var n=(i&1)!==0,s=!Jr||(i&2)!==0,l=(i&8)!==0,d=(i&16)!==0,a=!1,p;l?[p,a]=nf(()=>t[e]):p=t[e];var f=Uo in t||Wa in t,v=l&&((H=(Y=en(t,e))==null?void 0:Y.set)!=null?H:f&&e in t&&(F=>t[e]=F))||void 0,u=o,y=!0,w=!1,x=()=>(w=!0,y&&(y=!1,d?u=wt(o):u=o),u);p===void 0&&o!==void 0&&(v&&s&&ug(e),p=x(),v&&v(p));var S;if(s)S=()=>{var F=t[e];return F===void 0?x():(y=!0,w=!1,F)};else{var T=(n?Vr:Rr)(()=>t[e]);T.f|=131072,S=()=>{var F=r(T);return F!==void 0&&(u=void 0),F===void 0?u:F}}if((i&4)===0&&s)return S;if(v){var E=t.$$legacy;return function(F,W){return arguments.length>0?((!s||!W||E||a)&&v(W?S():F),F):S()}}var V=!1,k=!1,I=is(p),R=Vr(()=>{var F=S(),W=r(I);return V?(V=!1,k=!0,W):(k=!1,I.v=F)});return l&&r(R),n||(R.equals=Qa),function(F,W){if(qc!==null&&(V=k,S(),r(I)),arguments.length>0){let J=W?r(R):s&&l?ni(F):F;if(!R.equals(J)){if(V=!0,O(I,J),w&&u!==void 0&&(u=J),wh(R))return F;wt(()=>r(R))}return F}return wh(R)?R.v:r(R)}}var eb;typeof HTMLElement=="function"&&(eb=class extends HTMLElement{constructor(e,i,o){super();Yn(this,"$$ctor");Yn(this,"$$s");Yn(this,"$$c");Yn(this,"$$cn",!1);Yn(this,"$$d",{});Yn(this,"$$r",!1);Yn(this,"$$p_d",{});Yn(this,"$$l",{});Yn(this,"$$l_u",new Map);Yn(this,"$$me");this.$$ctor=e,this.$$s=i,o&&this.attachShadow({mode:"open"})}addEventListener(e,i,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(i),this.$$c){let n=this.$$c.$on(e,i);this.$$l_u.set(i,n)}super.addEventListener(e,i,o)}removeEventListener(e,i,o){if(super.removeEventListener(e,i,o),this.$$c){let n=this.$$l_u.get(i);n&&(n(),this.$$l_u.delete(i))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(s){return l=>{let d=document.createElement("slot");s!=="default"&&(d.name=s),$(l,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=tb(this);for(let s of this.$$s)s in n&&(s==="default"&&!this.$$d.children?(this.$$d.children=i(s),o.default=!0):o[s]=i(s));for(let s of this.attributes){let l=this.$$g_p(s.name);l in this.$$d||(this.$$d[l]=rf(l,s.value,this.$$p_d,"toProp"))}for(let s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=th({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=Uc(()=>{Qo(()=>{var s;this.$$r=!0;for(let l of vp(this.$$c)){if(!((s=this.$$p_d[l])!=null&&s.reflect))continue;this.$$d[l]=this.$$c[l];let d=rf(l,this.$$d[l],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,d)}this.$$r=!1})});for(let s in this.$$l)for(let l of this.$$l[s]){let d=this.$$c.$on(s,l);this.$$l_u.set(l,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=rf(e,o,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return vp(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function rf(t,e,i,o){var s;let n=(s=i[t])==null?void 0:s.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function tb(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Sh="5";var Ch,Th,Eh;typeof window!="undefined"&&((Eh=(Th=(Ch=window.__svelte)!=null?Ch:window.__svelte={}).v)!=null?Eh:Th.v=new Set).add(Sh);var Al=require("@vkontakte/videoplayer-core/es2018"),Ij=require("@vkontakte/videoplayer-core/es2018"),Da=require("@vkontakte/videoplayer-shared/es2018"),T0=require("@vkontakte/videoplayer-statistics/es2018");var da=require("@vkontakte/videoplayer-shared/es2018");var ib={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:da.InterfaceLanguage.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:da.VideoQuality.Q_480P,highQualityLimit:da.VideoQuality.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,thinStatistics:!1,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,tracer:!1,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,interactiveControlsTapPlace:!1,interactiveControlsFillAnimation:!1,interactiveControlsHideAnimation:!1,interactiveHistoryEndChapterFix:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1,playbackStatusAnimationDuration:1e3,playbackStatusShow:!1,playbackStatusNextVideoShow:!1,playbackStatusNextVideoAnimationDuration:1e3,initSubtitles:!0,useCallbackForMediaSessionNextPrevClick:!1,usePerformanceFix:!1,userVideoPrefs:!1,savePreferredStatesOnUserActionOnly:!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,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1,usePuid:!0},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null,font:null,focusedOutlineWidth:null,focusedOutlineRadius:null,controlsDesktopPaddingHorizontal:null,timelinePaddingHorizontal:null,settingsBackgroundColor:null,controlsGradientHeight:null,controlsGradient:null},userSalt:"0"},Ih=t=>(0,da.fillWithDefault)(t,ib),kh=t=>Ya("ui-config",t),kt=()=>ja("ui-config");var fd="vk_player_debug_panel_opened";var Ph="videoplayer",Ah="videoplayer";var rs={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Mh=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Lh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Vh=new Set(["ShiftRight","ShiftLeft"]);var Rh=["TIMELINE"],md=[...Rh,"GRAPH_BUTTON"],sf=[...Rh,"PLAY_BUTTON"],vd=[...md,"PLAY_BUTTON"];var Hr=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(Hr||{}),ua={xs:0,s:1,m:2,l:3,xl:4};var gd=require("@vkontakte/videoplayer-shared/es2018"),Nh=require("@vkontakte/videoplayer-core/es2018"),Oh=require("@vkontakte/videoplayer-statistics/es2018");var ou="prod",pa="1.1.72";var fa=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Bh=Symbol("storeContext"),Dh=Symbol("microStoresContext"),Hh=(t,e)=>{Ya(Bh,t),Ya(Dh,e),ou==="dev"&&(window.app={store:t,microStores:e})},Ee=()=>{let t=ja(Bh);return(0,gd.assertNonNullable)(t,"Store context is empty!"),t},ho=()=>{let t=ja(Dh);return(0,gd.assertNonNullable)(t,"MicroStores context is empty!"),t},ti=(t,e)=>ru(t,t.getValue(),e),ru=(t,e,i)=>_r(e,o=>{let n=t.subscribe(s=>{o(s),i==null||i(s)});return()=>n.unsubscribe()}),Fh=(t,e,i,o)=>{var R,Y,H,F,W,J,G,ce;let n=t.info,{width:s,height:l}=xe(i.ui.playerSize),d=(Y=(R=n.throughputEstimation$.getValue())==null?void 0:R.toFixed(0))!=null?Y:0,a=(F=(H=n.rttEstimation$.getValue())==null?void 0:H.toFixed(0))!=null?F:0,p=n.isAutoQualityEnabled$.getValue()?"auto":"manual",f=`${pa} (core: ${Nh.VERSION}, stat: ${Oh.VERSION}, shared: ${gd.VERSION})`,v=xe(i.state.errorLog$),u=v.length?`
|
|
45
45
|
`+v.map((ie,ue)=>{var ne;let $e=`${ue}) Type: ${ie.id}
|
|
46
46
|
`,fe=`Message: ${ie.message} (${ie.thrown})
|
|
47
47
|
`,ke=`Trace: ${(ne=ie.thrown)==null?void 0:ne.stack}
|
|
@@ -386,4 +386,4 @@ Try switching the\xA0quality to\xA0Auto.`},u1=cb;var _s=new Map;_s.set(pl.Interf
|
|
|
386
386
|
/* css reset end */.hidden {visibility:hidden;opacity:0;}.out-of-flow {content-visibility:hidden !important;}.overlay-container {pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:var(--overlay-container-z-index);}
|
|
387
387
|
|
|
388
388
|
/* \u041A\u043B\u0430\u0441\u0441 \u0434\u043B\u044F \u0441\u043E\u043A\u0440\u044B\u0442\u0438\u0435 \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0430 \u0432\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u043E \u043D\u043E \u043D\u0435 \u0434\u043B\u044F \u043E\u0431\u0445\u043E\u0434\u0430 \u043F\u043E \u0442\u0430\u0431 \u0438 \u0441\u043A\u0440\u0438\u043D \u0440\u0438\u0434\u0435\u0440\u0430 */.out-of-view {position:absolute !important;left:-1000vh !important;}.icon.icon-error-stub {display:flex;justify-content:center;align-items:center;}`};function Av(t,e){U(e,!0),q(t,Ux);let[i,o]=He(),n=()=>C(Xt,"$isLive$",i),s=()=>C(ut,"$availableSubtitlesList$",i),l=m(e,"sources",7),d=m(e,"store",7),a=m(e,"microStoresRoot",7),p=m(e,"videoConfig",7),f=m(e,"uiConfig",7),v=m(e,"title",7),u=m(e,"thumbUrl",7),y=m(e,"interactiveContainer",7),w=m(e,"interactiveController",7),x=m(e,"subtitles",7),S=m(e,"live",7),T=m(e,"preload",7),E=m(e,"autoplay",7),V=m(e,"volume",7,void 0),k=m(e,"muted",7,void 0),I=m(e,"fromTime",7),R=m(e,"canRewindLive",7),Y=m(e,"showAds",7),H=m(e,"adsSlotId",7,void 0),F=m(e,"adsParams",7,void 0),W=m(e,"adsPreviewParam",7,void 0),J=m(e,"adsAutoplayParam",7,void 0),G=m(e,"duration",7,void 0),ce=m(e,"logoClickable",7),ie=m(e,"logoHidden",7),ue=m(e,"isMobile",7),$e=m(e,"showNextPrevButtons",7,!1),fe=m(e,"nextButtonActive",7,!1),ke=m(e,"prevButtonActive",7,!1),ne=m(e,"endScreenVideoTitle",7,void 0),Ve=m(e,"endScreenVideoThumb",7,void 0),re=m(e,"isOneVideoPlaylist",7,!1),N=m(e,"supportLink",7),Be=m(e,"shadowRootContainer",7),le=m(e,"outerContainerRef",7),ve=m(e,"fullScreenTarget",7,void 0),te=m(e,"failoverHosts",7,void 0),me=m(e,"showMiniTimer",7,!1),De=m(e,"saveRate",7),pe=m(e,"seekToInteractive",7,Da.noop),at=m(e,"playPrevChapter",7,Da.noop),Z=m(e,"volumeMultiplier",7),Ae=m(e,"showAutoplayNext",7),Ie=m(e,"showEndScreen",7,!0),ze=m(e,"keyboardControls",15,void 0),{subscribers:lt,stores:vt}=a();kh(f());let gt=kt(),Ct=f().logoLink,Ge=d().ui.debugPanelVisible,Ht=d().ui.playerSize,Xt=d().state.isLive$,Wt=d().state.isInteractive&&Al.clientChecker.device.isAndroid,oe=j(void 0),Ft=null,he=j(!1);d().getAdmanWrapper().init({switchFromAdsToVideo:d().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:d().actions.internal.switchFromVideoToAds,setMuted:d().actions.external.setMuted},d().ads,{vsid:d().vsid}),Hh(d(),vt),Ke(()=>{var D,Ue;d().ui.isMobile.set(ue()),(Ue=(D=p().callbacks)==null?void 0:D.onDomReady)==null||Ue.call(D)});let we=(D=!1)=>{O(he,!0),D?d().actions.external.firstStart(Y()):d().actions.internal.firstStart(Y())},ae=()=>{if(gt.features.qualityDetailsSubMenuEnabled){let D=a1(d().videoId);if(D)switch(D.type){case"high_quality":d().actions.internal.setHighQualityEnabled(!0,D.appliesTo);break;case"traffic_saving":d().actions.internal.setTrafficSavingEnabled(!0,D.appliesTo);break;case"exact_quality":d().actions.internal.setQuality(D.quality);break}}else{l1(d().videoId),hf()&&d().actions.internal.setTrafficSavingEnabled(!0);let Ue=ff(d().videoId);Ue&&d().actions.internal.setQuality(Ue)}};function Re(D){var ai,li,bo;let Ue=l()||D;Ue&&d().initVideo({container:r(oe),sources:Ue,failoverHosts:te(),subtitles:x(),volumeMultiplier:Z()});let pt=Da.safeStorage.get(fd)==="true";Ge.set(pt),I()>0&&d().actions.external.seekTime(I());let Ut=ue()?gt.volumeDefault:(li=(ai=V())!=null?ai:su())!=null?li:gt.volumeDefault,ct=(bo=k())!=null?bo:t1();if(d().actions.external.setVolume(Ut),d().actions.external.setMuted(ct),d().getAdmanWrapper().setInitialVolume(ct?0:Ut),ae(),gt.features.saveRate&&De()){let di=n1();di&&!n()&&d().actions.internal.setPlaybackRate(di)}if(Ae()){let di=s1();di&&d().actions.internal.setAutoplayNextEnabled(di)}d().ui.isAutoplay.set(E()),E()&&we(),T()&>.features.preload&&d().actions.internal.preload()}let qe=D=>{if(window.ResizeObserver){let Ue,pt;Ft=new ResizeObserver((0,Da.throttleFn)(Ut=>{let ct=Ut[0];if(ct.contentBoxSize){let ai=Array.isArray(ct.contentBoxSize)?ct.contentBoxSize[0]:ct.contentBoxSize;Ue=ai.inlineSize,pt=ai.blockSize}else ct.contentRect&&(Ue=ct.contentRect.width,pt=ct.contentRect.height);Ht.set({width:Ue,height:pt})},300)),Ft.observe(D)}Ht.set({width:D.clientWidth,height:D.clientHeight})},Le=()=>{document.hidden&&d().actions.external.stop()};Mt(()=>{var pt,Ut,ct,ai;Wt&&document.addEventListener("visibilitychange",Le),gt.debugLog&&d().actions.internal.startLogging(),qe(r(oe));let D=lt.map(li=>li.init({store:d(),microStores:vt,config:p(),interactiveController:w(),uiConfig:f()})),Ue=()=>{Wt&&document.removeEventListener("visibilitychange",Le),Ft==null||Ft.disconnect(),D.forEach(li=>li.unsubscribe()),d().destroy()};return((pt=S())==null?void 0:pt.status)==="upcoming"?(d().actions.internal.setLiveWaitingStart(!0),Ue):((Ut=S())==null?void 0:Ut.status)==="waiting"?(d().actions.internal.setLiveWaitingRecover(!0),Ue):(((ct=S())==null?void 0:ct.status)==="finished"||((ai=S())==null?void 0:ai.status)==="postlive")&&!(l()&&(0,Al.areValidLiveRecordSources)(l()))?(d().actions.internal.setLiveWaitingRecord(!0),Ue):(Re(),Ue)});function Ye(){r(he)?d().actions.external.play():we(!0)}function Oe(){d().actions.external.pause()}function et(D){d().actions.external.setMuted(D)}function Lt(){d().actions.external.toggleSubtitle()}function Kt(D,Ue){d().actions.external.changeSubtitle(D,Ue)}function tt(){var D;(D=d().webApi.slotsApi)!=null&&D.haveSlots()&&d().actions.external.hideControls()}function xi(){var D;(D=d().webApi.slotsApi)!=null&&D.haveSlots()&&d().actions.external.showControls()}function hi(D){ue()||D>=0&&D<=1&&d().actions.external.setVolume(D)}function it(D){d().actions.internal.seekTime(D,T0.SeekAction.UNKNOWN)}function ii(D){d().actions.external.seekEpisodeStartTime(D)}function jt(){d().actions.external.returnFocusToEpisodes()}function _i(D){d().actions.external.setPlaybackRate(D)}function Mo(D){d().actions.external.setAutoQualityLimits(D)}function _o(){d().actions.external.setQuality("auto")}function Dt(D){d().actions.external.setTrafficSavingEnabled(D)}function ri(D){d().actions.external.setHighQualityEnabled(D)}let sn=qu(gt.view),Pt=p().playerView==="preview",ut=d().state.availableSubtitlesList$;if(gt.features.initSubtitles){let D=!1;Ke(()=>{if(!D&&s().length){D=!0;let Ue;if(gt.features.userVideoPrefs&&d().videoId){let Ut=cu(gt.userSalt,String(d().videoId));Ut!=null&&Ut.subtitleTrackId&&(Ue=s().find(ct=>ct.value===Ut.subtitleTrackId))}let pt=bf();pt&&(Ue!=null||(Ue=s().find(Ut=>Ut.language===pt))),d().actions.internal.setSubtitle(Ue)}})}var bi=Fx();let Lo;var Wi=_(bi);{var oi=D=>{kv(D,{get store(){return d()},get uiConfig(){return gt},get thumbUrl(){return u()},get interactiveContainer(){return y()},get live(){return S()},get autoplay(){return E()},get canRewindLive(){return R()},get showAds(){return Y()},get adsSlotId(){return H()},get adsParams(){return F()},get adsPreviewParam(){return W()},get adsAutoplayParam(){return J()},get duration(){return G()},get logoClickable(){return ce()},get logoHidden(){return ie()},get logoTargetUrl(){return Ct},get nextButtonActive(){return fe()},get prevButtonActive(){return ke()},get endScreenVideoTitle(){return ne()},get endScreenVideoThumb(){return Ve()},get isOneVideoPlaylist(){return re()},get supportLink(){return N()},get shadowRootContainer(){return Be()},get outerContainerRef(){return le()},get fullScreenTarget(){return ve()},get showMiniTimer(){return me()},get playerStarted(){return r(he)},get seekToInteractive(){return pe()},get playPrevChapter(){return at()},firstStart:we,seekTime:it,get showEndScreen(){return Ie()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return $e()},get videoContainer(){return r(oe)},set videoContainer(Ue){O(oe,Ue,!0)}})},Go=D=>{var Ue=We(),pt=ge(Ue);{var Ut=ai=>{Pv(ai,{get thumbUrl(){return u()},get outsideDuration(){return G()},get canRewindLive(){return R()},get videoContainer(){return r(oe)},set videoContainer(li){O(oe,li,!0)}})},ct=ai=>{Ev(ai,{get store(){return d()},get uiConfig(){return gt},get title(){return v()},get thumbUrl(){return u()},get interactiveContainer(){return y()},get live(){return S()},get autoplay(){return E()},get canRewindLive(){return R()},get showAds(){return Y()},get adsSlotId(){return H()},get adsParams(){return F()},get adsPreviewParam(){return W()},get adsAutoplayParam(){return J()},get duration(){return G()},get logoClickable(){return ce()},get logoHidden(){return ie()},get logoTargetUrl(){return Ct},get nextButtonActive(){return fe()},get prevButtonActive(){return ke()},get endScreenVideoTitle(){return ne()},get endScreenVideoThumb(){return Ve()},get isOneVideoPlaylist(){return re()},get supportLink(){return N()},get shadowRootContainer(){return Be()},get outerContainerRef(){return le()},get fullScreenTarget(){return ve()},get showMiniTimer(){return me()},get playerStarted(){return r(he)},get seekToInteractive(){return pe()},get playPrevChapter(){return at()},firstStart:we,get showEndScreen(){return Ie()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return $e()},get videoContainer(){return r(oe)},set videoContainer(li){O(oe,li,!0)},get keyboardControls(){return ze()},set keyboardControls(li){ze(li)}})};L(pt,ai=>{Pt?ai(Ut):ai(ct,!1)})}$(D,Ue)};L(Wi,D=>{ue()?D(oi):D(Go,!1)})}h(bi),B(D=>{Lo=ee(bi,1,"root svelte-16kg8zb",null,Lo,D),st(bi,sn)},[()=>({"root--miui-browser":Al.clientChecker.device.isMobile&&Al.clientChecker.browser.isMiuiBrowser,"visible-outside":Pt})]),$(t,bi);var Fn=z({initVideo:Re,play:Ye,pause:Oe,setMuted:et,toggleSubtitle:Lt,changeSubtitle:Kt,hideControls:tt,showControls:xi,setVolume:hi,seekTime:it,seekEpisodeStartTime:ii,returnFocusToEpisodes:jt,setPlaybackRate:_i,setAutoQualityLimits:Mo,setAutoQuality:_o,toggleTrafficSaving:Dt,toggleHighQuality:ri,get sources(){return l()},set sources(D){l(D)},get store(){return d()},set store(D){d(D)},get microStoresRoot(){return a()},set microStoresRoot(D){a(D)},get videoConfig(){return p()},set videoConfig(D){p(D)},get uiConfig(){return f()},set uiConfig(D){f(D)},get title(){return v()},set title(D){v(D)},get thumbUrl(){return u()},set thumbUrl(D){u(D)},get interactiveContainer(){return y()},set interactiveContainer(D){y(D)},get interactiveController(){return w()},set interactiveController(D){w(D)},get subtitles(){return x()},set subtitles(D){x(D)},get live(){return S()},set live(D){S(D)},get preload(){return T()},set preload(D){T(D)},get autoplay(){return E()},set autoplay(D){E(D)},get volume(){return V()},set volume(D){V(D)},get muted(){return k()},set muted(D){k(D)},get fromTime(){return I()},set fromTime(D){I(D)},get canRewindLive(){return R()},set canRewindLive(D){R(D)},get showAds(){return Y()},set showAds(D){Y(D)},get adsSlotId(){return H()},set adsSlotId(D){H(D)},get adsParams(){return F()},set adsParams(D){F(D)},get adsPreviewParam(){return W()},set adsPreviewParam(D){W(D)},get adsAutoplayParam(){return J()},set adsAutoplayParam(D){J(D)},get duration(){return G()},set duration(D){G(D)},get logoClickable(){return ce()},set logoClickable(D){ce(D)},get logoHidden(){return ie()},set logoHidden(D){ie(D)},get isMobile(){return ue()},set isMobile(D){ue(D)},get showNextPrevButtons(){return $e()},set showNextPrevButtons(D){$e(D)},get nextButtonActive(){return fe()},set nextButtonActive(D){fe(D)},get prevButtonActive(){return ke()},set prevButtonActive(D){ke(D)},get endScreenVideoTitle(){return ne()},set endScreenVideoTitle(D){ne(D)},get endScreenVideoThumb(){return Ve()},set endScreenVideoThumb(D){Ve(D)},get isOneVideoPlaylist(){return re()},set isOneVideoPlaylist(D){re(D)},get supportLink(){return N()},set supportLink(D){N(D)},get shadowRootContainer(){return Be()},set shadowRootContainer(D){Be(D)},get outerContainerRef(){return le()},set outerContainerRef(D){le(D)},get fullScreenTarget(){return ve()},set fullScreenTarget(D){ve(D)},get failoverHosts(){return te()},set failoverHosts(D){te(D)},get showMiniTimer(){return me()},set showMiniTimer(D){me(D)},get saveRate(){return De()},set saveRate(D){De(D)},get showAutoplayNext(){return Ae()},set showAutoplayNext(D){Ae(D)},get seekToInteractive(){return pe()},set seekToInteractive(D){pe(D)},get playPrevChapter(){return at()},set playPrevChapter(D){at(D)},get volumeMultiplier(){return Z()},set volumeMultiplier(D){Z(D)},get showEndScreen(){return Ie()},set showEndScreen(D){Ie(D)},get keyboardControls(){return ze()},set keyboardControls(D){ze(D)}});return o(),Fn}var zx=Te('<svg><!><path fill="currentColor" 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"></path></svg>');function Mv(t,e){let i=Ne(e,["$$slots","$$events","$$legacy","children"]);var o=zx();Pe(o,()=>({xmlns:"http://www.w3.org/2000/svg",width:"57",height:"60",fill:"none","aria-hidden":"true","data-testid":"stub-icon",role:"img",...i}));var n=_(o);ye(n,()=>{var s;return(s=e.children)!=null?s:de}),Ce(),h(o),$(t,o)}function Lv(t,e){let i=m(e,"isWhite",3,!1),o=g(()=>i()?"color: #fff;":"color: #909499;");Mv(t,{get style(){return r(o)}})}var Wx=M('<div class="title svelte-1y9fytq"> </div>'),Kx=M('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),qx={hash:"svelte-1y9fytq",code:".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 Vv(t,e){q(t,qx);var i=Kx(),o=_(i);{var n=d=>{var a=Wx(),p=_(a,!0);h(a),B(()=>be(p,e.title)),$(d,a)};L(o,d=>{e.title&&d(n)})}var s=P(o,2);{var l=d=>{let a=g(()=>!!e.thumbUrl);Lv(d,{get isWhite(){return r(a)}})};L(s,d=>{(!e.title||!e.thumbUrl)&&d(l)})}h(i),B(()=>st(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),$(t,i)}var Qx=M('<div class="playerError svelte-m5iv29"><!></div>'),Gx={hash:"svelte-m5iv29",code:".playerError.svelte-m5iv29 {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;}"};function Rv(t){q(t,Gx);var e=Qx(),i=_(e);La(i,{}),h(e),$(t,e)}var op=require("@vkontakte/videoplayer-shared/es2018"),Li=require("@vkontakte/videoplayer-shared/es2018"),gc=require("@vkontakte/videoplayer-core/es2018"),Ol=require("@vkontakte/videoplayer-statistics/es2018");var Gu=require("@vkontakte/videoplayer-shared/es2018"),Qu=class{constructor(){this.subscription=new Gu.Subscription,this.logger=new Gu.Logger,this.log=this.logger.createComponentLog("MediaSessionApi")}isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:o=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,artwork:[{src:o,sizes:"96x96",type:"image/png"},{src:o,sizes:"128x128",type:"image/png"},{src:o,sizes:"192x192",type:"image/png"},{src:o,sizes:"256x256",type:"image/png"},{src:o,sizes:"384x384",type:"image/png"},{src:o,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",null],["seekbackward",null],["seekforward",null]];this.setActionHandlers(e)}setActionHandlers(e){var i,o;if(this.isSupported())for(let[n,s]of e)try{(o=(i=navigator.mediaSession).setActionHandler)==null||o.call(i,n,s)}catch(l){throw new Error(`The media session action "${n}" is not supported yet.`)}}attachToStore(e){!this.isSupported()||!e||(this.clearSubscriptions(),this.subscription.add(e.state.positionExact$.subscribe(i=>{var s,l;let o=xe(e.state.currentPlaybackRate$),n=xe(e.state.duration$);if(!(!isFinite(i)||!isFinite(n)))try{(l=(s=navigator.mediaSession).setPositionState)==null||l.call(s,{position:i,playbackRate:o,duration:n})}catch(d){this.log({message:`MediaSession setPositionState can't call with position: ${i} and duration: ${n}`})}})))}clearSubscriptions(){this.subscription.unsubscribe()}destroy(){this.resetActionHandlers(),this.clearSubscriptions()}};var Ll=require("@vkontakte/videoplayer-shared/es2018");var jx=Te('<svg><!><g fill="var(--btn-color, #fff)"><path 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"></path><path 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"></path></g></svg>');function Nv(t,e){let i=Ne(e,["$$slots","$$events","$$legacy","children"]);var o=jx();Pe(o,()=>({xmlns:"http://www.w3.org/2000/svg",width:"57",height:"56",fill:"none","aria-label":"dummy-image","data-testid":"pip-dummy-icon",role:"img",...i}));var n=_(o);ye(n,()=>{var s;return(s=e.children)!=null?s:de}),Ce(),h(o),$(t,o)}var Yx=M('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),Zx={hash:"svelte-1pbsod4",code:".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 Ov(t,e){U(e,!0),q(t,Zx);let[i,o]=He(),n=()=>C(p,"$interfaceLanguage$",i),s=()=>C(f,"$isMobile$",i),l=Ee(),d=kt(),a=!!l.webApi.pictureInPictureApi,p=l.interfaceLanguage$,f=l.ui.isMobile,v=l.ui.t,u=g(()=>n()&&v("pip_dummy_title")),y=qu(d.view);var w=Yx();let x;var S=_(w);let T;var E=_(S);Nv(E,{}),h(S);var V=P(S,2),k=_(V,!0);h(V),h(w),B((I,R)=>{x=ee(w,1,"player-pip-dummy svelte-1pbsod4",null,x,I),st(w,y),T=ee(S,1,"dummy-image svelte-1pbsod4",null,T,R),be(k,r(u))},[()=>({"is-pip-api":a}),()=>({desktop:!s()})]),$(t,w),z(),o()}var Xx=Object.defineProperty,Jx=(t,e,i)=>e in t?Xx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ml=(t,e,i)=>Jx(t,typeof e!="symbol"?e+"":e,i),e5=460,t5=280,ac=class{constructor({enabled:e=!0}={enabled:!0}){Ml(this,"playerDomElement"),Ml(this,"playerParentShadowRoot"),Ml(this,"playerDummyElement"),Ml(this,"svelteContext"),Ml(this,"pipWindow"),Ml(this,"info",{isActive$:new Ll.ValueSubject(!1),isEnabled$:new Ll.ValueSubject(!1),type:1}),this.info.isEnabled$=new Ll.ValueSubject(e)}isSupported(){let{isEmbed:e}=(0,Ll.detectEmbed)();return"documentPictureInPicture"in window&&!e}isActive(){return this.info.isActive$.getValue()}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:e5,height:t5,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let o=[...this.playerParentShadowRoot.styleSheets].map(a=>[...a.cssRules].map(p=>p.cssText).join(" ")).filter(Boolean).join(`
|
|
389
|
-
`),n=document.createElement("style");n.textContent=o;let s=this.createStretchedContainer(),l=s.attachShadow({mode:"open"});l.append(n),l.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=ns(Ov,d),(e=this.pipWindow)==null||e.document.body.append(s),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(sa(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1),this.pipWindow=void 0)})}async exit(){return new Promise(e=>{var i;this.pipWindow&&((i=documentPictureInPicture.window)==null||i.close()),e()})}async dispose(){await this.exit()}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function E0(t){return t instanceof ac}var ju=class{static getLatestSupportedVersion(e){let i=new ga(e),o=new ac(e);if(o.isSupported())return o;if(i.isSupported())return i}};function lc(t,e){var n,s;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let l of i)o[l]=(s=(n=e[l])!=null?n:t[l])!=null?s:void 0;return o}var I0="Inner error. Unexpectedly root annotation container null reference exception",k0="Annotation with such name already exists",P0="Annotation with such name does not exist";var Vl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var Rl=require("@vkontakte/videoplayer-shared/es2018"),i5="1",o5=100,Yu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new Rl.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,Rl.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},o5);this.subscriptions.add((0,Rl.observeElementSize)(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var o;if(!this.rootAnnotationsContainer)throw new Vl(I0);if(this.annotations.has(e))throw new Vl(k0);i.style.zIndex=(o=i.style.zIndex)!=null?o:i5,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 Vl(P0);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(){var e;this.annotations.clear(),this.subscriptions.unsubscribe(),(e=this.mutationObserver)==null||e.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,s=e.offsetLeft,l=e.offsetWidth,d=e.offsetHeight;return n<0||s<0||s+l>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};var Ha=require("@vkontakte/videoplayer-shared/es2018"),rn=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,Ha.assertNonNullable)(e),(0,Ha.assertNonNullable)(i),(0,Ha.assertNonNullable)(n),n.interactiveData&&(0,Ha.assertNonNullable)(o),this.subscription=new Ha.Subscription,this.subscription}};var dc=class extends rn{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(s=>{this.state$.set(s?!0:null)})),o}};var cc=class extends rn{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:s}=i,{fakeIsPlaying$:l}=n,{isInteractiveExpectation$:d,isPlaying$:a}=s.state,{controlsVisible:p,isMobile:f}=s.ui,v=xe(f),u=()=>v&&xe(p);return o.add(p.subscribe(y=>{if(!v)return;let w=xe(l);xe(a)?this.state$.set(y):w!==null&&this.state$.set(!w||y)})),o.add(a.subscribe(y=>{this.state$.set(!y||u())})),o.add(l.subscribe(y=>{if(y===null)return;let w=xe(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!y)})),o}};var uc=class extends rn{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=se("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(s=>{s.length&&(s.every(l=>l.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};var A0=require("@vkontakte/videoplayer-shared/es2018"),Bv=se(!1),Zu=null,pc=class extends rn{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Bv,set:(i,o=!1)=>{i!==xe(Bv)&&(this.clearTimeout(),Bv.set(i),!i&&Zu&&(Zu=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:s}=i,{isInteractiveTime$:l,isPlaying$:d}=n.state,a=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(a.subscribe(v=>{xe(l)&&v&&this.state$.set(!1)}));let f=(s==null?void 0:s.interactiveData)||{tooltipHelpHintActive:!1};return o.add((0,A0.combine)({isPlaying$:d,isInteractiveTime$:l,interactiveTimeIndicator:p}).subscribe(({isPlaying$:v,isInteractiveTime$:u,interactiveTimeIndicator:y})=>{var w,x;if(!(!v||!(y!=null&&y.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&Zu===null&&(Zu=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(x=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||x.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var Xu=require("@vkontakte/videoplayer-shared/es2018");var fc=class extends rn{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...se(null),toggle:Xu.noop};this.checkIfShouldHide=i=>Us(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:s}=i,l=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(xe(l)))return;let a=xe(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:v}=n.ui.controls,u=xe(p),y=xe(f);if(a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1),v.remove(sf),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await(s==null?void 0:s.toggleGraphView(!0)),this.state$.set(!0),v.add(sf),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add((0,Xu.combine)({graphIsOpened:this.state$,currentGridType:l}).subscribe(async({graphIsOpened:a,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1)}catch(v){d({message:"Cant hide graph"})}})),o}};var Dv=require("@vkontakte/videoplayer-shared/es2018"),mc=class extends rn{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:se(!1),isEnabled$:se(!1),type$:se(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:s,isEnabled$:l,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new Dv.ValueSubject(!1),isEnabled$:new Dv.ValueSubject(!1)}};return o.add(s.subscribe(a=>{this.state$.isActive$.set(a)})),o.add(l.subscribe(a=>{this.state$.isEnabled$.set(a)})),this.state$.type$.set(d),o}};var ep=require("@vkontakte/videoplayer-shared/es2018");var Ju=require("@vkontakte/videoplayer-shared/es2018"),M0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?n5({maxCount:t}):void 0,e!==0?r5({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},n5=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,Ju.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify((n=e[i])!=null?n:0))},canShowNotification:i=>{var o;return((o=e[i])!=null?o:0)<t}}},r5=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Ju.safeStorage.get(e)||"{}")}catch(s){return{}}},o=s=>Ju.safeStorage.set(e,JSON.stringify(s)),n=s=>{let l=i();delete l[s],o(l)};return{notificationShowed:s=>{o({...i(),[s]:{timeout:t,launchTime:Date.now()}})},canShowNotification:s=>{let l=i()[s];if(l){let d=Date.now()-l.launchTime>t;return d&&n(s),d}else return!0}}};var vc=class extends rn{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:se({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:s,timeoutShowSlowVideoNotification:l,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:a}}}=i;this.notificationManager=M0({maxShowCount:s,timeout:l});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe((0,ep.filterChanged)(),(0,ep.filter)(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(a&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var L0=()=>[dc,cc,uc,pc,fc,mc,vc].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var Nl=require("@vkontakte/videoplayer-shared/es2018");var tp=class{constructor(e){this.shadowRoot=e;this.lastFocusedNode=null;this.init=()=>{this.shadowRoot.addEventListener("focusin",this.handleFocusChange)};this.handleFocusChange=()=>{this.lastFocusedNode=this.shadowRoot.activeElement};this.restoreFocus=()=>{var e;(e=this.lastFocusedNode)==null||e.focus()};this.init()}destroy(){this.shadowRoot.removeEventListener("focusin",this.handleFocusChange)}};var s5=Object.defineProperty,a5=(t,e,i)=>e in t?s5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Qt=(t,e,i)=>a5(t,typeof e!="symbol"?e+"":e,i),l5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Li.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,gc.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},Hn=j(void 0),ip=class extends HTMLElement{constructor(){super(),Qt(this,"svelteStubComponent"),Qt(this,"svelteRootComponent"),Qt(this,"svelteErrorComponent"),Qt(this,"store"),Qt(this,"microStoresRoot"),Qt(this,"statistics"),Qt(this,"sentry"),Qt(this,"_shadowRoot"),Qt(this,"playerContainer"),Qt(this,"rootContainer"),Qt(this,"shadowRootContainer"),Qt(this,"playerId"),Qt(this,"uiConfig"),Qt(this,"coreConfig"),Qt(this,"statisticsConfig"),Qt(this,"interactiveController"),Qt(this,"interactiveContainer"),Qt(this,"graphMadePause"),Qt(this,"currentPlayingVideoIndex",0),Qt(this,"needToRepeatPlaylist",!1),Qt(this,"videoConfig"),Qt(this,"pictureInPictureApi"),Qt(this,"mediaSessionApi"),Qt(this,"unsubscribePlayerPhaseSubscription"),Qt(this,"logger"),Qt(this,"log"),Qt(this,"subscription"),Qt(this,"interactiveSubscription"),Qt(this,"annotationsApi"),Qt(this,"slotsApi"),Qt(this,"focusManager"),Qt(this,"prevIsid"),Qt(this,"isInited",!1),Qt(this,"internalsExposure",null),Qt(this,"shadowDOMCallbacksDisabled",!1),Qt(this,"fatalError$",new op.ValueSubject(null)),Qt(this,"createOneStat",(e,i={})=>{var o,n,s,l;if(!this.videoConfig)return;let{albumId:d,statPlace:a,statUserSalt:p,statTrackCode:f,statVKAppId:v,refreshStatAuthToken:u,autoplay:y,isMobile:w,isTouch:x,refDomain:S,deviceId:T,interactiveData:E}=lc(this.videoConfig,i),V=(o=E==null?void 0:E.projectInfo)==null?void 0:o.pid,k=(s=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?s:!1;k&&(this.prevIsid=void 0);let{unitedVideoId:I,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&I)try{return new Ol.OneStat({movieId:I,albumId:d,place:a,trackCode:f,vkAppId:v,autoplay:(l=y&&!this.interactiveController)!=null?l:!1,mobile:x!=null?x:w,clip:R,refDomain:S,deviceId:T,isPreviewPlayerView:this.videoConfig.playerView==="preview",...V&&(!this.isInited||k)&&{projectId:Number(V)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}catch(H){console.error(H),this.log({message:H.message})}}),Nl.devNull.create("ui"),this.logger=new Li.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Li.Subscription,this.interactiveSubscription=new Li.Subscription,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=ns(Rv,{target:this.playerContainer}))})}connectedCallback(){var e,i;if(this.rootContainer)return;this.initPlayerRootContainers();let o=(e=this.getAttribute("stub-title"))!=null?e:void 0,n=(i=this.getAttribute("stub-thumb-url"))!=null?i:void 0,s=ni({title:o,thumbUrl:n}),l={target:this.playerContainer,props:s};this.svelteStubComponent=ns(Vv,l)}disconnectedCallback(){var e,i,o,n,s,l,d;this.shadowDOMCallbacksDisabled||((e=this.annotationsApi)==null||e.destroy(),(i=this.slotsApi)==null||i.destroy(),(o=this.focusManager)==null||o.destroy(),(n=this.mediaSessionApi)==null||n.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteErrorComponent),this.subscription.unsubscribe(),(s=this.unsubscribePlayerPhaseSubscription)==null||s.call(this),(l=this.interactiveController)==null||l.destroy(),this.interactiveSubscription.unsubscribe(),(d=this.internalsExposure)==null||d.destroy(),Nl.devNull.destroy("ui"))}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.rootContainer.style.minHeight="206px",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&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var i;let o=(i=this.store)==null?void 0:i.ui.controls.disabledControls$;return(o==null?void 0:o.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createThinOneStat(e,i={}){if(!this.videoConfig)return;let{deviceId:o,preload:n,refreshStatAuthToken:s}=lc(this.videoConfig,i),{unitedVideoId:l}=e;if(this.uiConfig.features.thinStatistics&&l)return new Ol.ThinOneStat.ThinOneStat({deviceId:o,movieId:l,preload:n,isPreviewPlayerView:this.videoConfig.playerView==="preview"},{config:this.statisticsConfig,refreshAuthToken:s})}createPlayer(e,i={},o){var n,s,l,d,a,p,f,v,u,y;if(!this.videoConfig)return;let{albumId:w,statPlace:x,statAuthToken:S,preload:T,autoplay:E,volume:V,muted:k,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:W={},adsPreviewParam:J,adsAutoplayParam:G,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,logoClickable:ue,logoHidden:$e,isMobile:fe,isTouch:ke,isAudioDisabled:ne,isLiveCatchUpMode:Ve,fullScreenTarget:re,failoverHosts:N,canDownload:Be,callbacks:le,interactiveData:ve,showThumbTimer:te,additionalButtons:me=[],additionalSettingsMenuItems:De=[],additionalContextMenuItems:pe=[],repeat:at,saveRate:Z,volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze,mediascopePixels:lt}=lc(this.videoConfig,i),{sources:vt,title:gt,thumbUrl:Ct,unitedVideoId:Ge,isClip:Ht=!1,duration:Xt,adsParams:Gt={},videoEpisodes:Wt,previewThumbsData:oe,subtitles:Ft,live:he}=e;if(!vt&&!he){let jt=new Error("empty sources and live");this.fatalError$.next(jt),(n=le.onCrashed)==null||n.call(le,jt.message);return}let we={...W,...Gt},ae=this.getNextVideoInfo(),Re={sources:vt,title:gt,thumbUrl:Ct,subtitles:Ft,unitedVideoId:Ge,isClip:Ht,live:he,albumId:w,statPlace:x,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isTouch:ke!=null?ke:fe,repeat:at,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},qe={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi,slotsApi:this.slotsApi};this.log({message:`create player, props: ${JSON.stringify(Re)}`});let Le=(s=this.interactiveController)==null?void 0:s.state.statistics$.getValue(),Ye=(Le==null?void 0:Le.oneStat)||this.createOneStat(e,i),Oe=this.createThinOneStat(e,i),et;lt&&(et=new Ol.MediascopePixel({pixels:lt})),(Ye||Oe)&&(this.statistics=new Mu(Ye,Oe,et,Le==null?void 0:Le.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new va(this.uiConfig.sentry,{version:pa,env:ou},{movieId:Ge,albumId:w,place:x,autoplay:(l=E&&!this.interactiveController)!=null?l:!1,mobile:ke!=null?ke:fe,clip:Ht}),this.interactiveController&&((p=this.prevIsid)!=null||(this.prevIsid=(a=(d=this.statistics)==null?void 0:d.oneStat)==null?void 0:a.isid$.getValue())),this.sentry={...this.sentry,...va.getInstance()};let Kt=!!ve,tt=[],xi="tooltip_interactive_go_back_disabled_first";if(Kt&&this.interactiveController){let jt=this.interactiveController.state.isInitialChapter$.getValue(),_i=this.interactiveController.getHistoryState();jt&&tt.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||tt.push("SEEK_TO_INTERACTIVE_BUTTON"),_i.hasPrevChapter$.getValue()||(tt.push("PLAY_PREV_CHAPTER_BUTTON"),jt||(_i.isGoBackLimited$.getValue()?xi="tooltip_interactive_go_back_disabled_limit":xi="tooltip_interactive_go_back_disabled"))}let hi=()=>{var jt;this.isInited=!1,this.prevIsid=void 0;let _i=(o==null?void 0:o.info.isEnded$.getValue())&&((jt=this.interactiveController)==null?void 0:jt.state.isEndChapter$.getValue());le.onReplayInteractiveVideo&&!_i?le.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Y1({player:o,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,videoId:Ge,isClip:Ht,isLiveCatchUpMode:Ve,isAudioDisabled:ne,statAuthToken:S,callbacks:le,webApi:qe,videoEpisodes:Wt,previewThumbsData:oe,canDownload:Be,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:tt,isInteractive:Kt,saveRate:Z,interactiveRanges$:(f=this.interactiveController)==null?void 0:f.state.interactiveRanges$,isInteractiveTime$:(v=this.interactiveController)==null?void 0:v.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:hi,playPrevChapterDisabledTooltip:xi,hasInteractiveBranches:!!((y=(u=this.interactiveController)==null?void 0:u.getChapterBranches())!=null&&y.length),additionalButtons:this.uiConfig.features.additionalButtons?me:[],additionalSettingsMenuItems:De!=null?De:[],additionalContextMenuItems:pe!=null?pe:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:at&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure,playerView:this.videoConfig.playerView,playerId:this.playerId});let{stores:it}=this.microStoresRoot=L0(),ii=()=>{var jt,_i,Mo,_o,Dt,ri;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onCurrentFormatChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(it.interactiveControlsOpacity$.subscribe(Pt=>{var ut;Pt!==null&&((ut=this==null?void 0:this.interactiveController)==null||ut.setDisabledControls(Pt))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onThroughputEstimationChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onTrafficSavingEnabledChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.highQualityEnabled$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onHighQualityEnabledChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.isAutoQualityEnabled$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onAutoQualityEnabledChanged)==null?void 0:ut.call(le,!!Pt)})),this.subscription.add(new Li.Observable(Pt=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(ut=>Pt.next(ut)))}).pipe((0,Li.skip)(1)).subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onCurrentPlaybackRateChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.volume$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onVolumeChange)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.muted$.subscribe(Pt=>{var ut,bi,Lo,Wi;if(Pt)(ut=le==null?void 0:le.onMute)==null||ut.call(le);else{let oi=(Lo=((bi=this.store)==null?void 0:bi.state.volume$)&&xe(this.store.state.volume$))!=null?Lo:0;(Wi=le==null?void 0:le.onUnmute)==null||Wi.call(le,oi)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onVideoBitrateChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Pt=>{var ut;let bi=(ut=this.store)==null?void 0:ut.ui.controls.disabledControls$;bi&&(Pt&&!bi.includes(md)&&bi.add(md),Pt||bi.remove(md))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Pt=>{var ut;if(!gc.clientChecker.browser.isSamsungBrowser||!Pt||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((ut=this.videoConfig)==null?void 0:ut.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onVSIDChanged)==null?void 0:ut.call(le,Pt)})),this.initMediaSession(),O(Hn,{interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:vt,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:gt,thumbUrl:Ct,subtitles:Ft,live:he,preload:T,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isMobile:ke!=null?ke:fe,failoverHosts:N,fullScreenTarget:re,saveRate:Z,shadowRootContainer:this.shadowRootContainer,showMiniTimer:te,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze},!0);let sn={target:this.playerContainer,props:r(Hn)};this.svelteRootComponent=ns(Av,sn),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Mo=(_i=(jt=this.videoConfig)==null?void 0:jt.callbacks)==null?void 0:_i.onInited)==null||Mo.call(_i)),(_o=this.internalsExposure)==null||_o.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((ri=(Dt=this.videoConfig)==null?void 0:Dt.callbacks)!=null&&ri.onDevNullLog)?Nl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Nl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?gc.clientChecker.isInited$.subscribe(jt=>{jt&&(console.log("UI SDK async start"),ii())}):ii()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let s=(i=this.videoConfig)==null?void 0:i.callbacks;s&&this.subscription.add(o.playerPhase.subscribe(d=>{var a;return(a=s.onPlayerPhaseChanged)==null?void 0:a.call(s,d)})).add(o.state.playbackState$.subscribe(d=>{var a;return d&&((a=s.onPlaybackStateChanged)==null?void 0:a.call(s,d))})).add(o.state.isLive$.subscribe(d=>{var a;return(a=s.onIsLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isActiveLive$.subscribe(d=>{var a;return(a=s.onIsActiveLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var a;return(a=s.onIsAudioAvailableChanged)==null?void 0:a.call(s,d)})).add(o.state.currentQuality$.subscribe(d=>{var a;return(a=s.onCurrentQualityChanged)==null?void 0:a.call(s,d)})).add(o.state.availableQualities$.subscribe(d=>{var a;return(a=s.onAvailableQualitiesChanged)==null?void 0:a.call(s,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&s.onAudioLanguagesAvailable&&s.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var a,p;return d?(a=s.onPiPEnter)==null?void 0:a.call(s):(p=s.onPiPExit)==null?void 0:p.call(s)}));let l=s==null?void 0:s.uiInfo;l&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var a;return(a=l.onControlsVisibleChanged)==null?void 0:a.call(l,d)})).add(o.ui.isMobile.subscribe(d=>{var a;return(a=l.onIsMobileChanged)==null?void 0:a.call(l,d)})).add(o.ui.playerSize.subscribe(d=>{var a;return(a=l.onPlayerSizeChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var a;return(a=l.onPrevButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playButton.subscribe(d=>{var a;return(a=l.onPlayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var a;return(a=l.onReplayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var a;return(a=l.onNextButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var a;return(a=l.onPlayPrevChapterChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var a;return(a=l.onSeekToInteractiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var a;return(a=l.onGraphButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var a;return(a=l.onLiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.time.subscribe(d=>{var a;return(a=l.onTimeUpdateChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.episodes.subscribe(d=>{var a;return(a=l.onEpisodesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var a;return(a=l.onSubtitlesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topLeft.subscribe(d=>{var a;return(a=l.onTopLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topRight.subscribe(d=>{var a;return(a=l.onTopRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomLeft.subscribe(d=>{var a;return(a=l.onBottomLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomRight.subscribe(d=>{var a;return(a=l.onBottomRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.middle.subscribe(d=>{var a;return(a=l.onMiddleControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottom.subscribe(d=>{var a;return(a=l.onBottomControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.videoTitleInfo.subscribe(d=>{var a;return(a=l.onTitleChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.settings.subscribe(d=>{var a;return(a=l.onSettingsChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var a;return(a=l.onFullscreenChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var a;return(a=l.onChromecastChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.pip.subscribe(d=>{var a;return(a=l.onPipChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var a;return(a=l.onVkLogoChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var a;return(a=l.onInteractiveTimeIndicatorChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.timeline.subscribe(d=>{var a;return(a=l.onTimelineChanged)==null?void 0:a.call(l,d)}))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){var o;if(!this.videoConfig)return;let n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&(0,Li.isNonNullable)(n.unitedVideoId)&&((o=this.store)==null||o.actions.internal.nextMovie(n.unitedVideoId)),this.unmountComponent(this.svelteRootComponent),this.createPlayer(n,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)==null||e.playPrevChapter()}seekToInteractive(){var e;let i=(e=this.interactiveController)==null?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}async initInteractives(){var e,i,o,n,s,l;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:d}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let a=(i=this.store)==null?void 0:i.interfaceLanguage$,p=a?xe(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:v,historyApi:u,videoLoader:y}=this.videoConfig.interactiveData;this.interactiveController=new d({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:p,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:v,historyApi:u,vkVideoLoader:y,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,isTouch:this.videoConfig.isTouch,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation,controlsTapPlace:this.uiConfig.features.interactiveControlsTapPlace,controlsFillAnimation:this.uiConfig.features.interactiveControlsFillAnimation,controlsHideAnimation:this.uiConfig.features.interactiveControlsHideAnimation},endChapterHistoryFix:this.uiConfig.features.interactiveHistoryEndChapterFix});let{isInteractiveExpectation$:w,isSeekable$:x}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(x.subscribe(T=>{if(!this.isInited)return;let E=this.store;T?E.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):E.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(w.subscribe(T=>{this.store&&this.store.state.isInteractiveExpectation$.set(T)}));let S=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(T=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...T.config,title:(f==null?void 0:f.title)||T.config.title};let E=S?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(T.player,E),S&&(S=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:T,actionType:E})=>{var V,k,I,R,Y,H;if(!this.store||!this.microStoresRoot)return;let F=w.getValue();if(T==="action-choice"&&E==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(vd)),T==="action-choice-canceled"){let W=xe(this.store.state.isPlaying$)||F;if(((I=(V=this.videoConfig)==null?void 0:V.isTouch)!=null?I:(k=this.videoConfig)!=null&&k.isMobile)&&W){this.store.ui.interactiveHideMobileControls.set(!0);return}(H=(R=this.videoConfig)==null?void 0:(Y=R.callbacks).onDisabledInteractiveClick)==null||H.call(Y)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:T,removeAllOpenURI:E})=>{this.store&&T==="container-fake-removed"&&E&&this.store.ui.controls.disabledControls$.remove(vd)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let T=this.interactiveController.getHistoryState();this.subscription.add(T.history$.subscribe(E=>{var V,k,I;E.length&&((I=(k=(V=this.videoConfig)==null?void 0:V.callbacks)==null?void 0:k.onInteractiveHistoryChanged)==null||I.call(k,E))}))}(l=(s=this.videoConfig)==null?void 0:s.callbacks)!=null&&l.onInteractiveChapterChanged&&this.subscription.add(this.interactiveController.events.chapterChanged$.subscribe(T=>{var E,V,k;(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveChapterChanged)==null||k.call(V,T.chapter,T.manifestVideo)})),this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var T,E,V,k;(T=this.microStoresRoot)==null||T.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveTimeIndicatorClick)==null||k.call(V)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(T=>{this.log({message:T.toString()})}))}catch(d){this.log({message:d.message})}}initPlayer(e,i={}){var o,n,s,l,d,a,p,f,v,u,y,w,x,S,T,E,V,k,I,R,Y,H,F,W,J,G,ce,ie;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData){let ue=new Error("empty videos");this.fatalError$.next(ue),(n=(o=e.callbacks)==null?void 0:o.onCrashed)==null||n.call(o,ue.message);return}else this.fatalError$.next(null);if(this.videoConfig=lc(l5,(0,Li.cloneDeepWith)(e,ue=>ue instanceof HTMLElement?ue:void 0)),this.playerId=(0,Li.getPlayerId)(e.playerId),this.uiConfig=Ih((s=i.ui)!=null?s:{}),this.coreConfig=(l=i.core)!=null?l:{configName:[]},this.statisticsConfig=(d=i.statistics)!=null?d:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer&&(this.rootContainer.style.minHeight="unset"),this.style.display="block",this.style.width="100%",this.style.height="100%"),this.videoConfig.playerView==="preview"&&(this.playerContainer.style.contain="none"),this.sentry={config:(a=this.uiConfig.sentry)!=null?a:{}},this.uiConfig.features.exposeInternalsToGlobal&&((p=this.internalsExposure)!=null||(this.internalsExposure=new Li.InternalsExposure("ui",this.playerId))),Nl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((f=this.videoConfig)==null?void 0:f.showAds)],numbers:[(0,op.now)()]}),(0,Li.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(u=(v=this.uiConfig.features.mediaSession)!=null?v:this.videoConfig.isMediaSessionEnabled)!=null?u:!0),(0,Li.isNonNullable)(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(w=(y=this.uiConfig.features.pip)!=null?y:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0,this.uiConfig.features.dpip=(S=(x=this.uiConfig.features.dpip)!=null?x:this.videoConfig.isPictureInPictureEnabled)!=null?S:!0),this.videoConfig.isTouch=(E=(T=this.uiConfig.isMobile)!=null?T:this.videoConfig.isTouch)!=null?E:this.videoConfig.isMobile,(V=this.videoConfig).autoplay&&(V.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(k=this.uiConfig.ads.enable)!=null?k:this.videoConfig.showAds,this.videoConfig.adsSlotId=(I=this.uiConfig.ads.slot)!=null?I:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(R=this.uiConfig.ads.preview)!=null?R:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((Y=this.uiConfig.showLogo)!=null?Y:!this.videoConfig.logoHidden),(H=this.videoConfig).canRewindLive&&(H.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(F=this.videoConfig.supportLink)!=null?F:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(W=this.uiConfig.features.endScreen)!=null?W:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(J=this.uiConfig.features.autoplayNext)!=null?J:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(G=this.uiConfig.features.nextPrevButtons)!=null?G:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((ce=this.videoConfig.videos)!=null&&ce[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let ue={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=ju.getLatestSupportedVersion(ue):this.pictureInPictureApi=new ga(ue)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new Qu:void 0,this.slotsApi=this.uiConfig.features.slots?new zu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Yu(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteErrorComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),E0(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),(ie=this.slotsApi)==null||ie.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new tp(this._shadowRoot):void 0}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(Hn)&&(r(Hn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Hn).nextButtonActive=this.isNextButtonActive(),r(Hn).prevButtonActive=this.isPrevButtonActive(),r(Hn).endScreenVideoTitle=o.nextVideoTitle,r(Hn).endScreenVideoThumb=o.nextVideoThumb,r(Hn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)==null||e.call(this),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=(i=this.store)==null?void 0:i.playerPhase.subscribe(o=>{o==="video"?this.setupMediaSessionForVideo():o==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onNextVideoClick)==null||l.call(s)}catch(d){this.log({message:"onNextVideoClick callback failed to execute"})}else this.playNextVideo()}]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onPrevVideoClick)==null||l.call(s)}catch(d){this.log({message:"onPrevVideoClick callback failed to execute"})}else this.playPrevVideo()}])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}moveTo(e){this.shadowDOMCallbacksDisabled=!0,e.append(this),this.shadowDOMCallbacksDisabled=!1}play(){var e,i,o,n;this.isControlDisabled("PLAY_BUTTON")||(e=this.store)!=null&&e.playerPhase.is("LiveWaitingStart")||(i=this.store)!=null&&i.playerPhase.is("LiveWaitingRecover")||(o=this.store)!=null&&o.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),(n=this.svelteRootComponent)==null||n.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)==null||e.pause()}stop(){var e;if(!this.videoConfig)return;this.log({message:"stop"});let i=!!this.interactiveController;i&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),(e=this.mediaSessionApi)==null||e.destroy();let o=this.videoConfig.videos[0];o&&(this.unmountComponent(this.svelteRootComponent),i?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(o))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)==null||i.setMuted(e)}toggleSubtitle(){var e;this.log({message:"toggle subtitle"}),(e=this.svelteRootComponent)==null||e.toggleSubtitle()}changeSubtitle(e,i){var o;this.log({message:"change subtitle"}),(o=this.svelteRootComponent)==null||o.changeSubtitle(e,i)}hideControls(){var e;this.log({message:"hide controls"}),(e=this.svelteRootComponent)==null||e.hideControls()}showControls(){var e;this.log({message:"show controls"}),(e=this.svelteRootComponent)==null||e.showControls()}setPiPEnabled(e){var i,o;(o=(i=this.store)==null?void 0:i.webApi.pictureInPictureApi)==null||o.setEnabled(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)==null||i.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(Hn)&&(r(Hn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(Hn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Hn).nextButtonActive=this.isNextButtonActive(),r(Hn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){var i;this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)==null||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)==null||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,o,n;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!=null?i:"none"}. Min: ${(o=e.min)!=null?o:"none"}`}),(n=this.svelteRootComponent)==null||n.setAutoQualityLimits(e)}setAutoQuality(){var e;(e=this.svelteRootComponent)==null||e.setAutoQuality()}toggleTrafficSaving(e){var i;(i=this.svelteRootComponent)==null||i.toggleTrafficSaving(e)}toggleHighQuality(e){var i;(i=this.svelteRootComponent)==null||i.toggleHighQuality(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)==null?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,o;this.log({message:"live started"}),(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!1),(o=this.store)==null||o.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingStart(){var e;this.log({message:"live waiting"}),(e=this.store)==null||e.actions.internal.setLiveWaitingStart(!0)}isLiveTailPlaying(){var e;let i=(e=this.store)==null?void 0:e.getPlayer();if(!i)return!1;let{info:o}=i;return window.console.log(`VP-4613: VP: isLiveTailPlaying: atLiveEdge$ = ${o.atLiveEdge$.getValue()}, isStalled$ = ${o.isStalled$.getValue()}`),o.canPlayLiveTailBuffer$.getValue()&&!o.isStalled$.getValue()&&!o.atLiveEdge$.getValue()}setLiveWaitingRecover(e=!1){var i;let o=this.isLiveTailPlaying(),n=e||!o;this.log({message:`live waiting recover: forceImmediate = ${e}, liveTailPlaying = ${o}`}),window.console.log(`VP-4613: VP: live waiting recover: liveTailPlaying = ${o} immediate = ${n}`);let s=()=>{var l;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!0)};n&&s(),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var l;n||s(),(l=this.store)==null||l.destroy()})}setLiveWaitingRecord(){var e;let i=this.isLiveTailPlaying(),o=!i;this.log({message:`live waiting record: liveTailPlaying = ${i}`});let n=()=>{var s;(s=this.store)==null||s.actions.internal.setLiveWaitingRecord(!0)};o&&n(),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var s;o||n(),(s=this.store)==null||s.destroy()})}setLiveEnd(e){var i;let o=this.isLiveTailPlaying(),n=!o;this.log({message:`live ended: liveTailPlaying = ${o}`});let s=()=>{var l,d;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!1),(d=this.store)==null||d.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})};if(n){s();return}(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=s)}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}setLooped(e){var i;(i=this.store)==null||i.actions.internal.setLooped(e)}getDebugData(){var e,i;return(i=(e=this.store)==null?void 0:e.actions.internal.getDebugTextData())!=null?i:""}getDeviceId(){var e,i,o;return(o=(i=(e=this.statistics)==null?void 0:e.oneStat)==null?void 0:i.getDeviceId())!=null?o:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=xe(this.store.state.positionExact$),l=xe(this.store.state.interactiveEpisodes$).find(a=>!a.completed);this.interactiveController.events.playerChanged$.pipe((0,Li.once)()).subscribe(()=>{l&&n>=l.time?this.seekTime(l.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:(o=d==null?void 0:d.chapter)==null?void 0:o.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){var o;(o=this.microStoresRoot)==null||o.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){var e;(e=this.store)==null||e.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&(this.statistics.oneStat&&this.statistics.oneStat.updateContext(e),this.statistics.thinOneStat&&this.statistics.thinOneStat.updateContext(e))}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}togglePictureInPicture(){var e;(e=this.store)==null||e.actions.internal.togglePictureInPicture()}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}restoreFocus(){var e;(e=this.focusManager)==null||e.restoreFocus()}handleExternalKeyboardEvent(e){var i,o;return!!((o=(i=this.svelteRootComponent)==null?void 0:i.keyboardControls)!=null&&o.handleExternalKeyboardEvent(e))}setAutoplayNext(e){var i;(i=this.store)==null||i.actions.internal.setAutoplayNextEnabled(e)}unmountComponent(e){e&&sa(e)}};var Bl=require("@vkontakte/videoplayer-shared/es2018"),np=require("@vkontakte/videoplayer-core/es2018"),d5=()=>{window.customElements.define("vk-video-player",ip)};
|
|
389
|
+
`),n=document.createElement("style");n.textContent=o;let s=this.createStretchedContainer(),l=s.attachShadow({mode:"open"});l.append(n),l.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=ns(Ov,d),(e=this.pipWindow)==null||e.document.body.append(s),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(sa(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1),this.pipWindow=void 0)})}async exit(){return new Promise(e=>{var i;this.pipWindow&&((i=documentPictureInPicture.window)==null||i.close()),e()})}async dispose(){await this.exit()}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function E0(t){return t instanceof ac}var ju=class{static getLatestSupportedVersion(e){let i=new ga(e),o=new ac(e);if(o.isSupported())return o;if(i.isSupported())return i}};function lc(t,e){var n,s;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let l of i)o[l]=(s=(n=e[l])!=null?n:t[l])!=null?s:void 0;return o}var I0="Inner error. Unexpectedly root annotation container null reference exception",k0="Annotation with such name already exists",P0="Annotation with such name does not exist";var Vl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var Rl=require("@vkontakte/videoplayer-shared/es2018"),i5="1",o5=100,Yu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new Rl.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,Rl.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},o5);this.subscriptions.add((0,Rl.observeElementSize)(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var o;if(!this.rootAnnotationsContainer)throw new Vl(I0);if(this.annotations.has(e))throw new Vl(k0);i.style.zIndex=(o=i.style.zIndex)!=null?o:i5,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 Vl(P0);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(){var e;this.annotations.clear(),this.subscriptions.unsubscribe(),(e=this.mutationObserver)==null||e.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,s=e.offsetLeft,l=e.offsetWidth,d=e.offsetHeight;return n<0||s<0||s+l>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};var Ha=require("@vkontakte/videoplayer-shared/es2018"),rn=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,Ha.assertNonNullable)(e),(0,Ha.assertNonNullable)(i),(0,Ha.assertNonNullable)(n),n.interactiveData&&(0,Ha.assertNonNullable)(o),this.subscription=new Ha.Subscription,this.subscription}};var dc=class extends rn{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(s=>{this.state$.set(s?!0:null)})),o}};var cc=class extends rn{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:s}=i,{fakeIsPlaying$:l}=n,{isInteractiveExpectation$:d,isPlaying$:a}=s.state,{controlsVisible:p,isMobile:f}=s.ui,v=xe(f),u=()=>v&&xe(p);return o.add(p.subscribe(y=>{if(!v)return;let w=xe(l);xe(a)?this.state$.set(y):w!==null&&this.state$.set(!w||y)})),o.add(a.subscribe(y=>{this.state$.set(!y||u())})),o.add(l.subscribe(y=>{if(y===null)return;let w=xe(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!y)})),o}};var uc=class extends rn{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=se("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(s=>{s.length&&(s.every(l=>l.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};var A0=require("@vkontakte/videoplayer-shared/es2018"),Bv=se(!1),Zu=null,pc=class extends rn{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Bv,set:(i,o=!1)=>{i!==xe(Bv)&&(this.clearTimeout(),Bv.set(i),!i&&Zu&&(Zu=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:s}=i,{isInteractiveTime$:l,isPlaying$:d}=n.state,a=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(a.subscribe(v=>{xe(l)&&v&&this.state$.set(!1)}));let f=(s==null?void 0:s.interactiveData)||{tooltipHelpHintActive:!1};return o.add((0,A0.combine)({isPlaying$:d,isInteractiveTime$:l,interactiveTimeIndicator:p}).subscribe(({isPlaying$:v,isInteractiveTime$:u,interactiveTimeIndicator:y})=>{var w,x;if(!(!v||!(y!=null&&y.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&Zu===null&&(Zu=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(x=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||x.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var Xu=require("@vkontakte/videoplayer-shared/es2018");var fc=class extends rn{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...se(null),toggle:Xu.noop};this.checkIfShouldHide=i=>Us(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:s}=i,l=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(xe(l)))return;let a=xe(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:v}=n.ui.controls,u=xe(p),y=xe(f);if(a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1),v.remove(sf),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await(s==null?void 0:s.toggleGraphView(!0)),this.state$.set(!0),v.add(sf),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add((0,Xu.combine)({graphIsOpened:this.state$,currentGridType:l}).subscribe(async({graphIsOpened:a,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1)}catch(v){d({message:"Cant hide graph"})}})),o}};var Dv=require("@vkontakte/videoplayer-shared/es2018"),mc=class extends rn{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:se(!1),isEnabled$:se(!1),type$:se(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:s,isEnabled$:l,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new Dv.ValueSubject(!1),isEnabled$:new Dv.ValueSubject(!1)}};return o.add(s.subscribe(a=>{this.state$.isActive$.set(a)})),o.add(l.subscribe(a=>{this.state$.isEnabled$.set(a)})),this.state$.type$.set(d),o}};var ep=require("@vkontakte/videoplayer-shared/es2018");var Ju=require("@vkontakte/videoplayer-shared/es2018"),M0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?n5({maxCount:t}):void 0,e!==0?r5({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},n5=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,Ju.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify((n=e[i])!=null?n:0))},canShowNotification:i=>{var o;return((o=e[i])!=null?o:0)<t}}},r5=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Ju.safeStorage.get(e)||"{}")}catch(s){return{}}},o=s=>Ju.safeStorage.set(e,JSON.stringify(s)),n=s=>{let l=i();delete l[s],o(l)};return{notificationShowed:s=>{o({...i(),[s]:{timeout:t,launchTime:Date.now()}})},canShowNotification:s=>{let l=i()[s];if(l){let d=Date.now()-l.launchTime>t;return d&&n(s),d}else return!0}}};var vc=class extends rn{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:se({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:s,timeoutShowSlowVideoNotification:l,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:a}}}=i;this.notificationManager=M0({maxShowCount:s,timeout:l});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe((0,ep.filterChanged)(),(0,ep.filter)(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(a&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var L0=()=>[dc,cc,uc,pc,fc,mc,vc].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var Nl=require("@vkontakte/videoplayer-shared/es2018");var tp=class{constructor(e){this.shadowRoot=e;this.lastFocusedNode=null;this.init=()=>{this.shadowRoot.addEventListener("focusin",this.handleFocusChange)};this.handleFocusChange=()=>{this.lastFocusedNode=this.shadowRoot.activeElement};this.restoreFocus=()=>{var e;(e=this.lastFocusedNode)==null||e.focus()};this.init()}destroy(){this.shadowRoot.removeEventListener("focusin",this.handleFocusChange)}};var s5=Object.defineProperty,a5=(t,e,i)=>e in t?s5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Qt=(t,e,i)=>a5(t,typeof e!="symbol"?e+"":e,i),l5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Li.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,gc.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},Hn=j(void 0),ip=class extends HTMLElement{constructor(){super(),Qt(this,"svelteStubComponent"),Qt(this,"svelteRootComponent"),Qt(this,"svelteErrorComponent"),Qt(this,"store"),Qt(this,"microStoresRoot"),Qt(this,"statistics"),Qt(this,"sentry"),Qt(this,"_shadowRoot"),Qt(this,"playerContainer"),Qt(this,"rootContainer"),Qt(this,"shadowRootContainer"),Qt(this,"playerId"),Qt(this,"uiConfig"),Qt(this,"coreConfig"),Qt(this,"statisticsConfig"),Qt(this,"interactiveController"),Qt(this,"interactiveContainer"),Qt(this,"graphMadePause"),Qt(this,"currentPlayingVideoIndex",0),Qt(this,"needToRepeatPlaylist",!1),Qt(this,"videoConfig"),Qt(this,"pictureInPictureApi"),Qt(this,"mediaSessionApi"),Qt(this,"unsubscribePlayerPhaseSubscription"),Qt(this,"logger"),Qt(this,"log"),Qt(this,"subscription"),Qt(this,"interactiveSubscription"),Qt(this,"annotationsApi"),Qt(this,"slotsApi"),Qt(this,"focusManager"),Qt(this,"prevIsid"),Qt(this,"isInited",!1),Qt(this,"internalsExposure",null),Qt(this,"shadowDOMCallbacksDisabled",!1),Qt(this,"fatalError$",new op.ValueSubject(null)),Qt(this,"createOneStat",(e,i={})=>{var o,n,s,l;if(!this.videoConfig)return;let{albumId:d,statPlace:a,statUserSalt:p,statTrackCode:f,statVKAppId:v,refreshStatAuthToken:u,autoplay:y,isMobile:w,isTouch:x,refDomain:S,deviceId:T,interactiveData:E}=lc(this.videoConfig,i),V=(o=E==null?void 0:E.projectInfo)==null?void 0:o.pid,k=(s=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?s:!1;k&&(this.prevIsid=void 0);let{unitedVideoId:I,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&I)try{return new Ol.OneStat({movieId:I,albumId:d,place:a,trackCode:f,vkAppId:v,autoplay:(l=y&&!this.interactiveController)!=null?l:!1,mobile:x!=null?x:w,clip:R,refDomain:S,deviceId:T,isPreviewPlayerView:this.videoConfig.playerView==="preview",...V&&(!this.isInited||k)&&{projectId:Number(V)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}catch(H){console.error(H),this.log({message:H.message})}}),Nl.devNull.create("ui"),this.logger=new Li.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Li.Subscription,this.interactiveSubscription=new Li.Subscription,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=ns(Rv,{target:this.playerContainer}))})}connectedCallback(){var e,i;if(this.rootContainer)return;this.initPlayerRootContainers();let o=(e=this.getAttribute("stub-title"))!=null?e:void 0,n=(i=this.getAttribute("stub-thumb-url"))!=null?i:void 0,s=ni({title:o,thumbUrl:n}),l={target:this.playerContainer,props:s};this.svelteStubComponent=ns(Vv,l)}disconnectedCallback(){var e,i,o,n,s,l,d;this.shadowDOMCallbacksDisabled||((e=this.annotationsApi)==null||e.destroy(),(i=this.slotsApi)==null||i.destroy(),(o=this.focusManager)==null||o.destroy(),(n=this.mediaSessionApi)==null||n.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteErrorComponent),this.subscription.unsubscribe(),(s=this.unsubscribePlayerPhaseSubscription)==null||s.call(this),(l=this.interactiveController)==null||l.destroy(),this.interactiveSubscription.unsubscribe(),(d=this.internalsExposure)==null||d.destroy(),Nl.devNull.destroy("ui"))}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.rootContainer.style.minHeight="206px",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&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var i;let o=(i=this.store)==null?void 0:i.ui.controls.disabledControls$;return(o==null?void 0:o.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createThinOneStat(e,i={}){if(!this.videoConfig)return;let{deviceId:o,preload:n,refreshStatAuthToken:s}=lc(this.videoConfig,i),{unitedVideoId:l}=e;if(this.uiConfig.features.thinStatistics&&l)return new Ol.ThinOneStat.ThinOneStat({deviceId:o,movieId:l,preload:n,isPreviewPlayerView:this.videoConfig.playerView==="preview"},{config:this.statisticsConfig,refreshAuthToken:s})}createPlayer(e,i={},o){var n,s,l,d,a,p,f,v,u,y;if(!this.videoConfig)return;let{albumId:w,statPlace:x,statAuthToken:S,preload:T,autoplay:E,volume:V,muted:k,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:W={},adsPreviewParam:J,adsAutoplayParam:G,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,logoClickable:ue,logoHidden:$e,isMobile:fe,isTouch:ke,isAudioDisabled:ne,isLiveCatchUpMode:Ve,fullScreenTarget:re,failoverHosts:N,canDownload:Be,callbacks:le,interactiveData:ve,showThumbTimer:te,additionalButtons:me=[],additionalSettingsMenuItems:De=[],additionalContextMenuItems:pe=[],repeat:at,saveRate:Z,volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze,mediascopePixels:lt}=lc(this.videoConfig,i),{sources:vt,title:gt,thumbUrl:Ct,unitedVideoId:Ge,isClip:Ht=!1,duration:Xt,adsParams:Gt={},videoEpisodes:Wt,previewThumbsData:oe,subtitles:Ft,live:he}=e;if(!vt&&!he){let jt=new Error("empty sources and live");this.fatalError$.next(jt),(n=le.onCrashed)==null||n.call(le,jt.message);return}let we={...W,...Gt},ae=this.getNextVideoInfo(),Re={sources:vt,title:gt,thumbUrl:Ct,subtitles:Ft,unitedVideoId:Ge,isClip:Ht,live:he,albumId:w,statPlace:x,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isTouch:ke!=null?ke:fe,repeat:at,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},qe={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi,slotsApi:this.slotsApi};this.log({message:`create player, props: ${JSON.stringify(Re)}`});let Le=(s=this.interactiveController)==null?void 0:s.state.statistics$.getValue(),Ye=(Le==null?void 0:Le.oneStat)||this.createOneStat(e,i),Oe=this.createThinOneStat(e,i),et;lt&&(et=new Ol.MediascopePixel({pixels:lt})),(Ye||Oe)&&(this.statistics=new Mu(Ye,Oe,et,Le==null?void 0:Le.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new va(this.uiConfig.sentry,{version:pa,env:ou},{movieId:Ge,albumId:w,place:x,autoplay:(l=E&&!this.interactiveController)!=null?l:!1,mobile:ke!=null?ke:fe,clip:Ht}),this.interactiveController&&((p=this.prevIsid)!=null||(this.prevIsid=(a=(d=this.statistics)==null?void 0:d.oneStat)==null?void 0:a.isid$.getValue())),this.sentry={...this.sentry,...va.getInstance()};let Kt=!!ve,tt=[],xi="tooltip_interactive_go_back_disabled_first";if(Kt&&this.interactiveController){let jt=this.interactiveController.state.isInitialChapter$.getValue(),_i=this.interactiveController.getHistoryState();jt&&tt.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||tt.push("SEEK_TO_INTERACTIVE_BUTTON"),_i.hasPrevChapter$.getValue()||(tt.push("PLAY_PREV_CHAPTER_BUTTON"),jt||(_i.isGoBackLimited$.getValue()?xi="tooltip_interactive_go_back_disabled_limit":xi="tooltip_interactive_go_back_disabled"))}let hi=()=>{var jt;this.isInited=!1,this.prevIsid=void 0;let _i=(o==null?void 0:o.info.isEnded$.getValue())&&((jt=this.interactiveController)==null?void 0:jt.state.isEndChapter$.getValue());le.onReplayInteractiveVideo&&!_i?le.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Y1({player:o,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,videoId:Ge,isClip:Ht,isLiveCatchUpMode:Ve,isAudioDisabled:ne,statAuthToken:S,callbacks:le,webApi:qe,videoEpisodes:Wt,previewThumbsData:oe,canDownload:Be,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:tt,isInteractive:Kt,saveRate:Z,interactiveRanges$:(f=this.interactiveController)==null?void 0:f.state.interactiveRanges$,isInteractiveTime$:(v=this.interactiveController)==null?void 0:v.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:hi,playPrevChapterDisabledTooltip:xi,hasInteractiveBranches:!!((y=(u=this.interactiveController)==null?void 0:u.getChapterBranches())!=null&&y.length),additionalButtons:this.uiConfig.features.additionalButtons?me:[],additionalSettingsMenuItems:De!=null?De:[],additionalContextMenuItems:pe!=null?pe:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:at&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure,playerView:this.videoConfig.playerView,playerId:this.playerId});let{stores:it}=this.microStoresRoot=L0(),ii=()=>{var jt,_i,Mo,_o,Dt,ri;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onCurrentFormatChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(it.interactiveControlsOpacity$.subscribe(Pt=>{var ut;Pt!==null&&((ut=this==null?void 0:this.interactiveController)==null||ut.setDisabledControls(Pt))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onThroughputEstimationChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onTrafficSavingEnabledChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.highQualityEnabled$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onHighQualityEnabledChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.isAutoQualityEnabled$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onAutoQualityEnabledChanged)==null?void 0:ut.call(le,!!Pt)})),this.subscription.add(new Li.Observable(Pt=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(ut=>Pt.next(ut)))}).pipe((0,Li.skip)(1)).subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onCurrentPlaybackRateChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.volume$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onVolumeChange)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.muted$.subscribe(Pt=>{var ut,bi,Lo,Wi;if(Pt)(ut=le==null?void 0:le.onMute)==null||ut.call(le);else{let oi=(Lo=((bi=this.store)==null?void 0:bi.state.volume$)&&xe(this.store.state.volume$))!=null?Lo:0;(Wi=le==null?void 0:le.onUnmute)==null||Wi.call(le,oi)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onVideoBitrateChanged)==null?void 0:ut.call(le,Pt)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Pt=>{var ut;let bi=(ut=this.store)==null?void 0:ut.ui.controls.disabledControls$;bi&&(Pt&&!bi.includes(md)&&bi.add(md),Pt||bi.remove(md))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Pt=>{var ut;if(!gc.clientChecker.browser.isSamsungBrowser||!Pt||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((ut=this.videoConfig)==null?void 0:ut.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Pt=>{var ut;return(ut=le==null?void 0:le.onVSIDChanged)==null?void 0:ut.call(le,Pt)})),this.initMediaSession(),O(Hn,{interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:vt,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:gt,thumbUrl:Ct,subtitles:Ft,live:he,preload:T,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isMobile:ke!=null?ke:fe,failoverHosts:N,fullScreenTarget:re,saveRate:Z,shadowRootContainer:this.shadowRootContainer,showMiniTimer:te,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze},!0);let sn={target:this.playerContainer,props:r(Hn)};this.svelteRootComponent=ns(Av,sn),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Mo=(_i=(jt=this.videoConfig)==null?void 0:jt.callbacks)==null?void 0:_i.onInited)==null||Mo.call(_i)),(_o=this.internalsExposure)==null||_o.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((ri=(Dt=this.videoConfig)==null?void 0:Dt.callbacks)!=null&&ri.onDevNullLog)?Nl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Nl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?gc.clientChecker.isInited$.subscribe(jt=>{jt&&(console.log("UI SDK async start"),ii())}):ii()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let s=(i=this.videoConfig)==null?void 0:i.callbacks;s&&this.subscription.add(o.playerPhase.subscribe(d=>{var a;return(a=s.onPlayerPhaseChanged)==null?void 0:a.call(s,d)})).add(o.state.playbackState$.subscribe(d=>{var a;return d&&((a=s.onPlaybackStateChanged)==null?void 0:a.call(s,d))})).add(o.state.isLive$.subscribe(d=>{var a;return(a=s.onIsLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isActiveLive$.subscribe(d=>{var a;return(a=s.onIsActiveLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var a;return(a=s.onIsAudioAvailableChanged)==null?void 0:a.call(s,d)})).add(o.state.currentQuality$.subscribe(d=>{var a;return(a=s.onCurrentQualityChanged)==null?void 0:a.call(s,d)})).add(o.state.availableQualities$.subscribe(d=>{var a;return(a=s.onAvailableQualitiesChanged)==null?void 0:a.call(s,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&s.onAudioLanguagesAvailable&&s.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var a,p;return d?(a=s.onPiPEnter)==null?void 0:a.call(s):(p=s.onPiPExit)==null?void 0:p.call(s)}));let l=s==null?void 0:s.uiInfo;l&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var a;return(a=l.onControlsVisibleChanged)==null?void 0:a.call(l,d)})).add(o.ui.isMobile.subscribe(d=>{var a;return(a=l.onIsMobileChanged)==null?void 0:a.call(l,d)})).add(o.ui.playerSize.subscribe(d=>{var a;return(a=l.onPlayerSizeChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var a;return(a=l.onPrevButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playButton.subscribe(d=>{var a;return(a=l.onPlayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var a;return(a=l.onReplayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var a;return(a=l.onNextButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var a;return(a=l.onPlayPrevChapterChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var a;return(a=l.onSeekToInteractiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var a;return(a=l.onGraphButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var a;return(a=l.onLiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.time.subscribe(d=>{var a;return(a=l.onTimeUpdateChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.episodes.subscribe(d=>{var a;return(a=l.onEpisodesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var a;return(a=l.onSubtitlesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topLeft.subscribe(d=>{var a;return(a=l.onTopLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topRight.subscribe(d=>{var a;return(a=l.onTopRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomLeft.subscribe(d=>{var a;return(a=l.onBottomLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomRight.subscribe(d=>{var a;return(a=l.onBottomRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.middle.subscribe(d=>{var a;return(a=l.onMiddleControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottom.subscribe(d=>{var a;return(a=l.onBottomControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.videoTitleInfo.subscribe(d=>{var a;return(a=l.onTitleChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.settings.subscribe(d=>{var a;return(a=l.onSettingsChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var a;return(a=l.onFullscreenChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var a;return(a=l.onChromecastChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.pip.subscribe(d=>{var a;return(a=l.onPipChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var a;return(a=l.onVkLogoChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var a;return(a=l.onInteractiveTimeIndicatorChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.timeline.subscribe(d=>{var a;return(a=l.onTimelineChanged)==null?void 0:a.call(l,d)}))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){var o;if(!this.videoConfig)return;let n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&(0,Li.isNonNullable)(n.unitedVideoId)&&((o=this.store)==null||o.actions.internal.nextMovie(n.unitedVideoId)),this.unmountComponent(this.svelteRootComponent),this.createPlayer(n,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)==null||e.playPrevChapter()}seekToInteractive(){var e;let i=(e=this.interactiveController)==null?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}async initInteractives(){var e,i,o,n,s,l;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:d}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let a=(i=this.store)==null?void 0:i.interfaceLanguage$,p=a?xe(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:v,historyApi:u,videoLoader:y}=this.videoConfig.interactiveData;this.interactiveController=new d({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:p,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:v,historyApi:u,vkVideoLoader:y,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,isTouch:this.videoConfig.isTouch,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation,controlsTapPlace:this.uiConfig.features.interactiveControlsTapPlace,controlsFillAnimation:this.uiConfig.features.interactiveControlsFillAnimation,controlsHideAnimation:this.uiConfig.features.interactiveControlsHideAnimation},endChapterHistoryFix:this.uiConfig.features.interactiveHistoryEndChapterFix});let{isInteractiveExpectation$:w,isSeekable$:x}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(x.subscribe(T=>{if(!this.isInited)return;let E=this.store;T?E.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):E.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(w.subscribe(T=>{this.store&&this.store.state.isInteractiveExpectation$.set(T)}));let S=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(T=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...T.config,title:(f==null?void 0:f.title)||T.config.title};let E=S?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(T.player,E),S&&(S=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:T,actionType:E})=>{var V,k,I,R,Y,H;if(!this.store||!this.microStoresRoot)return;let F=w.getValue();if(T==="action-choice"&&E==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(vd)),T==="action-choice-canceled"){let W=xe(this.store.state.isPlaying$)||F;if(((I=(V=this.videoConfig)==null?void 0:V.isTouch)!=null?I:(k=this.videoConfig)!=null&&k.isMobile)&&W){this.store.ui.interactiveHideMobileControls.set(!0);return}(H=(R=this.videoConfig)==null?void 0:(Y=R.callbacks).onDisabledInteractiveClick)==null||H.call(Y)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:T,removeAllOpenURI:E})=>{this.store&&T==="container-fake-removed"&&E&&this.store.ui.controls.disabledControls$.remove(vd)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let T=this.interactiveController.getHistoryState();this.subscription.add(T.history$.subscribe(E=>{var V,k,I;E.length&&((I=(k=(V=this.videoConfig)==null?void 0:V.callbacks)==null?void 0:k.onInteractiveHistoryChanged)==null||I.call(k,E))}))}(l=(s=this.videoConfig)==null?void 0:s.callbacks)!=null&&l.onInteractiveChapterChanged&&this.subscription.add(this.interactiveController.events.chapterChanged$.subscribe(T=>{var E,V,k;(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveChapterChanged)==null||k.call(V,T.chapter,T.manifestVideo)})),this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var T,E,V,k;(T=this.microStoresRoot)==null||T.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveTimeIndicatorClick)==null||k.call(V)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(T=>{this.log({message:T.toString()})}))}catch(d){this.log({message:d.message})}}initPlayer(e,i={}){var o,n,s,l,d,a,p,f,v,u,y,w,x,S,T,E,V,k,I,R,Y,H,F,W,J,G,ce,ie;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData){let ue=new Error("empty videos");this.fatalError$.next(ue),(n=(o=e.callbacks)==null?void 0:o.onCrashed)==null||n.call(o,ue.message);return}else this.fatalError$.next(null);if(this.videoConfig=lc(l5,(0,Li.cloneDeepWith)(e,ue=>ue instanceof HTMLElement?ue:void 0)),this.playerId=(0,Li.getPlayerId)(e.playerId),this.uiConfig=Ih((s=i.ui)!=null?s:{}),this.coreConfig=(l=i.core)!=null?l:{configName:[]},this.statisticsConfig=(d=i.statistics)!=null?d:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer&&(this.rootContainer.style.minHeight="unset"),this.style.display="block",this.style.width="100%",this.style.height="100%"),this.videoConfig.playerView==="preview"&&(this.playerContainer.style.contain="none"),this.sentry={config:(a=this.uiConfig.sentry)!=null?a:{}},this.uiConfig.features.exposeInternalsToGlobal&&((p=this.internalsExposure)!=null||(this.internalsExposure=new Li.InternalsExposure("ui",this.playerId))),Nl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((f=this.videoConfig)==null?void 0:f.showAds)],numbers:[(0,op.now)()]}),(0,Li.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(u=(v=this.uiConfig.features.mediaSession)!=null?v:this.videoConfig.isMediaSessionEnabled)!=null?u:!0),(0,Li.isNonNullable)(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(w=(y=this.uiConfig.features.pip)!=null?y:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0,this.uiConfig.features.dpip=(S=(x=this.uiConfig.features.dpip)!=null?x:this.videoConfig.isPictureInPictureEnabled)!=null?S:!0),this.videoConfig.isTouch=(E=(T=this.uiConfig.isMobile)!=null?T:this.videoConfig.isTouch)!=null?E:this.videoConfig.isMobile,(V=this.videoConfig).autoplay&&(V.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(k=this.uiConfig.ads.enable)!=null?k:this.videoConfig.showAds,this.videoConfig.adsSlotId=(I=this.uiConfig.ads.slot)!=null?I:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(R=this.uiConfig.ads.preview)!=null?R:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((Y=this.uiConfig.showLogo)!=null?Y:!this.videoConfig.logoHidden),(H=this.videoConfig).canRewindLive&&(H.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(F=this.videoConfig.supportLink)!=null?F:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(W=this.uiConfig.features.endScreen)!=null?W:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(J=this.uiConfig.features.autoplayNext)!=null?J:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(G=this.uiConfig.features.nextPrevButtons)!=null?G:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((ce=this.videoConfig.videos)!=null&&ce[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let ue={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=ju.getLatestSupportedVersion(ue):this.pictureInPictureApi=new ga(ue)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new Qu:void 0,this.slotsApi=this.uiConfig.features.slots?new zu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Yu(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteErrorComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),E0(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),(ie=this.slotsApi)==null||ie.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new tp(this._shadowRoot):void 0}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(Hn)&&(r(Hn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Hn).nextButtonActive=this.isNextButtonActive(),r(Hn).prevButtonActive=this.isPrevButtonActive(),r(Hn).endScreenVideoTitle=o.nextVideoTitle,r(Hn).endScreenVideoThumb=o.nextVideoThumb,r(Hn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)==null||e.call(this),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=(i=this.store)==null?void 0:i.playerPhase.subscribe(o=>{o==="video"?this.setupMediaSessionForVideo():o==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onNextVideoClick)==null||l.call(s)}catch(d){this.log({message:"onNextVideoClick callback failed to execute"})}else this.playNextVideo()}]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onPrevVideoClick)==null||l.call(s)}catch(d){this.log({message:"onPrevVideoClick callback failed to execute"})}else this.playPrevVideo()}])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}moveTo(e){this.shadowDOMCallbacksDisabled=!0,e.append(this),this.shadowDOMCallbacksDisabled=!1}play(){var e,i,o,n;this.isControlDisabled("PLAY_BUTTON")||(e=this.store)!=null&&e.playerPhase.is("LiveWaitingStart")||(i=this.store)!=null&&i.playerPhase.is("LiveWaitingRecover")||(o=this.store)!=null&&o.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),(n=this.svelteRootComponent)==null||n.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)==null||e.pause()}stop(){var e;if(!this.videoConfig)return;this.log({message:"stop"});let i=!!this.interactiveController;i&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),(e=this.mediaSessionApi)==null||e.destroy();let o=this.videoConfig.videos[0];o&&(this.unmountComponent(this.svelteRootComponent),i?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(o))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)==null||i.setMuted(e)}toggleSubtitle(){var e;this.log({message:"toggle subtitle"}),(e=this.svelteRootComponent)==null||e.toggleSubtitle()}changeSubtitle(e,i){var o;this.log({message:"change subtitle"}),(o=this.svelteRootComponent)==null||o.changeSubtitle(e,i)}hideControls(){var e;this.log({message:"hide controls"}),(e=this.svelteRootComponent)==null||e.hideControls()}showControls(){var e;this.log({message:"show controls"}),(e=this.svelteRootComponent)==null||e.showControls()}setPiPEnabled(e){var i,o;(o=(i=this.store)==null?void 0:i.webApi.pictureInPictureApi)==null||o.setEnabled(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)==null||i.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(Hn)&&(r(Hn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(Hn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Hn).nextButtonActive=this.isNextButtonActive(),r(Hn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){var i;this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)==null||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)==null||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,o,n;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!=null?i:"none"}. Min: ${(o=e.min)!=null?o:"none"}`}),(n=this.svelteRootComponent)==null||n.setAutoQualityLimits(e)}setAutoQuality(){var e;(e=this.svelteRootComponent)==null||e.setAutoQuality()}toggleTrafficSaving(e){var i;(i=this.svelteRootComponent)==null||i.toggleTrafficSaving(e)}toggleHighQuality(e){var i;(i=this.svelteRootComponent)==null||i.toggleHighQuality(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)==null?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,o;this.log({message:"live started"}),(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!1),(o=this.store)==null||o.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingStart(){var e;this.log({message:"live waiting"}),(e=this.store)==null||e.actions.internal.setLiveWaitingStart(!0)}isLiveTailPlaying(){var e;let i=(e=this.store)==null?void 0:e.getPlayer();if(!i)return!1;let{info:o}=i;return o.canPlayLiveTailBuffer$.getValue()&&!o.atLiveEdge$.getValue()}setLiveWaitingRecover(e=!1){var i;let o=this.isLiveTailPlaying(),n=e||!o;this.log({message:`live waiting recover: forceImmediate = ${e}, liveTailPlaying = ${o}`});let s=()=>{var l;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!0)};n&&s(),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var l;n||s(),(l=this.store)==null||l.destroy()})}setLiveWaitingRecord(){var e;let i=this.isLiveTailPlaying(),o=!i;this.log({message:`live waiting record: liveTailPlaying = ${i}`});let n=()=>{var s;(s=this.store)==null||s.actions.internal.setLiveWaitingRecord(!0)};o&&n(),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var s;o||n(),(s=this.store)==null||s.destroy()})}setLiveEnd(e){var i;let o=this.isLiveTailPlaying(),n=!o;this.log({message:`live ended: liveTailPlaying = ${o}`});let s=()=>{var l,d;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!1),(d=this.store)==null||d.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})};if(n){s();return}(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=s)}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}setLooped(e){var i;(i=this.store)==null||i.actions.internal.setLooped(e)}getDebugData(){var e,i;return(i=(e=this.store)==null?void 0:e.actions.internal.getDebugTextData())!=null?i:""}getDeviceId(){var e,i,o;return(o=(i=(e=this.statistics)==null?void 0:e.oneStat)==null?void 0:i.getDeviceId())!=null?o:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=xe(this.store.state.positionExact$),l=xe(this.store.state.interactiveEpisodes$).find(a=>!a.completed);this.interactiveController.events.playerChanged$.pipe((0,Li.once)()).subscribe(()=>{l&&n>=l.time?this.seekTime(l.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:(o=d==null?void 0:d.chapter)==null?void 0:o.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){var o;(o=this.microStoresRoot)==null||o.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){var e;(e=this.store)==null||e.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&(this.statistics.oneStat&&this.statistics.oneStat.updateContext(e),this.statistics.thinOneStat&&this.statistics.thinOneStat.updateContext(e))}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}togglePictureInPicture(){var e;(e=this.store)==null||e.actions.internal.togglePictureInPicture()}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}restoreFocus(){var e;(e=this.focusManager)==null||e.restoreFocus()}handleExternalKeyboardEvent(e){var i,o;return!!((o=(i=this.svelteRootComponent)==null?void 0:i.keyboardControls)!=null&&o.handleExternalKeyboardEvent(e))}setAutoplayNext(e){var i;(i=this.store)==null||i.actions.internal.setAutoplayNextEnabled(e)}unmountComponent(e){e&&sa(e)}};var Bl=require("@vkontakte/videoplayer-shared/es2018"),np=require("@vkontakte/videoplayer-core/es2018"),d5=()=>{window.customElements.define("vk-video-player",ip)};
|