@vkontakte/videoplayer 1.1.61-dev.4affc441.0 → 1.1.61-dev.e1cb6686.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +4 -4
- package/es2015.esm.js +4 -4
- package/es2018.cjs.js +4 -4
- package/es2018.esm.js +4 -4
- package/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/types/VKVideoPlayer/index.svelte.d.ts +2 -1
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.61-dev.
|
|
3
|
-
* Tue, 15 Apr 2025
|
|
2
|
+
* @vkontakte/videoplayer v1.1.61-dev.e1cb6686.0
|
|
3
|
+
* Tue, 15 Apr 2025 01:45:49 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-61/doc/
|
|
5
5
|
*/
|
|
6
6
|
"use strict";var e0=Object.create;var xl=Object.defineProperty;var t0=Object.getOwnPropertyDescriptor;var i0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,n0=Object.prototype.hasOwnProperty;var nv=t=>{throw TypeError(t)};var r0=(t,e,i)=>e in t?xl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var s0=(t,e)=>{for(var i in e)xl(t,i,{get:e[i],enumerable:!0})},rv=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of i0(e))!n0.call(t,n)&&n!==i&&xl(t,n,{get:()=>e[n],enumerable:!(o=t0(e,n))||o.enumerable});return t};var sv=(t,e,i)=>(i=t!=null?e0(o0(t)):{},rv(e||!t||!t.__esModule?xl(i,"default",{value:t,enumerable:!0}):i,t)),a0=t=>rv(xl({},"__esModule",{value:!0}),t);var Un=(t,e,i)=>r0(t,typeof e!="symbol"?e+"":e,i),Mu=(t,e,i)=>e.has(t)||nv("Cannot "+i);var Si=(t,e,i)=>(Mu(t,e,"read from private field"),i?i.call(t):e.get(t)),us=(t,e,i)=>e.has(t)?nv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),xa=(t,e,i,o)=>(Mu(t,e,"write to private field"),o?o.call(t,i):e.set(t,i),i),av=(t,e,i)=>(Mu(t,e,"access private method"),i);var rx={};s0(rx,{ControlButtonType:()=>xd,GridTypes:()=>kr,InterfaceLanguage:()=>fl.InterfaceLanguage,MenuItemType:()=>Xa,PlayerPhase:()=>bs,VERSION:()=>Ys,VKNumericLanguage:()=>fl.VKNumericLanguage,VideoFormat:()=>Tu.VideoFormat,VideoQuality:()=>Tu.VideoQuality,loadVKLangPack:()=>fl.loadVKLangPack,registerPlayerWebComponent:()=>nx});module.exports=a0(rx);var ps="[",Ls="[!",Vs="]",Qr={};var Ci=Symbol(),fi=Symbol("filename"),lv=Symbol("hmr"),dv="http://www.w3.org/1999/xhtml",Lu="http://www.w3.org/2000/svg";var oc=!0;var cv,uv,Vu=(uv=(cv=globalThis.process)==null?void 0:cv.env)==null?void 0:uv.NODE_ENV;Vu||console.warn("If bundling, conditions should include development or production. If not bundling, conditions or NODE_ENV should include development or production. See https://www.npmjs.com/package/esm-env for tips on setting conditions in popular bundlers and runtimes.");var Te=Vu&&!Vu.toLowerCase().includes("prod");var zo=Symbol("$state"),Gr=Symbol("$state metadata"),wl=Symbol("legacy props"),pv=Symbol("");var yr=Array.isArray,fv=Array.prototype.indexOf,Sl=Array.from,Ru=Object.keys,io=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,nc=Object.getOwnPropertyDescriptors,Bu=Object.prototype,mv=Array.prototype,Yr=Object.getPrototypeOf;function fs(t){return typeof t=="function"}var ie=()=>{};function vv(t){return t()}function ms(t){for(var e=0;e<t.length;e++)t[e]()}var Cl=[],Nu=[];function gv(){var t=Cl;Cl=[],ms(t)}function l0(){var t=Nu;Nu=[],ms(t)}function Jo(t){Cl.length===0&&queueMicrotask(gv),Cl.push(t)}function Du(){Cl.length>0&&gv(),Nu.length>0&&l0()}function rc(t){return t===this.v}function wa(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function hv(t,e){return t!==e}function Sa(t){return!wa(t,this.v)}function _v(){if(Te){let t=new Error(`derived_references_self
|
|
@@ -45,7 +45,7 @@ ${l}in ${u}`).join("")}
|
|
|
45
45
|
`)){let n=(i=b0.exec(o))!=null?i:$0.exec(o);n&&e.push({file:n[1],line:+n[2],column:+n[3]})}return e}function ng(){var e;let t=(e=y0())==null?void 0:e.slice(4);if(!t)return null;for(let i=0;i<t.length;i++){let o=t[i],n=_0[o.file];if(!n){if(i===0)return null;continue}for(let a of n){if(a.end==null)return null;if(a.start.line<o.line&&a.end.line>o.line)return a.component}}return null}var $c=Symbol("ADD_OWNER");function op(t,e,i=!1,o=!1){if(t&&!i){let n=sn,a=t[Gr];if(a&&!np(a,n)){let s=rp(a);e&&e[fi]!==n[fi]&&!o&&Hv(n[fi],e[fi],s[fi])}}yc(t,e,new Set)}function Qu(t,e){if(e.owners!==null)for(;t;){if(t.owners===null){e.owners=null;break}for(let i of t.owners)e.owners.add(i);t=t.parent}}function yc(t,e,i){var a;let o=t==null?void 0:t[Gr];if(o)"owners"in o&&o.owners!=null&&(e?o.owners.add(e):o.owners=null);else if(t&&typeof t=="object"){if(i.has(t))return;if(i.add(t),$c in t&&t[$c])yo(()=>{t[$c](e)});else{var n=Yr(t);if(n===Object.prototype)for(let s in t)if((a=Object.getOwnPropertyDescriptor(t,s))!=null&&a.get){let d=Ci;yo(()=>{let l=t[s];d!==l&&(d=l,yc(l,e,i))})}else yc(t[s],e,i);else if(n===Array.prototype)for(let s=0;s<t.length;s+=1)yc(t[s],e,i)}}}function np(t,e){return t.owners===null?!0:t.owners.has(e)||fi in e&&[...t.owners].some(i=>i[fi]===e[fi])||t.parent!==null&&np(t.parent,e)}function rp(t){var e,i;return(i=(e=t==null?void 0:t.owners)==null?void 0:e.values().next().value)!=null?i:rp(t.parent)}var x0=!1;function Uv(t){if(x0)return;let e=ng();if(e&&!np(t,e)){let i=rp(t);i[fi]!==e[fi]?Wu(e[fi],i[fi]):Wu()}}function Va(t){if(Te){let e=new Error(`lifecycle_outside_component
|
|
46
46
|
\`${t}(...)\` can only be used during component initialisation
|
|
47
47
|
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var Tt=null;function Rl(t){Tt=t}var sn=null;function Bl(t){sn=t}function Ra(t){return sp("getContext").get(t)}function Ba(t,e){let i=sp("setContext");return Te&&bt(()=>op(e,null,!0)),i.set(t,e),e}function Dl(){return sp("getAllContexts")}function q(t,e=!1,i){var o=Tt={p:Tt,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};Dr&&!e&&(Tt.l={s:null,u:null,r1:[],r2:Di(!1)}),an(()=>{o.d=!0}),Te&&(Tt.function=i,sn=i)}function K(t){var s,d;let e=Tt;if(e!==null){t!==void 0&&(e.x=t);let l=e.e;if(l!==null){var i=yt,o=Vt;e.e=null;try{for(var n=0;n<l.length;n++){var a=l[n];oo(a.effect),bo(a.reaction),$n(a.fn)}}finally{oo(i),bo(o)}}Tt=e.p,Te&&(sn=(d=(s=e.p)==null?void 0:s.function)!=null?d:null),e.m=!0}return t||{}}function Hr(){return!Dr||Tt!==null&&Tt.l===null}function sp(t){var e;return Tt===null&&Va(t),(e=Tt.c)!=null?e:Tt.c=new Map(S0(Tt)||void 0)}function S0(t){let e=t.p;for(;e!==null;){let i=e.c;if(i!==null)return i;e=e.p}return null}var C0=/\r/g;function rg(t){t=t.replace(C0,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function sg(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var T0=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function ag(t){return T0.includes(t)}var I0=["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 k0={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 lg(t){var e;return t=t.toLowerCase(),(e=k0[t])!=null?e:t}var rw=[...I0,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var E0=["touchstart","touchmove"];function dg(t){return E0.includes(t)}var A0=["textarea","script","style","title"];function cg(t){return A0.includes(t)}function ap(t){return t==null?void 0:t.replace(/\//g,"/\u200B")}var ug=new Map;function pg(t,e){var i=ug.get(t);i||(i=new Set,ug.set(t,i)),i.add(e)}function lp(t,e){if(e){let i=document.body;t.autofocus=!0,Jo(()=>{document.activeElement===i&&t.focus()})}}function Ol(t){var e=Vt,i=yt;bo(null),oo(null);try{return t()}finally{bo(e),oo(i)}}var dp=new Set,xc=new Set;function qs(t){if(!Ye)return;t.onload&&t.removeAttribute("onload"),t.onerror&&t.removeAttribute("onerror");let e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function cp(t,e,i,o={}){function n(a){if(o.capture||Na.call(e,a),!a.cancelBubble)return Ol(()=>i==null?void 0:i.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Jo(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function Et(t,e,i,o,n){var a={capture:o,passive:n},s=cp(t,e,i,a);(e===document.body||e===window||e===document)&&an(()=>{e.removeEventListener(t,s,a)})}function at(t){for(var e=0;e<t.length;e++)dp.add(t[e]);for(var i of xc)i(t)}function Na(t){var A;var e=this,i=e.ownerDocument,o=t.type,n=((A=t.composedPath)==null?void 0:A.call(t))||[],a=n[0]||t.target,s=0,d=t.__root;if(d){var l=n.indexOf(d);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var p=n.indexOf(e);if(p===-1)return;l<=p&&(s=l)}if(a=n[s]||t.target,a!==e){io(t,"currentTarget",{configurable:!0,get(){return a||i}});var f=Vt,_=yt;bo(null),oo(null);try{for(var u,$=[];a!==null;){var w=a.assignedSlot||a.parentNode||a.host||null;try{var y=a["__"+o];if(y!=null&&(!a.disabled||t.target===a))if(yr(y)){var[S,...I]=y;S.apply(a,[t,...I])}else y.call(a,t)}catch(P){u?$.push(P):u=P}if(t.cancelBubble||w===e||w===null)break;a=w}if(u){for(let P of $)queueMicrotask(()=>{throw P});throw u}}finally{t.__root=e,delete t.currentTarget,bo(f),oo(_)}}}var M0;function fg(){M0=void 0}function Da(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function xo(t,e){var i=yt;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function L(t,e){var i=(e&1)!==0,o=(e&2)!==0,n,a=!t.startsWith("<!>");return()=>{if(Ye)return xo(pt,null),pt;n===void 0&&(n=Da(a?t:"<!>"+t),i||(n=vi(n)));var s=o||El?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=vi(s),l=s.lastChild;xo(d,l)}else xo(s,s);return s}}function be(t,e,i="svg"){var o=!t.startsWith("<!>"),n=(e&1)!==0,a=`<${i}>${o?t:"<!>"+t}</${i}>`,s;return()=>{if(Ye)return xo(pt,null),pt;if(!s){var d=Da(a),l=vi(d);if(n)for(s=document.createDocumentFragment();vi(l);)s.appendChild(vi(l));else s=vi(l)}var p=s.cloneNode(!0);if(n){var f=vi(p),_=p.lastChild;xo(f,_)}else xo(p,p);return p}}function or(t=""){if(!Ye){var e=nn(t+"");return xo(e,e),e}var i=pt;return i.nodeType!==3&&(i.before(i=nn()),mi(i)),xo(i,i),i}function ze(){if(Ye)return xo(pt,null),pt;var t=document.createDocumentFragment(),e=document.createComment(""),i=nn();return t.append(e,i),xo(e,i),t}function b(t,e){if(Ye){yt.nodes_end=pt,Pi();return}t!==null&&t.before(e)}var Hl=!0;function wc(t){Hl=t}function fe(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 ts(t,e){return vg(t,e)}function pp(t,e){var s;cc(),e.intro=(s=e.intro)!=null?s:!1;let i=e.target,o=Ye,n=pt;try{for(var a=vi(i);a&&(a.nodeType!==8||a.data!==ps);)a=Lo(a);if(!a)throw Qr;ro(!0),mi(a),Pi();let d=vg(t,{...e,anchor:a});if(pt===null||pt.nodeType!==8||pt.data!==Vs)throw Hs(),Qr;return ro(!1),d}catch(d){if(d===Qr)return e.recover===!1&&wv(),cc(),Al(i),ro(!1),ts(t,e);throw d}finally{ro(o),mi(n),fg()}}var Oa=new Map;function vg(t,{target:e,anchor:i,props:o={},events:n,context:a,intro:s=!0}){cc();var d=new Set,l=_=>{for(var u=0;u<_.length;u++){var $=_[u];if(!d.has($)){d.add($);var w=dg($);e.addEventListener($,Na,{passive:w});var y=Oa.get($);y===void 0?(document.addEventListener($,Na,{passive:w}),Oa.set($,1)):Oa.set($,y+1)}}};l(Sl(dp)),xc.add(l);var p=void 0,f=ig(()=>{var _=i!=null?i:e.appendChild(nn());return Oi(()=>{if(a){q({});var u=Tt;u.c=a}n&&(o.$$events=n),Ye&&xo(_,null),Hl=s,p=t(_,o)||{},Hl=!0,Ye&&(yt.nodes_end=pt),a&&K()}),()=>{var w;for(var u of d){e.removeEventListener(u,Na);var $=Oa.get(u);--$===0?(document.removeEventListener(u,Na),Oa.delete(u)):Oa.set(u,$)}xc.delete(l),_!==i&&((w=_.parentNode)==null||w.removeChild(_))}});return up.set(p,f),p}var up=new WeakMap;function Ks(t,e){let i=up.get(t);return i?(up.delete(t),i(e)):(Te&&Ov(),Promise.resolve())}function B(t,e,[i,o]=[0,0]){Ye&&i===0&&Pi();var n=t,a=null,s=null,d=Ci,l=i>0?65536:0,p=!1;let f=(u,$=!0)=>{p=!0,_($,u)},_=(u,$)=>{if(d===(d=u))return;let w=!1;if(Ye&&o!==-1){if(i===0){let S=n.data;S===ps?o=0:S===Ls?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let y=o>i;!!d===y&&(n=Ea(),mi(n),ro(!1),w=!0,o=-1)}d?(a?es(a):$&&(a=Oi(()=>$(n))),s&&yn(s,()=>{s=null})):(s?es(s):$&&(s=Oi(()=>$(n,[i+1,o]))),a&&yn(a,()=>{a=null})),w&&ro(!0)};so(()=>{p=!1,e(f),p||_(null,null)},l),Ye&&(n=pt)}function Fl(t,e,i){Ye&&Pi();var o=t,n=Ci,a,s=Hr()?hv:wa;so(()=>{s(n,n=e())&&(a&&yn(a),a=Oi(()=>i(o)))}),Ye&&(o=pt)}var hs=null;function vp(t){hs=t}function Ul(t,e){return e}function B0(t,e,i,o){for(var n=[],a=e.length,s=0;s<a;s++)bc(e[s].e,n,!0);var d=a>0&&n.length===0&&i!==null;if(d){var l=i.parentNode;Al(l),l.append(i),o.clear(),gs(t,e[0].prev,e[a-1].next)}ip(n,()=>{for(var p=0;p<a;p++){var f=e[p];d||(o.delete(f.k),gs(t,f.prev,f.next)),no(f.e,!d)}})}function $i(t,e,i,o,n,a=null){var s=t,d={flags:e,items:new Map,first:null},l=(e&4)!==0;if(l){var p=t;s=Ye?mi(vi(p)):p.appendChild(nn())}Ye&&Pi();var f=null,_=!1,u=Sr(()=>{var $=i();return yr($)?$:$==null?[]:Sl($)});so(()=>{var $=r(u),w=$.length;if(_&&w===0)return;_=w===0;let y=!1;if(Ye){var S=s.data===Ls;S!==(w===0)&&(s=Ea(),mi(s),ro(!1),y=!0)}if(Ye){for(var I=null,A,P=0;P<w;P++){if(pt.nodeType===8&&pt.data===Vs){s=pt,y=!0,ro(!1);break}var E=$[P],T=o(E,P);A=_g(pt,d,I,null,E,T,P,n,e,i),d.items.set(T,A),I=A}w>0&&mi(Ea())}Ye||N0($,d,s,n,e,o,i),a!==null&&(w===0?f?es(f):f=Oi(()=>a(s)):f!==null&&yn(f,()=>{f=null})),y&&ro(!0),r(u)}),Ye&&(s=pt)}function N0(t,e,i,o,n,a,s){var le,Le,Re,X;var d=(n&8)!==0,l=(n&3)!==0,p=t.length,f=e.items,_=e.first,u=_,$,w=null,y,S=[],I=[],A,P,E,T;if(d)for(T=0;T<p;T+=1)A=t[T],P=a(A,T),E=f.get(P),E!==void 0&&((le=E.a)==null||le.measure(),(y!=null?y:y=new Set).add(E));for(T=0;T<p;T+=1){if(A=t[T],P=a(A,T),E=f.get(P),E===void 0){var R=u?u.e.nodes_start:i;w=_g(R,e,w,w===null?e.first:w.next,A,P,T,o,n,s),f.set(P,w),S=[],I=[],u=w.next;continue}if(l&&D0(E,A,T,n),(E.e.f&8192)!==0&&(es(E.e),d&&((Le=E.a)==null||Le.unfix(),(y!=null?y:y=new Set).delete(E))),E!==u){if($!==void 0&&$.has(E)){if(S.length<I.length){var z=I[0],Y;w=z.prev;var U=S[0],Z=S[S.length-1];for(Y=0;Y<S.length;Y+=1)gg(S[Y],z,i);for(Y=0;Y<I.length;Y+=1)$.delete(I[Y]);gs(e,U.prev,Z.next),gs(e,w,U),gs(e,Z,z),u=z,w=Z,T-=1,S=[],I=[]}else $.delete(E),gg(E,u,i),gs(e,E.prev,E.next),gs(e,E,w===null?e.first:w.next),gs(e,w,E),w=E;continue}for(S=[],I=[];u!==null&&u.k!==P;)(u.e.f&8192)===0&&($!=null?$:$=new Set).add(u),I.push(u),u=u.next;if(u===null)continue;E=u}S.push(E),w=E,u=E.next}if(u!==null||$!==void 0){for(var J=$===void 0?[]:Sl($);u!==null;)(u.e.f&8192)===0&&J.push(u),u=u.next;var oe=J.length;if(oe>0){var ce=(n&4)!==0&&p===0?i:null;if(d){for(T=0;T<oe;T+=1)(Re=J[T].a)==null||Re.measure();for(T=0;T<oe;T+=1)(X=J[T].a)==null||X.fix()}B0(e,J,ce,f)}}d&&Jo(()=>{var Me;if(y!==void 0)for(E of y)(Me=E.a)==null||Me.apply()}),yt.first=e.first&&e.first.e,yt.last=w&&w.e}function D0(t,e,i,o){(o&1)!==0&&Ta(t.v,e),(o&2)!==0?Ta(t.i,i):t.i=i}function _g(t,e,i,o,n,a,s,d,l,p){var f=hs,_=(l&1)!==0,u=(l&16)===0,$=_?u?Xr(n):Di(n):n,w=(l&2)===0?s:Di(s);Te&&_&&($.debug=()=>{var S=typeof w=="number"?s:w.v;p()[S]});var y={i:w,v:$,k:a,a:null,e:null,prev:i,next:o};hs=y;try{return y.e=Oi(()=>d(t,$,w,p),Ye),y.e.prev=i&&i.e,y.e.next=o&&o.e,i===null?e.first=y:(i.next=y,i.e.next=y.e),o!==null&&(o.prev=y,o.e.prev=y.e),y}finally{hs=f}}function gg(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,a=t.e.nodes_start;a!==o;){var s=Lo(a);n.before(a),a=s}}function gs(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 O0(t,e,i){var a,s;if(!e||e===rg(String(i!=null?i:"")))return;let o,n=(a=t.__svelte_meta)==null?void 0:a.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:(s=sn)!=null&&s[fi]&&(o=`in ${sn[fi]}`),Dv(ap(o))}function zl(t,e,i,o,n){var a=t,s="",d;so(()=>{var l;if(s===(s=(l=e())!=null?l:"")){Ye&&Pi();return}d!==void 0&&(no(d),d=void 0),s!==""&&(d=Oi(()=>{if(Ye){for(var p=pt.data,f=Pi(),_=f;f!==null&&(f.nodeType!==8||f.data!=="");)_=f,f=Lo(f);if(f===null)throw Hs(),Qr;Te&&!n&&O0(f.parentNode,p,s),xo(pt,_),a=mi(f);return}var u=s+"";i?u=`<svg>${u}</svg>`:o&&(u=`<math>${u}</math>`);var $=Da(u);if((i||o)&&($=vi($)),xo(vi($),$.lastChild),i||o)for(;vi($);)a.before(vi($));else a.before($)}))})}function me(t,e,...i){var o=t,n=ie,a;so(()=>{n!==(n=e())&&(a&&(no(a),a=null),Te&&n==null&&Sv(),a=Oi(()=>n(o,...i)))},65536),Ye&&(o=pt)}function Mi(t,e,i){Ye&&Pi();var o=t,n,a;so(()=>{n!==(n=e())&&(a&&(yn(a),a=null),n&&(a=Oi(()=>i(o,n))))},65536),Ye&&(o=pt)}function ql(t,e,i,o,n,a){var w;let s=Ye;Ye&&Pi();var d=Te&&a&&((w=Tt)==null?void 0:w.function[fi]),l,p,f=null;Ye&&pt.nodeType===1&&(f=pt,Pi());var _=Ye?pt:t,u,$=hs;so(()=>{let y=e()||null;var S=n?n():i||y==="svg"?Lu:null;if(y!==l){var I=hs;vp($),u&&(y===null?yn(u,()=>{u=null,p=null}):y===p?es(u):(no(u),wc(!1))),y&&y!==p&&(u=Oi(()=>{if(f=Ye?f:S?document.createElementNS(S,y):document.createElement(y),Te&&a&&(f.__svelte_meta={loc:{file:d,line:a[0],column:a[1]}}),xo(f,f),o){Ye&&cg(y)&&f.append(document.createComment(""));var A=Ye?vi(f):f.appendChild(nn());Ye&&(A===null?ro(!1):mi(A)),o(f,A)}yt.nodes_end=f,_.before(f)})),l=y,l&&(p=l),wc(!0),vp(I)}},65536),s&&(ro(!0),mi(_))}var hp;function bg(t){return hp=t.target,new gp(t)}var is,nr,gp=class{constructor(e){us(this,is);us(this,nr);var a,s;var i=new Map,o=(d,l)=>{var p=Xr(l);return i.set(d,p),p};let n=new Proxy({...e.props||{},$$events:{}},{get(d,l){var p;return r((p=i.get(l))!=null?p:o(l,Reflect.get(d,l)))},has(d,l){var p;return l===wl?!0:(r((p=i.get(l))!=null?p:o(l,Reflect.get(d,l))),Reflect.has(d,l))},set(d,l,p){var f;return O((f=i.get(l))!=null?f:o(l,p),p),Reflect.set(d,l,p)}});xa(this,nr,(e.hydrate?pp:ts)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(a=e.intro)!=null?a:!1,recover:e.recover})),(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&Ma(),xa(this,is,n.$$events);for(let d of Object.keys(Si(this,nr)))d==="$set"||d==="$destroy"||d==="$on"||io(this,d,{get(){return Si(this,nr)[d]},set(l){Si(this,nr)[d]=l},enumerable:!0});Si(this,nr).$set=d=>{Object.assign(n,d)},Si(this,nr).$destroy=()=>{Ks(Si(this,nr))}}$set(e){Si(this,nr).$set(e)}$on(e,i){Si(this,is)[e]=Si(this,is)[e]||[];let o=(...n)=>i.call(this,...n);return Si(this,is)[e].push(o),()=>{Si(this,is)[e]=Si(this,is)[e].filter(n=>n!==o)}}$destroy(){Si(this,nr).$destroy()}};is=new WeakMap,nr=new WeakMap;function Q(t,e){Jo(()=>{var n,a,s;var i=t.getRootNode(),o=i.host?i:(s=(n=i.head)!=null?n:i.ownerDocument.head)!=null?s:(a=hp)==null?void 0:a.parentNode;if(!(o!=null&&o.querySelector("#"+e.hash))){let d=document.createElement("style");d.id=e.hash,d.textContent=e.code,o.appendChild(d),Te&&pg(e.hash,d)}})}function $g(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=$g(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function yg(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=$g(t))&&(o&&(o+=" "),o+=e);return o}function Kl(t){return typeof t=="object"?yg(t):t!=null?t:""}var xg=[...`
|
|
48
|
-
\r\f\xA0\v\uFEFF`];function Sg(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 a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||xg.includes(o[s-1]))&&(d===o.length||xg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function wg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function _p(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Cg(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 a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(_p)),n&&l.push(...Object.keys(n).map(_p));var p=0,f=-1;let y=t.length;for(var _=0;_<y;_++){var u=t[_];if(d?u==="/"&&t[_-1]==="*"&&(d=!1):a?a===u&&(a=!1):u==="/"&&t[_+1]==="*"?d=!0:u==='"'||u==="'"?a=u:u==="("?s++:u===")"&&s--,!d&&a===!1&&s===0){if(u===":"&&f===-1)f=_;else if(u===";"||_===y-1){if(f!==-1){var $=_p(t.substring(p,f).trim());if(!l.includes($)){u!==";"&&_++;var w=t.substring(p,_).trim();i+=" "+w+";"}}p=_+1,f=-1}}}}return o&&(i+=wg(o)),n&&(i+=wg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function te(t,e,i,o,n,a){var s=t.__className;if(Ye||s!==i){var d=Sg(i,o,a);(!Ye||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var p=!!a[l];(n==null||p!==!!n[l])&&t.classList.toggle(l,p)}return a}function bp(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function nt(t,e,i,o){var n=t.__style;if(Ye||n!==e){var a=Cg(e,o);(!Ye||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(bp(t,i==null?void 0:i[0],o[0]),bp(t,i==null?void 0:i[1],o[1],"important")):bp(t,i,o));return o}var Ha=Symbol("class"),Fa=Symbol("style"),kg=Symbol("is custom element"),Eg=Symbol("is html");function Ag(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function De(t,e,i,o){var n=Pg(t);if(Ye&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||W0(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[pv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Mg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Se(t,e,i,o,n=!1){var E;var a=Pg(t),s=a[kg],d=!a[Eg];let l=Ye&&s;l&&ro(!1);var p=e||{},f=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Kl(i.class):(o||i[Ha])&&(i.class=null),i[Fa]&&((E=i.style)!=null||(i.style=null));var u=Mg(t);for(let T in i){let R=i[T];if(f&&T==="value"&&R==null){t.value=t.__value="",p[T]=R;continue}if(T==="class"){var $=t.namespaceURI==="http://www.w3.org/1999/xhtml";te(t,$,R,o,e==null?void 0:e[Ha],i[Ha]),p[T]=R,p[Ha]=i[Ha];continue}if(T==="style"){nt(t,R,e==null?void 0:e[Fa],i[Fa]),p[T]=R,p[Fa]=i[Fa];continue}var w=p[T];if(R!==w){p[T]=R;var y=T[0]+T[1];if(y!=="$$")if(y==="on"){let z={},Y="$$"+T,U=T.slice(2);var S=ag(U);if(sg(U)&&(U=U.slice(0,-7),z.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(U,p[Y],z),p[Y]=null}if(R!=null)if(S)t[`__${U}`]=R,at([U]);else{let Z=function(J){p[T].call(this,J)};var P=Z;p[Y]=cp(U,t,Z,z)}else S&&(t[`__${U}`]=void 0)}else if(T==="style")De(t,T,R);else if(T==="autofocus")lp(t,!!R);else if(!s&&(T==="__value"||T==="value"&&R!=null))t.value=t.__value=R;else if(T==="selected"&&f)Ag(t,R);else{var I=T;d||(I=lg(I));var A=I==="defaultValue"||I==="defaultChecked";if(R==null&&!s&&!A)if(a[T]=null,I==="value"||I==="checked"){let z=t,Y=e===void 0;if(I==="value"){let U=z.defaultValue;z.removeAttribute(I),z.defaultValue=U,z.value=z.__value=Y?U:null}else{let U=z.defaultChecked;z.removeAttribute(I),z.defaultChecked=U,z.checked=Y?U:!1}}else t.removeAttribute(T);else A||u.includes(I)&&(s||typeof R!="string")?t[I]=R:typeof R!="function"&&De(t,I,R,n)}}}return l&&ro(!0),p}function Pg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[kg]:t.nodeName.includes("-"),[Eg]:t.namespaceURI===dv}}var Tg=new Map;function Mg(t){var e=Tg.get(t.nodeName);if(e)return e;Tg.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=nc(o);for(var a in i)i[a].set&&e.push(a);o=Yr(o)}return e}function W0(t,e,i){var o;Te&&(e==="srcset"&&Q0(t,i)||$p((o=t.getAttribute(e))!=null?o:"",i)||Nv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function $p(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Ig(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Q0(t,e){var i=Ig(t.srcset),o=Ig(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&($p(i[s][0],n)||$p(n,i[s][0])))}var G0=oc?()=>performance.now():()=>Date.now(),Tr={tick:t=>(oc?requestAnimationFrame:ie)(t),now:()=>G0(),tasks:new Set};function Lg(){let t=Tr.now();Tr.tasks.forEach(e=>{e.c(t)||(Tr.tasks.delete(e),e.f())}),Tr.tasks.size!==0&&Tr.tick(Lg)}function Vg(t){let e;return Tr.tasks.size===0&&Tr.tick(Lg),{promise:new Promise(i=>{Tr.tasks.add(e={c:t,f:i})}),abort(){Tr.tasks.delete(e)}}}function Sc(t,e){Ol(()=>{t.dispatchEvent(new CustomEvent(e))})}function X0(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 Rg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=X0(n.trim());e[s]=a.trim()}return e}var J0=t=>t;function xp(t,e,i,o){var P;var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",p,f=e.inert,_=e.style.overflow,u,$;function w(){var R;var E=Vt,T=yt;bo(null),oo(null);try{return p!=null?p:p=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:l})}finally{bo(E),oo(T)}}var y={is_global:d,in(){var E;if(e.inert=f,!n){$==null||$.abort(),(E=$==null?void 0:$.reset)==null||E.call($);return}a||u==null||u.abort(),Sc(e,"introstart"),u=yp(e,w(),$,1,()=>{Sc(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=_})},out(E){if(!a){E==null||E(),p=void 0;return}e.inert=!0,Sc(e,"outrostart"),$=yp(e,w(),u,0,()=>{Sc(e,"outroend"),E==null||E()})},stop:()=>{u==null||u.abort(),$==null||$.abort()}},S=yt;if(((P=S.transitions)!=null?P:S.transitions=[]).push(y),n&&Hl){var I=d;if(!I){for(var A=S.parent;A&&(A.f&65536)!==0;)for(;(A=A.parent)&&(A.f&16)===0;);I=!A||(A.f&32768)!==0}I&&$n(()=>{bt(()=>y.in())})}}function yp(t,e,i,o,n){var a=o===1;if(fs(e)){var s,d=!1;return Jo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=yp(t,S,i,o,n)}}),{abort:()=>{d=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:ie,deactivate:ie,reset:ie,t:()=>o};let{delay:l=0,css:p,tick:f,easing:_=J0}=e;var u=[];if(a&&i===void 0&&(f&&f(0,1),p)){var $=Rg(p(0,1));u.push($,$)}var w=()=>1-o,y=t.animate(u,{duration:l});return y.onfinish=()=>{var U;var S=(U=i==null?void 0:i.t())!=null?U:1-o;i==null||i.abort();var I=o-S,A=e.duration*Math.abs(I),P=[];if(A>0){var E=!1;if(p)for(var T=Math.ceil(A/16.666666666666668),R=0;R<=T;R+=1){var z=S+I*_(R/T),Y=Rg(p(z,1-z));P.push(Y),E||(E=Y.overflow==="hidden")}E&&(t.style.overflow="hidden"),w=()=>{var Z=y.currentTime;return S+I*_(Z/A)},f&&Vg(()=>{if(y.playState!=="running")return!1;var Z=w();return f(Z,1-Z),!0})}y=t.animate(P,{duration:A,fill:"forwards"}),y.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=ie)},deactivate:()=>{n=ie},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var _s,Ua,Wl,Tc,Bg,Ic=class Ic{constructor(e){us(this,Tc);us(this,_s,new WeakMap);us(this,Ua);us(this,Wl);xa(this,Wl,e)}observe(e,i){var o=Si(this,_s).get(e)||new Set;return o.add(i),Si(this,_s).set(e,o),av(this,Tc,Bg).call(this).observe(e,Si(this,Wl)),()=>{var n=Si(this,_s).get(e);n.delete(i),n.size===0&&(Si(this,_s).delete(e),Si(this,Ua).unobserve(e))}}};_s=new WeakMap,Ua=new WeakMap,Wl=new WeakMap,Tc=new WeakSet,Bg=function(){var e;return(e=Si(this,Ua))!=null?e:xa(this,Ua,new ResizeObserver(i=>{for(var o of i){Ic.entries.set(o.target,o);for(var n of Si(this,_s).get(o.target)||[])n(o)}}))},Un(Ic,"entries",new WeakMap);var wp=Ic;var i_=new wp({box:"border-box"});function Fr(t,e,i){var o=i_.observe(t,()=>i(t[e]));$n(()=>(bt(()=>i(t[e])),o))}function Ng(t,e){return t===e||(t==null?void 0:t[zo])===e}function dt(t={},e,i,o){return $n(()=>{var n,a;return yo(()=>{n=a,a=(o==null?void 0:o())||[],bt(()=>{t!==i(...a)&&(e(t,...a),n&&Ng(i(...n),t)&&e(null,...n))})}),()=>{Jo(()=>{a&&Ng(i(...a),t)&&e(null,...a)})}}),t}function Ir(t=!1){let e=Tt,i=e.l.u;if(!i)return;let o=()=>gc(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let p in l)l[p]!==a[p]&&(a[p]=l[p],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&La(()=>{Dg(e,o),ms(i.b)}),Ze(()=>{let n=bt(()=>i.m.map(vv));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Ze(()=>{Dg(e,o),ms(i.a)})}function Dg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if(Te){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Iv(e)},set:o=>{i=o}})}};n_=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var n_;function Ot(t){Tt===null&&Va("onMount"),Dr&&Tt.l!==null?o_(Tt).m.push(t):Ze(()=>{let e=bt(t);if(typeof e=="function")return e})}function xn(t){Tt===null&&Va("onDestroy"),Ot(()=>()=>bt(t))}function o_(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}function Ql(t,e,i){if(t==null)return e(void 0),i&&i(void 0),ie;let o=bt(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var za=[];function rr(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=ie){let i=null,o=new Set;function n(d){if(wa(t,d)&&(t=d,i)){let l=!za.length;for(let p of o)p[1](),za.push(p,t);if(l){for(let p=0;p<za.length;p+=2)za[p][0](za[p+1]);za.length=0}}}function a(d){n(d(t))}function s(d,l=ie){let p=[d,l];return o.add(p),o.size===1&&(i=e(n,a)||ie),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function gi(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 a=e.length<2;return rr(i,(s,d)=>{let l=!1,p=[],f=0,_=ie,u=()=>{if(f)return;_();let w=e(o?p[0]:p,s,d);a?s(w):_=typeof w=="function"?w:ie},$=n.map((w,y)=>Ql(w,S=>{p[y]=S,f&=~(1<<y),l&&u()},()=>{f|=1<<y}));return l=!0,u(),function(){ms($),_(),l=!1}})}function we(t){let e;return Ql(t,i=>e=i)(),e}var kc=!1,Sp=Symbol();function C(t,e,i){var a;let o=(a=i[e])!=null?a:i[e]={store:null,source:Xr(void 0),unsubscribe:ie};if(o.store!==t&&!(Sp in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=ie;else{var n=!0;o.unsubscribe=Ql(t,s=>{n?o.source.v=s:O(o.source,s)}),n=!1}return t&&Sp in i?we(t):r(o.source)}function Fe(){let t={};function e(){an(()=>{for(var i in t)t[i].unsubscribe();io(t,Sp,{enumerable:!1,value:!0})})}return[t,e]}function Cp(t){var e=kc;try{return kc=!1,[t(),kc]}finally{kc=e}}var u_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Te&&Tv(`${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 ke(t,e,i){return new Proxy(Te?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},u_)}var p_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(fs(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];fs(n)&&(n=n());let a=zn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(fs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=zn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===zo||e===wl)return!1;for(let i of t.props)if(fs(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){fs(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function os(...t){return new Proxy({props:t},p_)}function Og(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function v(t,e,i,o){var z,Y;var n=(i&1)!==0,a=!Dr||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,p;s?[p,l]=Cp(()=>t[e]):p=t[e];var f=zo in t||wl in t,_=s&&((Y=(z=zn(t,e))==null?void 0:z.set)!=null?Y:f&&e in t&&(U=>t[e]=U))||void 0,u=o,$=!0,w=!1,y=()=>(w=!0,$&&($=!1,d?u=bt(o):u=o),u);p===void 0&&o!==void 0&&(_&&a&&Cv(e),p=y(),_&&_(p));var S;if(a)S=()=>{var U=t[e];return U===void 0?y():($=!0,w=!1,U)};else{var I=(n?m:Sr)(()=>t[e]);I.f|=131072,S=()=>{var U=r(I);return U!==void 0&&(u=void 0),U===void 0?u:U}}if((i&4)===0)return S;if(_){var A=t.$$legacy;return function(U,Z){return arguments.length>0?((!a||!Z||A||l)&&_(Z?S():U),U):S()}}var P=!1,E=!1,T=Xr(p),R=m(()=>{var U=S(),Z=r(T);return P?(P=!1,E=!0,Z):(E=!1,T.v=U)});return s&&r(R),n||(R.equals=Sa),function(U,Z){if(Il!==null&&(P=E,S(),r(T)),arguments.length>0){let J=Z?r(R):a&&s?he(U):U;if(!R.equals(J)){if(P=!0,O(T,J),w&&u!==void 0&&(u=J),Og(R))return U;bt(()=>r(R))}return U}return Og(R)?R.v:r(R)}}var f_;typeof HTMLElement=="function"&&(f_=class extends HTMLElement{constructor(e,i,o){super();Un(this,"$$ctor");Un(this,"$$s");Un(this,"$$c");Un(this,"$$cn",!1);Un(this,"$$d",{});Un(this,"$$r",!1);Un(this,"$$p_d",{});Un(this,"$$l",{});Un(this,"$$l_u",new Map);Un(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(a){return s=>{let d=document.createElement("slot");a!=="default"&&(d.name=a),b(s,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=m_(this);for(let a of this.$$s)a in n&&(a==="default"&&!this.$$d.children?(this.$$d.children=i(a),o.default=!0):o[a]=i(a));for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=Tp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=bg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=_c(()=>{yo(()=>{var a;this.$$r=!0;for(let s of Ru(this.$$c)){if(!((a=this.$$p_d[s])!=null&&a.reflect))continue;this.$$d[s]=this.$$c[s];let d=Tp(s,this.$$d[s],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,d)}this.$$r=!1})});for(let a in this.$$l)for(let s of this.$$l[a]){let d=this.$$c.$on(a,s);this.$$l_u.set(s,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Tp(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 Ru(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function Tp(t,e,i,o){var a;let n=(a=i[t])==null?void 0:a.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 m_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Hg="5";var Fg,Ug,zg;typeof window!="undefined"&&((zg=(Ug=(Fg=window.__svelte)!=null?Fg:window.__svelte={}).v)!=null?zg:Ug.v=new Set).add(Hg);var H1=require("@vkontakte/videoplayer-core/es2018"),HW=require("@vkontakte/videoplayer-core/es2018"),ha=require("@vkontakte/videoplayer-shared/es2018"),F1=require("@vkontakte/videoplayer-statistics/es2018");var Ws=require("@vkontakte/videoplayer-shared/es2018");var g_={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:Ws.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:Ws.VideoQuality.Q_480P,highQualityLimit:Ws.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,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,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,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,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!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},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}},qg=t=>(0,Ws.fillWithDefault)(t,g_),Kg=t=>Ba("ui-config",t),Kt=()=>Ra("ui-config");var Gl="vk_player_debug_panel_opened";var Wg="videoplayer",Qg="videoplayer";var Ur={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Gg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Yg=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),jg=new Set(["ShiftRight","ShiftLeft"]);var Zg=["TIMELINE"],Yl=[...Zg,"GRAPH_BUTTON"],Ip=[...Zg,"PLAY_BUTTON"],jl=[...Yl,"PLAY_BUTTON"];var kr=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(kr||{}),Gs={xs:0,s:1,m:2,l:3,xl:4};var Zl=require("@vkontakte/videoplayer-shared/es2018"),Xg=require("@vkontakte/videoplayer-core/es2018"),Jg=require("@vkontakte/videoplayer-statistics/es2018");var Ec="prod",Ys="1.1.61-dev.4affc441.0";var js=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var eh=Symbol("storeContext"),th=Symbol("microStoresContext"),ih=(t,e)=>{Ba(eh,t),Ba(th,e),Ec==="dev"&&(window.app={store:t,microStores:e})},Ie=()=>{let t=Ra(eh);return(0,Zl.assertNonNullable)(t,"Store context is empty!"),t},ao=()=>{let t=Ra(th);return(0,Zl.assertNonNullable)(t,"MicroStores context is empty!"),t},Wt=(t,e)=>Pc(t,t.getValue(),e),Pc=(t,e,i)=>rr(e,o=>{let n=t.subscribe(a=>{o(a),i==null||i(a)});return()=>n.unsubscribe()}),oh=(t,e,i)=>{var I,A,P,E,T,R;let o=t.info,{width:n,height:a}=we(i.ui.playerSize),s=(A=(I=o.throughputEstimation$.getValue())==null?void 0:I.toFixed(0))!=null?A:0,d=(E=(P=o.rttEstimation$.getValue())==null?void 0:P.toFixed(0))!=null?E:0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",p=`${Ys} (core: ${Xg.VERSION}, stat: ${Jg.VERSION}, shared: ${Zl.VERSION})`,f=we(i.state.errorLog$),_=f.length?`
|
|
48
|
+
\r\f\xA0\v\uFEFF`];function Sg(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 a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||xg.includes(o[s-1]))&&(d===o.length||xg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function wg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function _p(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Cg(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 a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(_p)),n&&l.push(...Object.keys(n).map(_p));var p=0,f=-1;let y=t.length;for(var _=0;_<y;_++){var u=t[_];if(d?u==="/"&&t[_-1]==="*"&&(d=!1):a?a===u&&(a=!1):u==="/"&&t[_+1]==="*"?d=!0:u==='"'||u==="'"?a=u:u==="("?s++:u===")"&&s--,!d&&a===!1&&s===0){if(u===":"&&f===-1)f=_;else if(u===";"||_===y-1){if(f!==-1){var $=_p(t.substring(p,f).trim());if(!l.includes($)){u!==";"&&_++;var w=t.substring(p,_).trim();i+=" "+w+";"}}p=_+1,f=-1}}}}return o&&(i+=wg(o)),n&&(i+=wg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function te(t,e,i,o,n,a){var s=t.__className;if(Ye||s!==i){var d=Sg(i,o,a);(!Ye||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var p=!!a[l];(n==null||p!==!!n[l])&&t.classList.toggle(l,p)}return a}function bp(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function nt(t,e,i,o){var n=t.__style;if(Ye||n!==e){var a=Cg(e,o);(!Ye||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(bp(t,i==null?void 0:i[0],o[0]),bp(t,i==null?void 0:i[1],o[1],"important")):bp(t,i,o));return o}var Ha=Symbol("class"),Fa=Symbol("style"),kg=Symbol("is custom element"),Eg=Symbol("is html");function Ag(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function De(t,e,i,o){var n=Pg(t);if(Ye&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||W0(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[pv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Mg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Se(t,e,i,o,n=!1){var E;var a=Pg(t),s=a[kg],d=!a[Eg];let l=Ye&&s;l&&ro(!1);var p=e||{},f=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Kl(i.class):(o||i[Ha])&&(i.class=null),i[Fa]&&((E=i.style)!=null||(i.style=null));var u=Mg(t);for(let T in i){let R=i[T];if(f&&T==="value"&&R==null){t.value=t.__value="",p[T]=R;continue}if(T==="class"){var $=t.namespaceURI==="http://www.w3.org/1999/xhtml";te(t,$,R,o,e==null?void 0:e[Ha],i[Ha]),p[T]=R,p[Ha]=i[Ha];continue}if(T==="style"){nt(t,R,e==null?void 0:e[Fa],i[Fa]),p[T]=R,p[Fa]=i[Fa];continue}var w=p[T];if(R!==w){p[T]=R;var y=T[0]+T[1];if(y!=="$$")if(y==="on"){let z={},Y="$$"+T,U=T.slice(2);var S=ag(U);if(sg(U)&&(U=U.slice(0,-7),z.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(U,p[Y],z),p[Y]=null}if(R!=null)if(S)t[`__${U}`]=R,at([U]);else{let Z=function(J){p[T].call(this,J)};var P=Z;p[Y]=cp(U,t,Z,z)}else S&&(t[`__${U}`]=void 0)}else if(T==="style")De(t,T,R);else if(T==="autofocus")lp(t,!!R);else if(!s&&(T==="__value"||T==="value"&&R!=null))t.value=t.__value=R;else if(T==="selected"&&f)Ag(t,R);else{var I=T;d||(I=lg(I));var A=I==="defaultValue"||I==="defaultChecked";if(R==null&&!s&&!A)if(a[T]=null,I==="value"||I==="checked"){let z=t,Y=e===void 0;if(I==="value"){let U=z.defaultValue;z.removeAttribute(I),z.defaultValue=U,z.value=z.__value=Y?U:null}else{let U=z.defaultChecked;z.removeAttribute(I),z.defaultChecked=U,z.checked=Y?U:!1}}else t.removeAttribute(T);else A||u.includes(I)&&(s||typeof R!="string")?t[I]=R:typeof R!="function"&&De(t,I,R,n)}}}return l&&ro(!0),p}function Pg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[kg]:t.nodeName.includes("-"),[Eg]:t.namespaceURI===dv}}var Tg=new Map;function Mg(t){var e=Tg.get(t.nodeName);if(e)return e;Tg.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=nc(o);for(var a in i)i[a].set&&e.push(a);o=Yr(o)}return e}function W0(t,e,i){var o;Te&&(e==="srcset"&&Q0(t,i)||$p((o=t.getAttribute(e))!=null?o:"",i)||Nv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function $p(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Ig(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Q0(t,e){var i=Ig(t.srcset),o=Ig(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&($p(i[s][0],n)||$p(n,i[s][0])))}var G0=oc?()=>performance.now():()=>Date.now(),Tr={tick:t=>(oc?requestAnimationFrame:ie)(t),now:()=>G0(),tasks:new Set};function Lg(){let t=Tr.now();Tr.tasks.forEach(e=>{e.c(t)||(Tr.tasks.delete(e),e.f())}),Tr.tasks.size!==0&&Tr.tick(Lg)}function Vg(t){let e;return Tr.tasks.size===0&&Tr.tick(Lg),{promise:new Promise(i=>{Tr.tasks.add(e={c:t,f:i})}),abort(){Tr.tasks.delete(e)}}}function Sc(t,e){Ol(()=>{t.dispatchEvent(new CustomEvent(e))})}function X0(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 Rg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=X0(n.trim());e[s]=a.trim()}return e}var J0=t=>t;function xp(t,e,i,o){var P;var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",p,f=e.inert,_=e.style.overflow,u,$;function w(){var R;var E=Vt,T=yt;bo(null),oo(null);try{return p!=null?p:p=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:l})}finally{bo(E),oo(T)}}var y={is_global:d,in(){var E;if(e.inert=f,!n){$==null||$.abort(),(E=$==null?void 0:$.reset)==null||E.call($);return}a||u==null||u.abort(),Sc(e,"introstart"),u=yp(e,w(),$,1,()=>{Sc(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=_})},out(E){if(!a){E==null||E(),p=void 0;return}e.inert=!0,Sc(e,"outrostart"),$=yp(e,w(),u,0,()=>{Sc(e,"outroend"),E==null||E()})},stop:()=>{u==null||u.abort(),$==null||$.abort()}},S=yt;if(((P=S.transitions)!=null?P:S.transitions=[]).push(y),n&&Hl){var I=d;if(!I){for(var A=S.parent;A&&(A.f&65536)!==0;)for(;(A=A.parent)&&(A.f&16)===0;);I=!A||(A.f&32768)!==0}I&&$n(()=>{bt(()=>y.in())})}}function yp(t,e,i,o,n){var a=o===1;if(fs(e)){var s,d=!1;return Jo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=yp(t,S,i,o,n)}}),{abort:()=>{d=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:ie,deactivate:ie,reset:ie,t:()=>o};let{delay:l=0,css:p,tick:f,easing:_=J0}=e;var u=[];if(a&&i===void 0&&(f&&f(0,1),p)){var $=Rg(p(0,1));u.push($,$)}var w=()=>1-o,y=t.animate(u,{duration:l});return y.onfinish=()=>{var U;var S=(U=i==null?void 0:i.t())!=null?U:1-o;i==null||i.abort();var I=o-S,A=e.duration*Math.abs(I),P=[];if(A>0){var E=!1;if(p)for(var T=Math.ceil(A/16.666666666666668),R=0;R<=T;R+=1){var z=S+I*_(R/T),Y=Rg(p(z,1-z));P.push(Y),E||(E=Y.overflow==="hidden")}E&&(t.style.overflow="hidden"),w=()=>{var Z=y.currentTime;return S+I*_(Z/A)},f&&Vg(()=>{if(y.playState!=="running")return!1;var Z=w();return f(Z,1-Z),!0})}y=t.animate(P,{duration:A,fill:"forwards"}),y.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=ie)},deactivate:()=>{n=ie},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var _s,Ua,Wl,Tc,Bg,Ic=class Ic{constructor(e){us(this,Tc);us(this,_s,new WeakMap);us(this,Ua);us(this,Wl);xa(this,Wl,e)}observe(e,i){var o=Si(this,_s).get(e)||new Set;return o.add(i),Si(this,_s).set(e,o),av(this,Tc,Bg).call(this).observe(e,Si(this,Wl)),()=>{var n=Si(this,_s).get(e);n.delete(i),n.size===0&&(Si(this,_s).delete(e),Si(this,Ua).unobserve(e))}}};_s=new WeakMap,Ua=new WeakMap,Wl=new WeakMap,Tc=new WeakSet,Bg=function(){var e;return(e=Si(this,Ua))!=null?e:xa(this,Ua,new ResizeObserver(i=>{for(var o of i){Ic.entries.set(o.target,o);for(var n of Si(this,_s).get(o.target)||[])n(o)}}))},Un(Ic,"entries",new WeakMap);var wp=Ic;var i_=new wp({box:"border-box"});function Fr(t,e,i){var o=i_.observe(t,()=>i(t[e]));$n(()=>(bt(()=>i(t[e])),o))}function Ng(t,e){return t===e||(t==null?void 0:t[zo])===e}function dt(t={},e,i,o){return $n(()=>{var n,a;return yo(()=>{n=a,a=(o==null?void 0:o())||[],bt(()=>{t!==i(...a)&&(e(t,...a),n&&Ng(i(...n),t)&&e(null,...n))})}),()=>{Jo(()=>{a&&Ng(i(...a),t)&&e(null,...a)})}}),t}function Ir(t=!1){let e=Tt,i=e.l.u;if(!i)return;let o=()=>gc(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let p in l)l[p]!==a[p]&&(a[p]=l[p],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&La(()=>{Dg(e,o),ms(i.b)}),Ze(()=>{let n=bt(()=>i.m.map(vv));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Ze(()=>{Dg(e,o),ms(i.a)})}function Dg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if(Te){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Iv(e)},set:o=>{i=o}})}};n_=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var n_;function Ot(t){Tt===null&&Va("onMount"),Dr&&Tt.l!==null?o_(Tt).m.push(t):Ze(()=>{let e=bt(t);if(typeof e=="function")return e})}function xn(t){Tt===null&&Va("onDestroy"),Ot(()=>()=>bt(t))}function o_(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}function Ql(t,e,i){if(t==null)return e(void 0),i&&i(void 0),ie;let o=bt(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var za=[];function rr(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=ie){let i=null,o=new Set;function n(d){if(wa(t,d)&&(t=d,i)){let l=!za.length;for(let p of o)p[1](),za.push(p,t);if(l){for(let p=0;p<za.length;p+=2)za[p][0](za[p+1]);za.length=0}}}function a(d){n(d(t))}function s(d,l=ie){let p=[d,l];return o.add(p),o.size===1&&(i=e(n,a)||ie),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function gi(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 a=e.length<2;return rr(i,(s,d)=>{let l=!1,p=[],f=0,_=ie,u=()=>{if(f)return;_();let w=e(o?p[0]:p,s,d);a?s(w):_=typeof w=="function"?w:ie},$=n.map((w,y)=>Ql(w,S=>{p[y]=S,f&=~(1<<y),l&&u()},()=>{f|=1<<y}));return l=!0,u(),function(){ms($),_(),l=!1}})}function we(t){let e;return Ql(t,i=>e=i)(),e}var kc=!1,Sp=Symbol();function C(t,e,i){var a;let o=(a=i[e])!=null?a:i[e]={store:null,source:Xr(void 0),unsubscribe:ie};if(o.store!==t&&!(Sp in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=ie;else{var n=!0;o.unsubscribe=Ql(t,s=>{n?o.source.v=s:O(o.source,s)}),n=!1}return t&&Sp in i?we(t):r(o.source)}function Fe(){let t={};function e(){an(()=>{for(var i in t)t[i].unsubscribe();io(t,Sp,{enumerable:!1,value:!0})})}return[t,e]}function Cp(t){var e=kc;try{return kc=!1,[t(),kc]}finally{kc=e}}var u_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Te&&Tv(`${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 ke(t,e,i){return new Proxy(Te?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},u_)}var p_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(fs(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];fs(n)&&(n=n());let a=zn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(fs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=zn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===zo||e===wl)return!1;for(let i of t.props)if(fs(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){fs(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function os(...t){return new Proxy({props:t},p_)}function Og(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function v(t,e,i,o){var z,Y;var n=(i&1)!==0,a=!Dr||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,p;s?[p,l]=Cp(()=>t[e]):p=t[e];var f=zo in t||wl in t,_=s&&((Y=(z=zn(t,e))==null?void 0:z.set)!=null?Y:f&&e in t&&(U=>t[e]=U))||void 0,u=o,$=!0,w=!1,y=()=>(w=!0,$&&($=!1,d?u=bt(o):u=o),u);p===void 0&&o!==void 0&&(_&&a&&Cv(e),p=y(),_&&_(p));var S;if(a)S=()=>{var U=t[e];return U===void 0?y():($=!0,w=!1,U)};else{var I=(n?m:Sr)(()=>t[e]);I.f|=131072,S=()=>{var U=r(I);return U!==void 0&&(u=void 0),U===void 0?u:U}}if((i&4)===0)return S;if(_){var A=t.$$legacy;return function(U,Z){return arguments.length>0?((!a||!Z||A||l)&&_(Z?S():U),U):S()}}var P=!1,E=!1,T=Xr(p),R=m(()=>{var U=S(),Z=r(T);return P?(P=!1,E=!0,Z):(E=!1,T.v=U)});return s&&r(R),n||(R.equals=Sa),function(U,Z){if(Il!==null&&(P=E,S(),r(T)),arguments.length>0){let J=Z?r(R):a&&s?he(U):U;if(!R.equals(J)){if(P=!0,O(T,J),w&&u!==void 0&&(u=J),Og(R))return U;bt(()=>r(R))}return U}return Og(R)?R.v:r(R)}}var f_;typeof HTMLElement=="function"&&(f_=class extends HTMLElement{constructor(e,i,o){super();Un(this,"$$ctor");Un(this,"$$s");Un(this,"$$c");Un(this,"$$cn",!1);Un(this,"$$d",{});Un(this,"$$r",!1);Un(this,"$$p_d",{});Un(this,"$$l",{});Un(this,"$$l_u",new Map);Un(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(a){return s=>{let d=document.createElement("slot");a!=="default"&&(d.name=a),b(s,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=m_(this);for(let a of this.$$s)a in n&&(a==="default"&&!this.$$d.children?(this.$$d.children=i(a),o.default=!0):o[a]=i(a));for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=Tp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=bg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=_c(()=>{yo(()=>{var a;this.$$r=!0;for(let s of Ru(this.$$c)){if(!((a=this.$$p_d[s])!=null&&a.reflect))continue;this.$$d[s]=this.$$c[s];let d=Tp(s,this.$$d[s],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,d)}this.$$r=!1})});for(let a in this.$$l)for(let s of this.$$l[a]){let d=this.$$c.$on(a,s);this.$$l_u.set(s,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Tp(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 Ru(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function Tp(t,e,i,o){var a;let n=(a=i[t])==null?void 0:a.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 m_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Hg="5";var Fg,Ug,zg;typeof window!="undefined"&&((zg=(Ug=(Fg=window.__svelte)!=null?Fg:window.__svelte={}).v)!=null?zg:Ug.v=new Set).add(Hg);var H1=require("@vkontakte/videoplayer-core/es2018"),HW=require("@vkontakte/videoplayer-core/es2018"),ha=require("@vkontakte/videoplayer-shared/es2018"),F1=require("@vkontakte/videoplayer-statistics/es2018");var Ws=require("@vkontakte/videoplayer-shared/es2018");var g_={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:Ws.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:Ws.VideoQuality.Q_480P,highQualityLimit:Ws.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,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,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,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,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!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},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}},qg=t=>(0,Ws.fillWithDefault)(t,g_),Kg=t=>Ba("ui-config",t),Kt=()=>Ra("ui-config");var Gl="vk_player_debug_panel_opened";var Wg="videoplayer",Qg="videoplayer";var Ur={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Gg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Yg=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),jg=new Set(["ShiftRight","ShiftLeft"]);var Zg=["TIMELINE"],Yl=[...Zg,"GRAPH_BUTTON"],Ip=[...Zg,"PLAY_BUTTON"],jl=[...Yl,"PLAY_BUTTON"];var kr=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(kr||{}),Gs={xs:0,s:1,m:2,l:3,xl:4};var Zl=require("@vkontakte/videoplayer-shared/es2018"),Xg=require("@vkontakte/videoplayer-core/es2018"),Jg=require("@vkontakte/videoplayer-statistics/es2018");var Ec="prod",Ys="1.1.61-dev.e1cb6686.0";var js=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var eh=Symbol("storeContext"),th=Symbol("microStoresContext"),ih=(t,e)=>{Ba(eh,t),Ba(th,e),Ec==="dev"&&(window.app={store:t,microStores:e})},Ie=()=>{let t=Ra(eh);return(0,Zl.assertNonNullable)(t,"Store context is empty!"),t},ao=()=>{let t=Ra(th);return(0,Zl.assertNonNullable)(t,"MicroStores context is empty!"),t},Wt=(t,e)=>Pc(t,t.getValue(),e),Pc=(t,e,i)=>rr(e,o=>{let n=t.subscribe(a=>{o(a),i==null||i(a)});return()=>n.unsubscribe()}),oh=(t,e,i)=>{var I,A,P,E,T,R;let o=t.info,{width:n,height:a}=we(i.ui.playerSize),s=(A=(I=o.throughputEstimation$.getValue())==null?void 0:I.toFixed(0))!=null?A:0,d=(E=(P=o.rttEstimation$.getValue())==null?void 0:P.toFixed(0))!=null?E:0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",p=`${Ys} (core: ${Xg.VERSION}, stat: ${Jg.VERSION}, shared: ${Zl.VERSION})`,f=we(i.state.errorLog$),_=f.length?`
|
|
49
49
|
`+f.map((z,Y)=>{var oe;let U=`${Y}) Type: ${z.id}
|
|
50
50
|
`,Z=`Message: ${z.message} (${z.thrown})
|
|
51
51
|
`,J=`Trace: ${(oe=z.thrown)==null?void 0:oe.stack}
|
|
@@ -361,4 +361,4 @@ Try switching the\xA0quality to\xA0Auto.`},Ch=$_;var ns=new Map;ns.set(qa.Interf
|
|
|
361
361
|
/* css reset end */.hidden {visibility:hidden;opacity:0;}.overlay-container {pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:var(--overlay-container-z-index);}
|
|
362
362
|
|
|
363
363
|
/* \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 Qm(t,e){q(e,!0),Q(t,O3);let[i,o]=Fe(),n=()=>C(Ut,"$isLive$",i),a=v(e,"sources",7),s=v(e,"store",7),d=v(e,"microStoresRoot",7),l=v(e,"videoConfig",7),p=v(e,"uiConfig",7),f=v(e,"title",7),_=v(e,"thumbUrl",7),u=v(e,"interactiveContainer",7),$=v(e,"interactiveController",7),w=v(e,"subtitles",7),y=v(e,"live",7),S=v(e,"preload",7),I=v(e,"autoplay",7),A=v(e,"volume",7,void 0),P=v(e,"muted",7,void 0),E=v(e,"fromTime",7),T=v(e,"canRewindLive",7),R=v(e,"showAds",7),z=v(e,"adsSlotId",7,void 0),Y=v(e,"adsParams",7,void 0),U=v(e,"adsPreviewParam",7,void 0),Z=v(e,"adsAutoplayParam",7,void 0),J=v(e,"duration",7,void 0),oe=v(e,"logoClickable",7),ce=v(e,"logoHidden",7),le=v(e,"isMobile",7),Le=v(e,"showNextPrevButtons",7,!1),Re=v(e,"nextButtonActive",7,!1),X=v(e,"prevButtonActive",7,!1),Me=v(e,"endScreenVideoTitle",7,void 0),j=v(e,"endScreenVideoThumb",7,void 0),N=v(e,"isOneVideoPlaylist",7,!1),Ve=v(e,"supportLink",7),xe=v(e,"shadowRootContainer",7,void 0),re=v(e,"outerContainerRef",7,void 0),Be=v(e,"fullScreenTarget",7,void 0),ue=v(e,"failoverHosts",7,void 0),D=v(e,"showMiniTimer",7,!1),de=v(e,"saveRate",7),Ee=v(e,"seekToInteractive",7,ha.noop),Ge=v(e,"playPrevChapter",7,ha.noop),lt=v(e,"volumeMultiplier",7),Ae=v(e,"showAutoplayNext",7),ye=v(e,"showEndScreen",7,!0),Pe=v(e,"keyboardControls",15,void 0),{subscribers:rt,stores:ft}=d();Kg(p());let it=Kt(),Rt=p().logoLink,st=s().ui.debugPanelVisible,mt=s().ui.playerSize,Ut=s().state.isLive$,Ne=s().state.isInteractive&&H1.clientChecker.device.isAndroid,ne=ee(void 0),W=null,se=ee(!1);s().getAdmanWrapper().init({switchFromAdsToVideo:s().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:s().actions.internal.switchFromVideoToAds,setMuted:s().actions.external.setMuted},s().ads,{isMobile:s().ui.isMobile,mobileUnmuteButtonVisible:s().ui.mobileUnmuteButtonVisible,vsid:s().vsid}),ih(s(),ft),Ze(()=>{s().ui.isMobile.set(le())});let pe=(H=!1)=>{O(se,!0),H?s().actions.external.firstStart(R()):s().actions.internal.firstStart(R())},Ce=()=>{if(it.features.qualityDetailsSubMenuEnabled){let H=xh(s().videoId);if(H)switch(H.type){case"high_quality":s().actions.internal.setHighQualityEnabled(!0,H.appliesTo);break;case"traffic_saving":s().actions.internal.setTrafficSavingEnabled(!0,H.appliesTo);break;case"exact_quality":s().actions.internal.setQuality(H.quality);break}}else{wh(s().videoId),Np()&&s().actions.internal.setTrafficSavingEnabled(!0);let We=Lp(s().videoId);We&&s().actions.internal.setQuality(We)}};function Oe(H){var pi,lo,co;let We=a()||H;We&&s().initVideo({container:r(ne),sources:We,failoverHosts:ue(),subtitles:w(),volumeMultiplier:lt()});let ni=ha.safeStorage.get(Gl)==="true";st.set(ni),E()>0&&s().actions.external.seekTime(E());let qi=le()?it.volumeDefault:(lo=(pi=A())!=null?pi:Mc())!=null?lo:it.volumeDefault,Jt=(co=P())!=null?co:gh();if(s().actions.external.setVolume(qi),s().actions.external.setMuted(Jt),s().getAdmanWrapper().setInitialVolume(Jt?0:qi),Ce(),it.features.saveRate&&de()){let uo=bh();uo&&!n()&&s().actions.internal.setPlaybackRate(uo)}if(Ae()){let uo=yh();uo&&s().actions.internal.setAutoplayNextEnabled(uo)}s().ui.isAutoplay.set(I()),I()?pe():S()&&it.features.preload&&s().actions.internal.preload()}let ct=H=>{if(window.ResizeObserver){let We,ni;W=new ResizeObserver((0,ha.throttleFn)(qi=>{let Jt=qi[0];if(Jt.contentBoxSize){let pi=Array.isArray(Jt.contentBoxSize)?Jt.contentBoxSize[0]:Jt.contentBoxSize;We=pi.inlineSize,ni=pi.blockSize}else Jt.contentRect&&(We=Jt.contentRect.width,ni=Jt.contentRect.height);mt.set({width:We,height:ni})},300)),W.observe(H)}mt.set({width:H.clientWidth,height:H.clientHeight})},Bt=()=>{document.hidden&&s().actions.external.stop()};Ot(()=>{var ni,qi,Jt,pi;Ne&&document.addEventListener("visibilitychange",Bt),it.debugLog&&s().actions.internal.startLogging(),ct(r(ne));let H=rt.map(lo=>lo.init({store:s(),microStores:ft,config:l(),interactiveController:$(),uiConfig:p()})),We=()=>{Ne&&document.removeEventListener("visibilitychange",Bt),W==null||W.disconnect(),H.forEach(lo=>lo.unsubscribe()),s().destroy()};return((ni=y())==null?void 0:ni.status)==="upcoming"?(s().actions.internal.setLiveWaitingStart(!0),We):((qi=y())==null?void 0:qi.status)==="waiting"?(s().actions.internal.setLiveWaitingRecover(!0),We):(((Jt=y())==null?void 0:Jt.status)==="finished"||((pi=y())==null?void 0:pi.status)==="postlive")&&!Object.keys(a()||[]).length?(s().actions.internal.setLiveWaitingRecord(!0),We):(Oe(),We)});function Ke(){r(se)?s().actions.external.play():pe(!0)}function ht(){s().actions.external.pause()}function Je(H){s().actions.external.setMuted(H)}function xt(H){le()||H>=0&&H<=1&&s().actions.external.setVolume(H)}function Qt(H){s().actions.internal.seekTime(H,F1.SeekAction.UNKNOWN)}function je(H){s().actions.external.seekEpisodeStartTime(H)}function Ct(){s().actions.external.returnFocusToEpisodes()}function di(H){s().actions.external.setPlaybackRate(H)}function oi(H){s().actions.external.setAutoQualityLimits(H)}let Ii=vu(it.view);var zi=D3();nt(zi,Ii);var Ro=h(zi);{var wo=H=>{Wm(H,{get store(){return s()},uiConfig:it,get thumbUrl(){return _()},get interactiveContainer(){return u()},get live(){return y()},get autoplay(){return I()},get canRewindLive(){return T()},get showAds(){return R()},get adsSlotId(){return z()},get adsParams(){return Y()},get adsPreviewParam(){return U()},get adsAutoplayParam(){return Z()},get duration(){return J()},get logoClickable(){return oe()},get logoHidden(){return ce()},logoTargetUrl:Rt,get nextButtonActive(){return Re()},get prevButtonActive(){return X()},get endScreenVideoTitle(){return Me()},get endScreenVideoThumb(){return j()},get isOneVideoPlaylist(){return N()},get supportLink(){return Ve()},get shadowRootContainer(){return xe()},get outerContainerRef(){return re()},get fullScreenTarget(){return Be()},get showMiniTimer(){return D()},get playerStarted(){return r(se)},get seekToInteractive(){return Ee()},get playPrevChapter(){return Ge()},firstStart:pe,seekTime:Qt,get showEndScreen(){return ye()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return Le()},get videoContainer(){return r(ne)},set videoContainer(We){O(ne,he(We))}})},So=H=>{qm(H,{get store(){return s()},uiConfig:it,get title(){return f()},get thumbUrl(){return _()},get interactiveContainer(){return u()},get live(){return y()},get autoplay(){return I()},get canRewindLive(){return T()},get showAds(){return R()},get adsSlotId(){return z()},get adsParams(){return Y()},get adsPreviewParam(){return U()},get adsAutoplayParam(){return Z()},get duration(){return J()},get logoClickable(){return oe()},get logoHidden(){return ce()},logoTargetUrl:Rt,get nextButtonActive(){return Re()},get prevButtonActive(){return X()},get endScreenVideoTitle(){return Me()},get endScreenVideoThumb(){return j()},get isOneVideoPlaylist(){return N()},get supportLink(){return Ve()},get shadowRootContainer(){return xe()},get outerContainerRef(){return re()},get fullScreenTarget(){return Be()},get showMiniTimer(){return D()},get playerStarted(){return r(se)},get seekToInteractive(){return Ee()},get playPrevChapter(){return Ge()},firstStart:pe,get showEndScreen(){return ye()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return Le()},get videoContainer(){return r(ne)},set videoContainer(We){O(ne,he(We))},get keyboardControls(){return Pe()},set keyboardControls(We){Pe(We)}})};B(Ro,H=>{le()?H(wo):H(So,!1)})}g(zi),b(t,zi);var Bo=K({initVideo:Oe,play:Ke,pause:ht,setMuted:Je,setVolume:xt,seekTime:Qt,seekEpisodeStartTime:je,returnFocusToEpisodes:Ct,setPlaybackRate:di,setAutoQualityLimits:oi,get sources(){return a()},set sources(H){a(H)},get store(){return s()},set store(H){s(H)},get microStoresRoot(){return d()},set microStoresRoot(H){d(H)},get videoConfig(){return l()},set videoConfig(H){l(H)},get uiConfig(){return p()},set uiConfig(H){p(H)},get title(){return f()},set title(H){f(H)},get thumbUrl(){return _()},set thumbUrl(H){_(H)},get interactiveContainer(){return u()},set interactiveContainer(H){u(H)},get interactiveController(){return $()},set interactiveController(H){$(H)},get subtitles(){return w()},set subtitles(H){w(H)},get live(){return y()},set live(H){y(H)},get preload(){return S()},set preload(H){S(H)},get autoplay(){return I()},set autoplay(H){I(H)},get volume(){return A()},set volume(H){A(H)},get muted(){return P()},set muted(H){P(H)},get fromTime(){return E()},set fromTime(H){E(H)},get canRewindLive(){return T()},set canRewindLive(H){T(H)},get showAds(){return R()},set showAds(H){R(H)},get adsSlotId(){return z()},set adsSlotId(H){z(H)},get adsParams(){return Y()},set adsParams(H){Y(H)},get adsPreviewParam(){return U()},set adsPreviewParam(H){U(H)},get adsAutoplayParam(){return Z()},set adsAutoplayParam(H){Z(H)},get duration(){return J()},set duration(H){J(H)},get logoClickable(){return oe()},set logoClickable(H){oe(H)},get logoHidden(){return ce()},set logoHidden(H){ce(H)},get isMobile(){return le()},set isMobile(H){le(H)},get showNextPrevButtons(){return Le()},set showNextPrevButtons(H){Le(H)},get nextButtonActive(){return Re()},set nextButtonActive(H){Re(H)},get prevButtonActive(){return X()},set prevButtonActive(H){X(H)},get endScreenVideoTitle(){return Me()},set endScreenVideoTitle(H){Me(H)},get endScreenVideoThumb(){return j()},set endScreenVideoThumb(H){j(H)},get isOneVideoPlaylist(){return N()},set isOneVideoPlaylist(H){N(H)},get supportLink(){return Ve()},set supportLink(H){Ve(H)},get shadowRootContainer(){return xe()},set shadowRootContainer(H){xe(H)},get outerContainerRef(){return re()},set outerContainerRef(H){re(H)},get fullScreenTarget(){return Be()},set fullScreenTarget(H){Be(H)},get failoverHosts(){return ue()},set failoverHosts(H){ue(H)},get showMiniTimer(){return D()},set showMiniTimer(H){D(H)},get saveRate(){return de()},set saveRate(H){de(H)},get showAutoplayNext(){return Ae()},set showAutoplayNext(H){Ae(H)},get seekToInteractive(){return Ee()},set seekToInteractive(H){Ee(H)},get playPrevChapter(){return Ge()},set playPrevChapter(H){Ge(H)},get volumeMultiplier(){return lt()},set volumeMultiplier(H){lt(H)},get showEndScreen(){return ye()},set showEndScreen(H){ye(H)},get keyboardControls(){return Pe()},set keyboardControls(H){Pe(H)}});return o(),Bo}var H3=be('<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 Gm(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=H3();let n;var a=h(o);me(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),k(()=>n=Se(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"57",height:"60",fill:"none","aria-hidden":"true","data-testid":"stub-icon",role:"img",...i})),b(t,o)}function Ym(t,e){let i=v(e,"isWhite",3,!1),o=m(()=>i()?"color: #fff;":"color: #909499;");Gm(t,{get style(){return r(o)}})}var F3=L('<div class="title svelte-1y9fytq"> </div>'),U3=L('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),z3={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 jm(t,e){Q(t,z3);var i=U3(),o=h(i);{var n=d=>{var l=F3(),p=h(l,!0);g(l),k(()=>fe(p,e.title)),b(d,l)};B(o,d=>{e.title&&d(n)})}var a=M(o,2);{var s=d=>{let l=m(()=>!!e.thumbUrl);Ym(d,{get isWhite(){return r(l)}})};B(a,d=>{(!e.title||!e.thumbUrl)&&d(s)})}g(i),k(()=>nt(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}var Y1=require("@vkontakte/videoplayer-shared/es2018"),Ui=require("@vkontakte/videoplayer-shared/es2018"),Jd=require("@vkontakte/videoplayer-core/es2018"),Cu=require("@vkontakte/videoplayer-statistics/es2018");var hu=require("@vkontakte/videoplayer-shared/es2018"),gu=class{constructor(){this.subscription=new hu.Subscription,this.logger=new hu.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,a]of e)try{(o=(i=navigator.mediaSession).setActionHandler)==null||o.call(i,n,a)}catch(s){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 a,s;let o=we(e.state.currentPlaybackRate$),n=we(e.state.duration$);if(!(!isFinite(i)||!isFinite(n)))try{(s=(a=navigator.mediaSession).setPositionState)==null||s.call(a,{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 dl=require("@vkontakte/videoplayer-shared/es2018");var q3=be('<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 Zm(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=q3();let n;var a=h(o);me(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),k(()=>n=Se(o,n,{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})),b(t,o)}var K3=L('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),W3={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 Xm(t,e){q(e,!0),Q(t,W3);let[i,o]=Fe(),n=()=>C(p,"$interfaceLanguage$",i),a=()=>C(f,"$isMobile$",i),s=Ie(),d=Kt(),l=!!s.webApi.pictureInPictureApi,p=s.interfaceLanguage$,f=s.ui.isMobile,_=s.ui.t,u=m(()=>n()&&_("pip_dummy_title")),$=vu(d.view);var w=K3();te(w,1,"player-pip-dummy svelte-1pbsod4",null,{},{"is-pip-api":l}),nt(w,$);var y=h(w);let S;var I=h(y);Zm(I,{}),g(y);var A=M(y,2),P=h(A,!0);g(A),g(w),k(E=>{S=te(y,1,"dummy-image svelte-1pbsod4",null,S,E),fe(P,r(u))},[()=>({desktop:!a()})]),b(t,w),K(),o()}var Q3=Object.defineProperty,G3=(t,e,i)=>e in t?Q3(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ll=(t,e,i)=>G3(t,typeof e!="symbol"?e+"":e,i),Y3=460,j3=280,qd=class{constructor({enabled:e=!0}={enabled:!0}){ll(this,"playerDomElement"),ll(this,"playerParentShadowRoot"),ll(this,"playerDummyElement"),ll(this,"svelteContext"),ll(this,"pipWindow"),ll(this,"info",{isActive$:new dl.ValueSubject(!1),isEnabled$:new dl.ValueSubject(!1),type:1}),this.info.isEnabled$=new dl.ValueSubject(e)}isSupported(){let{isEmbed:e}=(0,dl.detectEmbed)();return"documentPictureInPicture"in window&&!e}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:Y3,height:j3,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let o=[...this.playerParentShadowRoot.styleSheets].map(l=>[...l.cssRules].map(p=>p.cssText).join(" ")).filter(Boolean).join(`
|
|
364
|
-
`),n=document.createElement("style");n.textContent=o;let a=this.createStretchedContainer(),s=a.attachShadow({mode:"open"});s.append(n),s.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=ts(Xm,d),(e=this.pipWindow)==null||e.document.body.append(a),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",l=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Ks(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)==null||i.close(),e()})}async dispose(){await this.remove()}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 U1(t){return t instanceof qd}var _u=class{static getLatestSupportedVersion(e){let i=new Js,o=new qd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Kd(t,e){var n,a;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let s of i)o[s]=(a=(n=e[s])!=null?n:t[s])!=null?a:void 0;return o}var z1="Inner error. Unexpectedly root annotation container null reference exception",q1="Annotation with such name already exists",K1="Annotation with such name does not exist";var cl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var ul=require("@vkontakte/videoplayer-shared/es2018"),Z3="1",X3=100,bu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new ul.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,ul.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"},X3);this.subscriptions.add((0,ul.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 cl(z1);if(this.annotations.has(e))throw new cl(q1);i.style.zIndex=(o=i.style.zIndex)!=null?o:Z3,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 cl(K1);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,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};var _a=require("@vkontakte/videoplayer-shared/es2018"),qo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,_a.assertNonNullable)(e),(0,_a.assertNonNullable)(i),(0,_a.assertNonNullable)(n),n.interactiveData&&(0,_a.assertNonNullable)(o),this.subscription=new _a.Subscription,this.subscription}};var Wd=class extends qo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var Qd=class extends qo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:p,isMobile:f}=a.ui,_=we(f),u=()=>_&&we(p);return o.add(p.subscribe($=>{if(!_)return;let w=we(s);we(l)?this.state$.set($):w!==null&&this.state$.set(!w||$)})),o.add(l.subscribe($=>{this.state$.set(!$||u())})),o.add(s.subscribe($=>{if($===null)return;let w=we(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!$)})),o}};var Gd=class extends qo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ae("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};var W1=require("@vkontakte/videoplayer-shared/es2018"),Jm=ae(!1),$u=null,Yd=class extends qo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Jm,set:(i,o=!1)=>{i!==we(Jm)&&(this.clearTimeout(),Jm.set(i),!i&&$u&&($u=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(l.subscribe(_=>{we(s)&&_&&this.state$.set(!1)}));let f=(a==null?void 0:a.interactiveData)||{tooltipHelpHintActive:!1};return o.add((0,W1.combine)({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:p}).subscribe(({isPlaying$:_,isInteractiveTime$:u,interactiveTimeIndicator:$})=>{var w,y;if(!(!_||!($!=null&&$.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&$u===null&&($u=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(y=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||y.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var yu=require("@vkontakte/videoplayer-shared/es2018");var jd=class extends qo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:yu.noop};this.checkIfShouldHide=i=>Is(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(we(s)))return;let l=we(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:_}=n.ui.controls,u=we(p),$=we(f);if(l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1),_.remove(Ip),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=$==="playing";try{await(a==null?void 0:a.toggleGraphView(!0)),this.state$.set(!0),_.add(Ip),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add((0,yu.combine)({graphIsOpened:this.state$,currentGridType:s}).subscribe(async({graphIsOpened:l,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1)}catch(_){d({message:"Cant hide graph"})}})),o}};var ev=require("@vkontakte/videoplayer-shared/es2018"),Zd=class extends qo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ae(!1),isEnabled$:ae(!1),type$:ae(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new ev.ValueSubject(!1),isEnabled$:new ev.ValueSubject(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};var wu=require("@vkontakte/videoplayer-shared/es2018");var xu=require("@vkontakte/videoplayer-shared/es2018"),Q1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?J3({maxCount:t}):void 0,e!==0?ex({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},J3=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,xu.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}}},ex=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(xu.safeStorage.get(e)||"{}")}catch(a){return{}}},o=a=>xu.safeStorage.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o({...i(),[a]:{timeout:t,launchTime:Date.now()}})},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var Xd=class extends qo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ae({}),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:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=Q1({maxShowCount:a,timeout:s});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe((0,wu.filterChanged)(),(0,wu.filter)(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var G1=()=>[Wd,Qd,Gd,Yd,jd,Zd,Xd].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var pl=require("@vkontakte/videoplayer-shared/es2018");var tx=Object.defineProperty,ix=(t,e,i)=>e in t?tx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Zt=(t,e,i)=>ix(t,typeof e!="symbol"?e+"":e,i),ox={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Ui.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,Jd.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},wn=ee(void 0),Su=class extends HTMLElement{constructor(){super(),Zt(this,"svelteStubComponent"),Zt(this,"svelteRootComponent"),Zt(this,"store"),Zt(this,"microStoresRoot"),Zt(this,"statistics"),Zt(this,"sentry"),Zt(this,"_shadowRoot"),Zt(this,"playerContainer"),Zt(this,"rootContainer"),Zt(this,"shadowRootContainer"),Zt(this,"uiConfig"),Zt(this,"coreConfig"),Zt(this,"statisticsConfig"),Zt(this,"interactiveController"),Zt(this,"interactiveContainer"),Zt(this,"graphMadePause"),Zt(this,"currentPlayingVideoIndex",0),Zt(this,"needToRepeatPlaylist",!1),Zt(this,"videoConfig"),Zt(this,"pictureInPictureApi"),Zt(this,"mediaSessionApi"),Zt(this,"unsubscribePlayerPhaseSubscription"),Zt(this,"logger"),Zt(this,"log"),Zt(this,"subscription"),Zt(this,"interactiveSubscription"),Zt(this,"annotationsApi"),Zt(this,"slotsApi"),Zt(this,"prevIsid"),Zt(this,"isInited",!1),Zt(this,"internalsExposure",null),Zt(this,"createOneStat",(e,i={})=>{var o,n,a,s;let{albumId:d,statPlace:l,statUserSalt:p,statTrackCode:f,statVKAppId:_,refreshStatAuthToken:u,autoplay:$,isMobile:w,isTouch:y,refDomain:S,deviceId:I,interactiveData:A}=Kd(this.videoConfig,i),P=(o=A==null?void 0:A.projectInfo)==null?void 0:o.pid,E=(a=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?a:!1;E&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&T)return new Cu.OneStat({movieId:T,albumId:d,place:l,trackCode:f,vkAppId:_,autoplay:(s=$&&!this.interactiveController)!=null?s:!1,mobile:y!=null?y:w,clip:R,refDomain:S,deviceId:I,...P&&(!this.isInited||E)&&{projectId:Number(P)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}),pl.devNull.create("ui"),this.logger=new Ui.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Ui.Subscription,this.interactiveSubscription=new Ui.Subscription,this.graphMadePause=!1}connectedCallback(){var e,i;if(this.isInited)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,a=he({title:o,thumbUrl:n}),s={target:this.playerContainer,props:a};this.svelteStubComponent=ts(jm,s)}disconnectedCallback(){var e,i,o,n,a;(e=this.annotationsApi)==null||e.destroy(),(i=this.mediaSessionApi)==null||i.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)==null||o.call(this),(n=this.interactiveController)==null||n.destroy(),this.interactiveSubscription.unsubscribe(),(a=this.internalsExposure)==null||a.destroy(),pl.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={}){let{deviceId:o,preload:n,refreshStatAuthToken:a}=Kd(this.videoConfig,i),{unitedVideoId:s}=e;return new Cu.ThinOneStat.ThinOneStat({deviceId:o,movieId:s,preload:n},{config:this.statisticsConfig,refreshAuthToken:a})}createPlayer(e,i={},o){var n,a,s,d,l,p,f,_,u;if(!this.videoConfig)return;let{albumId:$,statPlace:w,statAuthToken:y,preload:S,autoplay:I,volume:A,muted:P,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:Y,adsParams:U={},adsPreviewParam:Z,adsAutoplayParam:J,interfaceLanguage:oe,isCyrillicRelatedInterface:ce,logoClickable:le,logoHidden:Le,isMobile:Re,isTouch:X,isAudioDisabled:Me,isLiveCatchUpMode:j,fullScreenTarget:N,failoverHosts:Ve,canDownload:xe,callbacks:re,interactiveData:Be,showThumbTimer:ue,additionalButtons:D=[],additionalSettingsMenuItems:de=[],additionalContextMenuItems:Ee=[],repeat:Ge,saveRate:lt,volumeMultiplier:Ae,showEndScreen:ye,showAutoplayNext:Pe}=Kd(this.videoConfig,i),{sources:rt,title:ft,thumbUrl:it,unitedVideoId:Rt,isClip:st=!1,duration:mt,adsParams:Ut={},videoEpisodes:qt,previewThumbsData:Ne,subtitles:ne,live:W}=e,se={...U,...Ut},pe=this.getNextVideoInfo(),Ce={sources:rt,title:ft,thumbUrl:it,subtitles:ne,unitedVideoId:Rt,isClip:st,live:W,albumId:$,statPlace:w,autoplay:I,muted:P,volume:A,fromTime:E,canRewindLive:T,showAds:z,adsSlotId:Y,adsParams:se,adsPreviewParam:Z,adsAutoplayParam:J,duration:mt,logoClickable:le,logoHidden:Le,isTouch:X!=null?X:Re,repeat:Ge,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:pe.nextVideoTitle,endScreenVideoThumb:pe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Oe={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Ce)}`});let ct=(n=this.interactiveController)==null?void 0:n.state.statistics$.getValue(),Bt,Ke=this.createThinOneStat(e,i);(Bt||Ke)&&(this.statistics=new iu(Bt,Ke,ct==null?void 0:ct.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Xs(this.uiConfig.sentry,{version:Ys,env:Ec},{movieId:Rt,albumId:$,place:w,autoplay:(a=I&&!this.interactiveController)!=null?a:!1,mobile:X!=null?X:Re,clip:st}),this.interactiveController&&((l=this.prevIsid)!=null||(this.prevIsid=(d=(s=this.statistics)==null?void 0:s.oneStat)==null?void 0:d.isid$.getValue())),this.sentry={...this.sentry,...Xs.getInstance()};let Je=!!Be,xt=[],Qt="tooltip_interactive_go_back_disabled_first";if(Je&&this.interactiveController){let oi=this.interactiveController.state.isInitialChapter$.getValue(),Ii=this.interactiveController.getHistoryState();oi&&xt.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||xt.push("SEEK_TO_INTERACTIVE_BUTTON"),Ii.hasPrevChapter$.getValue()||(xt.push("PLAY_PREV_CHAPTER_BUTTON"),oi||(Ii.isGoBackLimited$.getValue()?Qt="tooltip_interactive_go_back_disabled_limit":Qt="tooltip_interactive_go_back_disabled"))}let je=()=>{var oi;this.isInited=!1,this.prevIsid=void 0;let Ii=(o==null?void 0:o.info.isEnded$.getValue())&&((oi=this.interactiveController)==null?void 0:oi.state.isEndChapter$.getValue());re.onReplayInteractiveVideo&&!Ii?re.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=c1({player:o,interfaceLanguage:oe,isCyrillicRelatedInterface:ce,videoId:Rt,isClip:st,isLiveCatchUpMode:j,isAudioDisabled:Me,statAuthToken:y,callbacks:re,webApi:Oe,videoEpisodes:qt,previewThumbsData:Ne,canDownload:xe,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:xt,isInteractive:Je,saveRate:lt,interactiveRanges$:(p=this.interactiveController)==null?void 0:p.state.interactiveRanges$,isInteractiveTime$:(f=this.interactiveController)==null?void 0:f.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:je,playPrevChapterDisabledTooltip:Qt,hasInteractiveBranches:!!((u=(_=this.interactiveController)==null?void 0:_.getChapterBranches())!=null&&u.length),additionalButtons:this.uiConfig.features.additionalButtons?D:[],additionalSettingsMenuItems:de!=null?de:[],additionalContextMenuItems:Ee!=null?Ee:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ge&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:Ct}=this.microStoresRoot=G1(),di=()=>{var oi,Ii,zi,Ro,wo,So;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(H=>{var We;return(We=re==null?void 0:re.onCurrentFormatChanged)==null?void 0:We.call(re,H)})),this.subscription.add(Ct.interactiveControlsOpacity$.subscribe(H=>{var We;H!==null&&((We=this==null?void 0:this.interactiveController)==null||We.setDisabledControls(H))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(H=>{var We;return(We=re==null?void 0:re.onThroughputEstimationChanged)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(H=>{var We;return(We=re==null?void 0:re.onTrafficSavingEnabledChanged)==null?void 0:We.call(re,H)})),this.subscription.add(new Ui.Observable(H=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(We=>H.next(We)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?(0,Ui.skip)(1):H=>H).subscribe(H=>{var We;return(We=re==null?void 0:re.onCurrentPlaybackRateChanged)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.volume$.subscribe(H=>{var We;return(We=re==null?void 0:re.onVolumeChange)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.muted$.subscribe(H=>{var We,ni;return H?(We=re==null?void 0:re.onMute)==null?void 0:We.call(re):(ni=re==null?void 0:re.onUnmute)==null?void 0:ni.call(re)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(H=>{var We;return(We=re==null?void 0:re.onVideoBitrateChanged)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(H=>{var We;let ni=(We=this.store)==null?void 0:We.ui.controls.disabledControls$;ni&&(H&&!ni.includes(Yl)&&ni.add(Yl),H||ni.remove(Yl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async H=>{var We;if(!Jd.clientChecker.browser.isSamsungBrowser||!H||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((We=this.videoConfig)==null?void 0:We.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(H=>{var We;return(We=re==null?void 0:re.onVSIDChanged)==null?void 0:We.call(re,H)})),this.initMediaSession(),O(wn,he({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:rt,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:ft,thumbUrl:it,subtitles:ne,live:W,preload:S,autoplay:I,muted:P,volume:A,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:Y,adsParams:se,adsPreviewParam:Z,adsAutoplayParam:J,duration:mt,logoClickable:le,logoHidden:Le,isMobile:X!=null?X:Re,failoverHosts:Ve,fullScreenTarget:N,saveRate:lt,shadowRootContainer:this.shadowRootContainer,showMiniTimer:ue,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:pe.nextVideoTitle,endScreenVideoThumb:pe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:ye,showAutoplayNext:Pe}));let Bo={target:this.playerContainer,props:r(wn)};this.svelteRootComponent=ts(Qm,Bo),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(zi=(Ii=(oi=this.videoConfig)==null?void 0:oi.callbacks)==null?void 0:Ii.onInited)==null||zi.call(Ii)),(Ro=this.internalsExposure)==null||Ro.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((So=(wo=this.videoConfig)==null?void 0:wo.callbacks)!=null&&So.onDevNullLog)?pl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):pl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?Jd.clientChecker.isInited$.subscribe(oi=>{oi&&(console.log("UI SDK async start"),di())}):di()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let a=(i=this.videoConfig)==null?void 0:i.callbacks;a&&this.subscription.add(o.playerPhase.subscribe(d=>{var l;return(l=a.onPlayerPhaseChanged)==null?void 0:l.call(a,d)})).add(o.state.playbackState$.subscribe(d=>{var l;return d&&((l=a.onPlaybackStateChanged)==null?void 0:l.call(a,d))})).add(o.state.isLive$.subscribe(d=>{var l;return(l=a.onIsLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isActiveLive$.subscribe(d=>{var l;return(l=a.onIsActiveLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var l;return(l=a.onIsAudioAvailableChanged)==null?void 0:l.call(a,d)})).add(o.state.currentQuality$.subscribe(d=>{var l;return(l=a.onCurrentQualityChanged)==null?void 0:l.call(a,d)})).add(o.state.availableQualities$.subscribe(d=>{var l;return(l=a.onAvailableQualitiesChanged)==null?void 0:l.call(a,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&a.onAudioLanguagesAvailable&&a.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var l,p;return d?(l=a.onPiPEnter)==null?void 0:l.call(a):(p=a.onPiPExit)==null?void 0:p.call(a)}));let s=a==null?void 0:a.uiInfo;s&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var l;return(l=s.onControlsVisibleChanged)==null?void 0:l.call(s,d)})).add(o.ui.isMobile.subscribe(d=>{var l;return(l=s.onIsMobileChanged)==null?void 0:l.call(s,d)})).add(o.ui.playerSize.subscribe(d=>{var l;return(l=s.onPlayerSizeChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var l;return(l=s.onPrevButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playButton.subscribe(d=>{var l;return(l=s.onPlayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var l;return(l=s.onReplayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var l;return(l=s.onNextButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var l;return(l=s.onPlayPrevChapterChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var l;return(l=s.onSeekToInteractiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var l;return(l=s.onGraphButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var l;return(l=s.onLiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.time.subscribe(d=>{var l;return(l=s.onTimeUpdateChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.episodes.subscribe(d=>{var l;return(l=s.onEpisodesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var l;return(l=s.onSubtitlesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.settings.subscribe(d=>{var l;return(l=s.onSettingsChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var l;return(l=s.onFullscreenChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var l;return(l=s.onChromecastChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.pip.subscribe(d=>{var l;return(l=s.onPipChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var l;return(l=s.onVkLogoChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var l;return(l=s.onInteractiveTimeIndicatorChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.timeline.subscribe(d=>{var l;return(l=s.onTimelineChanged)==null?void 0:l.call(s,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){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&(0,Ui.isNonNullable)(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{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;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:a}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let s=(i=this.store)==null?void 0:i.interfaceLanguage$,d=s?we(s):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:p,historyApi:f,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new a({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:d,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:p,historyApi:f,vkVideoLoader:_,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,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:u,isSeekable$:$}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add($.subscribe(y=>{if(!this.isInited)return;let S=this.store;y?S.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):S.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(u.subscribe(y=>{this.store&&this.store.state.isInteractiveExpectation$.set(y)}));let w=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(y=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...y.config,title:(l==null?void 0:l.title)||y.config.title};let S=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(y.player,S),w&&(w=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:y,actionType:S})=>{var I,A,P,E,T,R;if(!this.store||!this.microStoresRoot)return;let z=u.getValue();if(y==="action-choice"&&S==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(jl)),y==="action-choice-canceled"){let Y=we(this.store.state.isPlaying$)||z;if(((P=(I=this.videoConfig)==null?void 0:I.isTouch)!=null?P:(A=this.videoConfig)!=null&&A.isMobile)&&Y){this.store.ui.interactiveHideMobileControls.set(!0);return}(R=(E=this.videoConfig)==null?void 0:(T=E.callbacks).onDisabledInteractiveClick)==null||R.call(T)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:y,removeAllOpenURI:S})=>{this.store&&y==="container-fake-removed"&&S&&this.store.ui.controls.disabledControls$.remove(jl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let y=this.interactiveController.getHistoryState();this.subscription.add(y.history$.subscribe(S=>{var I,A,P;S.length&&((P=(A=(I=this.videoConfig)==null?void 0:I.callbacks)==null?void 0:A.onInteractiveHistoryChanged)==null||P.call(A,S))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var y,S,I,A;(y=this.microStoresRoot)==null||y.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(A=(S=this.videoConfig)==null?void 0:(I=S.callbacks).onInteractiveTimeIndicatorClick)==null||A.call(I)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(y=>{this.log({message:y.toString()})}))}catch(a){this.log({message:a.message})}}initPlayer(e,i={}){var o,n,a,s,d,l,p,f,_,u,$,w,y,S,I,A,P,E,T,R,z,Y,U,Z,J,oe;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=Kd(ox,(0,Ui.cloneDeepWith)(e,ce=>ce instanceof HTMLElement?ce:void 0)),this.uiConfig=qg((o=i.ui)!=null?o:{}),this.coreConfig=(n=i.core)!=null?n:{configName:[]},this.statisticsConfig=(a=i.statistics)!=null?a:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:(s=this.uiConfig.sentry)!=null?s:{}},this.uiConfig.features.exposeInternalsToGlobal&&((d=this.internalsExposure)!=null||(this.internalsExposure=new Ui.InternalsExposure("UI"))),pl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((l=this.videoConfig)==null?void 0:l.showAds)],numbers:[(0,Y1.now)()]}),(0,Ui.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(f=(p=this.uiConfig.features.mediaSession)!=null?p:this.videoConfig.isMediaSessionEnabled)!=null?f:!0),(0,Ui.isNonNullable)(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(u=(_=this.uiConfig.features.pip)!=null?_:this.videoConfig.isPictureInPictureEnabled)!=null?u:!0,this.uiConfig.features.dpip=(w=($=this.uiConfig.features.dpip)!=null?$:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0),this.videoConfig.isTouch=(S=(y=this.uiConfig.isMobile)!=null?y:this.videoConfig.isTouch)!=null?S:this.videoConfig.isMobile,(I=this.videoConfig).autoplay&&(I.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(A=this.uiConfig.ads.enable)!=null?A:this.videoConfig.showAds,this.videoConfig.adsSlotId=(P=this.uiConfig.ads.slot)!=null?P:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(E=this.uiConfig.ads.preview)!=null?E:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((T=this.uiConfig.showLogo)!=null?T:!this.videoConfig.logoHidden),(R=this.videoConfig).canRewindLive&&(R.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(z=this.videoConfig.supportLink)!=null?z:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(Y=this.uiConfig.features.endScreen)!=null?Y:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(U=this.uiConfig.features.autoplayNext)!=null?U:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(Z=this.uiConfig.features.nextPrevButtons)!=null?Z:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((J=this.videoConfig.videos)!=null&&J[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let ce={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=_u.getLatestSupportedVersion(ce):this.pictureInPictureApi=new Js(ce)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new gu:void 0,this.slotsApi=this.uiConfig.features.slots?new pu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new bu(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),(oe=this.slotsApi)==null||oe.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),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]),U1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}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(wn)&&(r(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(wn).nextButtonActive=this.isNextButtonActive(),r(wn).prevButtonActive=this.isPrevButtonActive(),r(wn).endScreenVideoTitle=o.nextVideoTitle,r(wn).endScreenVideoThumb=o.nextVideoThumb,r(wn).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",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>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})}}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)}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(wn)&&(r(wn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(wn).nextButtonActive=this.isNextButtonActive(),r(wn).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)}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})}setLiveWaitingRecover(){var e;this.log({message:"live waiting"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!0),(o=this.store)==null||o.destroy()})}setLiveWaitingRecord(){var e;this.log({message:"post live"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecord(!0),(o=this.store)==null||o.destroy()})}setLiveEnd(e){var i;this.log({message:"live ended"}),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var o,n;(o=this.store)==null||o.actions.internal.setLiveWaitingRecover(!1),(n=this.store)==null||n.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}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=we(this.store.state.positionExact$),s=we(this.store.state.interactiveEpisodes$).find(l=>!l.completed);this.interactiveController.events.playerChanged$.pipe((0,Ui.once)()).subscribe(()=>{s&&n>=s.time?this.seekTime(s.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)}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}unmountComponent(e){e&&Ks(e)}};var fl=require("@vkontakte/videoplayer-shared/es2018"),Tu=require("@vkontakte/videoplayer-core/es2018"),nx=()=>{window.customElements.define("vk-video-player",Su)};
|
|
364
|
+
`),n=document.createElement("style");n.textContent=o;let a=this.createStretchedContainer(),s=a.attachShadow({mode:"open"});s.append(n),s.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=ts(Xm,d),(e=this.pipWindow)==null||e.document.body.append(a),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",l=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Ks(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)==null||i.close(),e()})}async dispose(){await this.remove()}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 U1(t){return t instanceof qd}var _u=class{static getLatestSupportedVersion(e){let i=new Js,o=new qd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Kd(t,e){var n,a;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let s of i)o[s]=(a=(n=e[s])!=null?n:t[s])!=null?a:void 0;return o}var z1="Inner error. Unexpectedly root annotation container null reference exception",q1="Annotation with such name already exists",K1="Annotation with such name does not exist";var cl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var ul=require("@vkontakte/videoplayer-shared/es2018"),Z3="1",X3=100,bu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new ul.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,ul.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"},X3);this.subscriptions.add((0,ul.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 cl(z1);if(this.annotations.has(e))throw new cl(q1);i.style.zIndex=(o=i.style.zIndex)!=null?o:Z3,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 cl(K1);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,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};var _a=require("@vkontakte/videoplayer-shared/es2018"),qo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,_a.assertNonNullable)(e),(0,_a.assertNonNullable)(i),(0,_a.assertNonNullable)(n),n.interactiveData&&(0,_a.assertNonNullable)(o),this.subscription=new _a.Subscription,this.subscription}};var Wd=class extends qo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var Qd=class extends qo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:p,isMobile:f}=a.ui,_=we(f),u=()=>_&&we(p);return o.add(p.subscribe($=>{if(!_)return;let w=we(s);we(l)?this.state$.set($):w!==null&&this.state$.set(!w||$)})),o.add(l.subscribe($=>{this.state$.set(!$||u())})),o.add(s.subscribe($=>{if($===null)return;let w=we(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!$)})),o}};var Gd=class extends qo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ae("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};var W1=require("@vkontakte/videoplayer-shared/es2018"),Jm=ae(!1),$u=null,Yd=class extends qo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Jm,set:(i,o=!1)=>{i!==we(Jm)&&(this.clearTimeout(),Jm.set(i),!i&&$u&&($u=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(l.subscribe(_=>{we(s)&&_&&this.state$.set(!1)}));let f=(a==null?void 0:a.interactiveData)||{tooltipHelpHintActive:!1};return o.add((0,W1.combine)({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:p}).subscribe(({isPlaying$:_,isInteractiveTime$:u,interactiveTimeIndicator:$})=>{var w,y;if(!(!_||!($!=null&&$.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&$u===null&&($u=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(y=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||y.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var yu=require("@vkontakte/videoplayer-shared/es2018");var jd=class extends qo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:yu.noop};this.checkIfShouldHide=i=>Is(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(we(s)))return;let l=we(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:_}=n.ui.controls,u=we(p),$=we(f);if(l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1),_.remove(Ip),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=$==="playing";try{await(a==null?void 0:a.toggleGraphView(!0)),this.state$.set(!0),_.add(Ip),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add((0,yu.combine)({graphIsOpened:this.state$,currentGridType:s}).subscribe(async({graphIsOpened:l,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1)}catch(_){d({message:"Cant hide graph"})}})),o}};var ev=require("@vkontakte/videoplayer-shared/es2018"),Zd=class extends qo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ae(!1),isEnabled$:ae(!1),type$:ae(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new ev.ValueSubject(!1),isEnabled$:new ev.ValueSubject(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};var wu=require("@vkontakte/videoplayer-shared/es2018");var xu=require("@vkontakte/videoplayer-shared/es2018"),Q1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?J3({maxCount:t}):void 0,e!==0?ex({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},J3=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,xu.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}}},ex=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(xu.safeStorage.get(e)||"{}")}catch(a){return{}}},o=a=>xu.safeStorage.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o({...i(),[a]:{timeout:t,launchTime:Date.now()}})},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var Xd=class extends qo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ae({}),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:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=Q1({maxShowCount:a,timeout:s});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe((0,wu.filterChanged)(),(0,wu.filter)(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var G1=()=>[Wd,Qd,Gd,Yd,jd,Zd,Xd].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var pl=require("@vkontakte/videoplayer-shared/es2018");var tx=Object.defineProperty,ix=(t,e,i)=>e in t?tx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Zt=(t,e,i)=>ix(t,typeof e!="symbol"?e+"":e,i),ox={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Ui.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,Jd.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},wn=ee(void 0),Su=class extends HTMLElement{constructor(){super(),Zt(this,"svelteStubComponent"),Zt(this,"svelteRootComponent"),Zt(this,"store"),Zt(this,"microStoresRoot"),Zt(this,"statistics"),Zt(this,"sentry"),Zt(this,"_shadowRoot"),Zt(this,"playerContainer"),Zt(this,"rootContainer"),Zt(this,"shadowRootContainer"),Zt(this,"uiConfig"),Zt(this,"coreConfig"),Zt(this,"statisticsConfig"),Zt(this,"interactiveController"),Zt(this,"interactiveContainer"),Zt(this,"graphMadePause"),Zt(this,"currentPlayingVideoIndex",0),Zt(this,"needToRepeatPlaylist",!1),Zt(this,"videoConfig"),Zt(this,"pictureInPictureApi"),Zt(this,"mediaSessionApi"),Zt(this,"unsubscribePlayerPhaseSubscription"),Zt(this,"logger"),Zt(this,"log"),Zt(this,"subscription"),Zt(this,"interactiveSubscription"),Zt(this,"annotationsApi"),Zt(this,"slotsApi"),Zt(this,"prevIsid"),Zt(this,"isInited",!1),Zt(this,"internalsExposure",null),Zt(this,"createOneStat",(e,i={})=>{var o,n,a,s;let{albumId:d,statPlace:l,statUserSalt:p,statTrackCode:f,statVKAppId:_,refreshStatAuthToken:u,autoplay:$,isMobile:w,isTouch:y,refDomain:S,deviceId:I,interactiveData:A}=Kd(this.videoConfig,i),P=(o=A==null?void 0:A.projectInfo)==null?void 0:o.pid,E=(a=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?a:!1;E&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&T)return new Cu.OneStat({movieId:T,albumId:d,place:l,trackCode:f,vkAppId:_,autoplay:(s=$&&!this.interactiveController)!=null?s:!1,mobile:y!=null?y:w,clip:R,refDomain:S,deviceId:I,...P&&(!this.isInited||E)&&{projectId:Number(P)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}),pl.devNull.create("ui"),this.logger=new Ui.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Ui.Subscription,this.interactiveSubscription=new Ui.Subscription,this.graphMadePause=!1}connectedCallback(){var e,i;if(this.isInited)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,a=he({title:o,thumbUrl:n}),s={target:this.playerContainer,props:a};this.svelteStubComponent=ts(jm,s)}disconnectedCallback(){var e,i,o,n,a;(e=this.annotationsApi)==null||e.destroy(),(i=this.mediaSessionApi)==null||i.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)==null||o.call(this),(n=this.interactiveController)==null||n.destroy(),this.interactiveSubscription.unsubscribe(),(a=this.internalsExposure)==null||a.destroy(),pl.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={}){let{deviceId:o,preload:n,refreshStatAuthToken:a}=Kd(this.videoConfig,i),{unitedVideoId:s}=e;return new Cu.ThinOneStat.ThinOneStat({deviceId:o,movieId:s,preload:n},{config:this.statisticsConfig,refreshAuthToken:a})}createPlayer(e,i={},o){var n,a,s,d,l,p,f,_,u;if(!this.videoConfig)return;let{albumId:$,statPlace:w,statAuthToken:y,preload:S,autoplay:I,volume:A,muted:P,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:Y,adsParams:U={},adsPreviewParam:Z,adsAutoplayParam:J,interfaceLanguage:oe,isCyrillicRelatedInterface:ce,logoClickable:le,logoHidden:Le,isMobile:Re,isTouch:X,isAudioDisabled:Me,isLiveCatchUpMode:j,fullScreenTarget:N,failoverHosts:Ve,canDownload:xe,callbacks:re,interactiveData:Be,showThumbTimer:ue,additionalButtons:D=[],additionalSettingsMenuItems:de=[],additionalContextMenuItems:Ee=[],repeat:Ge,saveRate:lt,volumeMultiplier:Ae,showEndScreen:ye,showAutoplayNext:Pe}=Kd(this.videoConfig,i),{sources:rt,title:ft,thumbUrl:it,unitedVideoId:Rt,isClip:st=!1,duration:mt,adsParams:Ut={},videoEpisodes:qt,previewThumbsData:Ne,subtitles:ne,live:W}=e,se={...U,...Ut},pe=this.getNextVideoInfo(),Ce={sources:rt,title:ft,thumbUrl:it,subtitles:ne,unitedVideoId:Rt,isClip:st,live:W,albumId:$,statPlace:w,autoplay:I,muted:P,volume:A,fromTime:E,canRewindLive:T,showAds:z,adsSlotId:Y,adsParams:se,adsPreviewParam:Z,adsAutoplayParam:J,duration:mt,logoClickable:le,logoHidden:Le,isTouch:X!=null?X:Re,repeat:Ge,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:pe.nextVideoTitle,endScreenVideoThumb:pe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Oe={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Ce)}`});let ct=(n=this.interactiveController)==null?void 0:n.state.statistics$.getValue(),Bt,Ke=this.createThinOneStat(e,i);(Bt||Ke)&&(this.statistics=new iu(Bt,Ke,ct==null?void 0:ct.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Xs(this.uiConfig.sentry,{version:Ys,env:Ec},{movieId:Rt,albumId:$,place:w,autoplay:(a=I&&!this.interactiveController)!=null?a:!1,mobile:X!=null?X:Re,clip:st}),this.interactiveController&&((l=this.prevIsid)!=null||(this.prevIsid=(d=(s=this.statistics)==null?void 0:s.oneStat)==null?void 0:d.isid$.getValue())),this.sentry={...this.sentry,...Xs.getInstance()};let Je=!!Be,xt=[],Qt="tooltip_interactive_go_back_disabled_first";if(Je&&this.interactiveController){let oi=this.interactiveController.state.isInitialChapter$.getValue(),Ii=this.interactiveController.getHistoryState();oi&&xt.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||xt.push("SEEK_TO_INTERACTIVE_BUTTON"),Ii.hasPrevChapter$.getValue()||(xt.push("PLAY_PREV_CHAPTER_BUTTON"),oi||(Ii.isGoBackLimited$.getValue()?Qt="tooltip_interactive_go_back_disabled_limit":Qt="tooltip_interactive_go_back_disabled"))}let je=()=>{var oi;this.isInited=!1,this.prevIsid=void 0;let Ii=(o==null?void 0:o.info.isEnded$.getValue())&&((oi=this.interactiveController)==null?void 0:oi.state.isEndChapter$.getValue());re.onReplayInteractiveVideo&&!Ii?re.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=c1({player:o,interfaceLanguage:oe,isCyrillicRelatedInterface:ce,videoId:Rt,isClip:st,isLiveCatchUpMode:j,isAudioDisabled:Me,statAuthToken:y,callbacks:re,webApi:Oe,videoEpisodes:qt,previewThumbsData:Ne,canDownload:xe,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:xt,isInteractive:Je,saveRate:lt,interactiveRanges$:(p=this.interactiveController)==null?void 0:p.state.interactiveRanges$,isInteractiveTime$:(f=this.interactiveController)==null?void 0:f.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:je,playPrevChapterDisabledTooltip:Qt,hasInteractiveBranches:!!((u=(_=this.interactiveController)==null?void 0:_.getChapterBranches())!=null&&u.length),additionalButtons:this.uiConfig.features.additionalButtons?D:[],additionalSettingsMenuItems:de!=null?de:[],additionalContextMenuItems:Ee!=null?Ee:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ge&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:Ct}=this.microStoresRoot=G1(),di=()=>{var oi,Ii,zi,Ro,wo,So;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(H=>{var We;return(We=re==null?void 0:re.onCurrentFormatChanged)==null?void 0:We.call(re,H)})),this.subscription.add(Ct.interactiveControlsOpacity$.subscribe(H=>{var We;H!==null&&((We=this==null?void 0:this.interactiveController)==null||We.setDisabledControls(H))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(H=>{var We;return(We=re==null?void 0:re.onThroughputEstimationChanged)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(H=>{var We;return(We=re==null?void 0:re.onTrafficSavingEnabledChanged)==null?void 0:We.call(re,H)})),this.subscription.add(new Ui.Observable(H=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(We=>H.next(We)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?(0,Ui.skip)(1):H=>H).subscribe(H=>{var We;return(We=re==null?void 0:re.onCurrentPlaybackRateChanged)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.volume$.subscribe(H=>{var We;return(We=re==null?void 0:re.onVolumeChange)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.muted$.subscribe(H=>{var We,ni;return H?(We=re==null?void 0:re.onMute)==null?void 0:We.call(re):(ni=re==null?void 0:re.onUnmute)==null?void 0:ni.call(re)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(H=>{var We;return(We=re==null?void 0:re.onVideoBitrateChanged)==null?void 0:We.call(re,H)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(H=>{var We;let ni=(We=this.store)==null?void 0:We.ui.controls.disabledControls$;ni&&(H&&!ni.includes(Yl)&&ni.add(Yl),H||ni.remove(Yl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async H=>{var We;if(!Jd.clientChecker.browser.isSamsungBrowser||!H||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((We=this.videoConfig)==null?void 0:We.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(H=>{var We;return(We=re==null?void 0:re.onVSIDChanged)==null?void 0:We.call(re,H)})),this.initMediaSession(),O(wn,he({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:rt,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:ft,thumbUrl:it,subtitles:ne,live:W,preload:S,autoplay:I,muted:P,volume:A,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:Y,adsParams:se,adsPreviewParam:Z,adsAutoplayParam:J,duration:mt,logoClickable:le,logoHidden:Le,isMobile:X!=null?X:Re,failoverHosts:Ve,fullScreenTarget:N,saveRate:lt,shadowRootContainer:this.shadowRootContainer,showMiniTimer:ue,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:pe.nextVideoTitle,endScreenVideoThumb:pe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:ye,showAutoplayNext:Pe}));let Bo={target:this.playerContainer,props:r(wn)};this.svelteRootComponent=ts(Qm,Bo),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(zi=(Ii=(oi=this.videoConfig)==null?void 0:oi.callbacks)==null?void 0:Ii.onInited)==null||zi.call(Ii)),(Ro=this.internalsExposure)==null||Ro.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((So=(wo=this.videoConfig)==null?void 0:wo.callbacks)!=null&&So.onDevNullLog)?pl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):pl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?Jd.clientChecker.isInited$.subscribe(oi=>{oi&&(console.log("UI SDK async start"),di())}):di()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let a=(i=this.videoConfig)==null?void 0:i.callbacks;a&&this.subscription.add(o.playerPhase.subscribe(d=>{var l;return(l=a.onPlayerPhaseChanged)==null?void 0:l.call(a,d)})).add(o.state.playbackState$.subscribe(d=>{var l;return d&&((l=a.onPlaybackStateChanged)==null?void 0:l.call(a,d))})).add(o.state.isLive$.subscribe(d=>{var l;return(l=a.onIsLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isActiveLive$.subscribe(d=>{var l;return(l=a.onIsActiveLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var l;return(l=a.onIsAudioAvailableChanged)==null?void 0:l.call(a,d)})).add(o.state.currentQuality$.subscribe(d=>{var l;return(l=a.onCurrentQualityChanged)==null?void 0:l.call(a,d)})).add(o.state.availableQualities$.subscribe(d=>{var l;return(l=a.onAvailableQualitiesChanged)==null?void 0:l.call(a,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&a.onAudioLanguagesAvailable&&a.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var l,p;return d?(l=a.onPiPEnter)==null?void 0:l.call(a):(p=a.onPiPExit)==null?void 0:p.call(a)}));let s=a==null?void 0:a.uiInfo;s&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var l;return(l=s.onControlsVisibleChanged)==null?void 0:l.call(s,d)})).add(o.ui.isMobile.subscribe(d=>{var l;return(l=s.onIsMobileChanged)==null?void 0:l.call(s,d)})).add(o.ui.playerSize.subscribe(d=>{var l;return(l=s.onPlayerSizeChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var l;return(l=s.onPrevButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playButton.subscribe(d=>{var l;return(l=s.onPlayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var l;return(l=s.onReplayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var l;return(l=s.onNextButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var l;return(l=s.onPlayPrevChapterChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var l;return(l=s.onSeekToInteractiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var l;return(l=s.onGraphButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var l;return(l=s.onLiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.time.subscribe(d=>{var l;return(l=s.onTimeUpdateChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.episodes.subscribe(d=>{var l;return(l=s.onEpisodesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var l;return(l=s.onSubtitlesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.settings.subscribe(d=>{var l;return(l=s.onSettingsChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var l;return(l=s.onFullscreenChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var l;return(l=s.onChromecastChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.pip.subscribe(d=>{var l;return(l=s.onPipChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var l;return(l=s.onVkLogoChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var l;return(l=s.onInteractiveTimeIndicatorChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.timeline.subscribe(d=>{var l;return(l=s.onTimelineChanged)==null?void 0:l.call(s,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){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&(0,Ui.isNonNullable)(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{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;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:a}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let s=(i=this.store)==null?void 0:i.interfaceLanguage$,d=s?we(s):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:p,historyApi:f,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new a({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:d,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:p,historyApi:f,vkVideoLoader:_,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,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:u,isSeekable$:$}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add($.subscribe(y=>{if(!this.isInited)return;let S=this.store;y?S.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):S.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(u.subscribe(y=>{this.store&&this.store.state.isInteractiveExpectation$.set(y)}));let w=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(y=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...y.config,title:(l==null?void 0:l.title)||y.config.title};let S=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(y.player,S),w&&(w=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:y,actionType:S})=>{var I,A,P,E,T,R;if(!this.store||!this.microStoresRoot)return;let z=u.getValue();if(y==="action-choice"&&S==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(jl)),y==="action-choice-canceled"){let Y=we(this.store.state.isPlaying$)||z;if(((P=(I=this.videoConfig)==null?void 0:I.isTouch)!=null?P:(A=this.videoConfig)!=null&&A.isMobile)&&Y){this.store.ui.interactiveHideMobileControls.set(!0);return}(R=(E=this.videoConfig)==null?void 0:(T=E.callbacks).onDisabledInteractiveClick)==null||R.call(T)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:y,removeAllOpenURI:S})=>{this.store&&y==="container-fake-removed"&&S&&this.store.ui.controls.disabledControls$.remove(jl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let y=this.interactiveController.getHistoryState();this.subscription.add(y.history$.subscribe(S=>{var I,A,P;S.length&&((P=(A=(I=this.videoConfig)==null?void 0:I.callbacks)==null?void 0:A.onInteractiveHistoryChanged)==null||P.call(A,S))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var y,S,I,A;(y=this.microStoresRoot)==null||y.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(A=(S=this.videoConfig)==null?void 0:(I=S.callbacks).onInteractiveTimeIndicatorClick)==null||A.call(I)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(y=>{this.log({message:y.toString()})}))}catch(a){this.log({message:a.message})}}initPlayer(e,i={}){var o,n,a,s,d,l,p,f,_,u,$,w,y,S,I,A,P,E,T,R,z,Y,U,Z,J,oe;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=Kd(ox,(0,Ui.cloneDeepWith)(e,ce=>ce instanceof HTMLElement?ce:void 0)),this.uiConfig=qg((o=i.ui)!=null?o:{}),this.coreConfig=(n=i.core)!=null?n:{configName:[]},this.statisticsConfig=(a=i.statistics)!=null?a:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:(s=this.uiConfig.sentry)!=null?s:{}},this.uiConfig.features.exposeInternalsToGlobal&&((d=this.internalsExposure)!=null||(this.internalsExposure=new Ui.InternalsExposure("UI"))),pl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((l=this.videoConfig)==null?void 0:l.showAds)],numbers:[(0,Y1.now)()]}),(0,Ui.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(f=(p=this.uiConfig.features.mediaSession)!=null?p:this.videoConfig.isMediaSessionEnabled)!=null?f:!0),(0,Ui.isNonNullable)(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(u=(_=this.uiConfig.features.pip)!=null?_:this.videoConfig.isPictureInPictureEnabled)!=null?u:!0,this.uiConfig.features.dpip=(w=($=this.uiConfig.features.dpip)!=null?$:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0),this.videoConfig.isTouch=(S=(y=this.uiConfig.isMobile)!=null?y:this.videoConfig.isTouch)!=null?S:this.videoConfig.isMobile,(I=this.videoConfig).autoplay&&(I.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(A=this.uiConfig.ads.enable)!=null?A:this.videoConfig.showAds,this.videoConfig.adsSlotId=(P=this.uiConfig.ads.slot)!=null?P:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(E=this.uiConfig.ads.preview)!=null?E:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((T=this.uiConfig.showLogo)!=null?T:!this.videoConfig.logoHidden),(R=this.videoConfig).canRewindLive&&(R.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(z=this.videoConfig.supportLink)!=null?z:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(Y=this.uiConfig.features.endScreen)!=null?Y:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(U=this.uiConfig.features.autoplayNext)!=null?U:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(Z=this.uiConfig.features.nextPrevButtons)!=null?Z:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((J=this.videoConfig.videos)!=null&&J[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let ce={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=_u.getLatestSupportedVersion(ce):this.pictureInPictureApi=new Js(ce)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new gu:void 0,this.slotsApi=this.uiConfig.features.slots?new pu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new bu(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),(oe=this.slotsApi)==null||oe.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),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]),U1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}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(wn)&&(r(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(wn).nextButtonActive=this.isNextButtonActive(),r(wn).prevButtonActive=this.isPrevButtonActive(),r(wn).endScreenVideoTitle=o.nextVideoTitle,r(wn).endScreenVideoThumb=o.nextVideoThumb,r(wn).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",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>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})}}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)}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(wn)&&(r(wn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(wn).nextButtonActive=this.isNextButtonActive(),r(wn).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)}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})}setLiveWaitingRecover(){var e;this.log({message:"live waiting"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!0),(o=this.store)==null||o.destroy()})}setLiveWaitingRecord(){var e;this.log({message:"post live"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecord(!0),(o=this.store)==null||o.destroy()})}setLiveEnd(e){var i;this.log({message:"live ended"}),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var o,n;(o=this.store)==null||o.actions.internal.setLiveWaitingRecover(!1),(n=this.store)==null||n.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}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=we(this.store.state.positionExact$),s=we(this.store.state.interactiveEpisodes$).find(l=>!l.completed);this.interactiveController.events.playerChanged$.pipe((0,Ui.once)()).subscribe(()=>{s&&n>=s.time?this.seekTime(s.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)}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}unmountComponent(e){e&&Ks(e)}};var fl=require("@vkontakte/videoplayer-shared/es2018"),Tu=require("@vkontakte/videoplayer-core/es2018"),nx=()=>{window.customElements.define("vk-video-player",Su)};
|