@vkontakte/videoplayer-shared 1.0.32-dev.935ac7b0.0 → 1.0.32
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 +3 -3
- package/es2015.esm.js +3 -3
- package/es2018.cjs.js +3 -3
- package/es2018.esm.js +3 -3
- package/esnext.cjs.js +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +1 -1
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const mn="1.0.32-dev.935ac7b0.0";class z{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const N=e=>{throw new Error(`${e} is value of unexpected type`)},wn=e=>{},B=()=>{};class w{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}:o={next:s=>t.next(s),error:s=>{var u;return(u=t.error)===null||u===void 0?void 0:u.call(t,s)}}:o={next:B,error:B};const i=typeof r=="function"?{next:s=>{try{r(s)}catch(u){o.next(u)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let a;try{a=this._subscribe(i)}catch(s){(n=i.error)===null||n===void 0||n.call(i,s)}return new z().add(()=>{switch(i.next=B,i.error=B,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return N(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Xe extends w{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new z().add(()=>this.subscribers.delete(t))}}class On{constructor(){this.log$=new Xe,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function En(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function $n(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ft(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function Sn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Tn(e,r){if(e!=null&&e.length)throw new Error(r)}const In=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const i=()=>{s(),o()},a=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",a),c.removeEventListener("error",i)};let u;t&&(u=window.setTimeout(i,t));const c=document.createElement("script");c.addEventListener("load",a),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)});var ge;const Rn=typeof((ge=window.performance)===null||ge===void 0?void 0:ge.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(e,r,t,n){function o(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function s(l){try{c(n.next(l))}catch(f){a(f)}}function u(l){try{c(n.throw(l))}catch(f){a(f)}}function c(l){l.done?i(l.value):o(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const Pn=(e,r)=>(...t)=>dt(void 0,void 0,void 0,function*(){var n;const o=r(...t);let i=e.aborted,a;for(;!i&&!e.aborted;)try{const s=yield o.next(a);i=(n=s.done)!==null&&n!==void 0?n:!1,a=s.value}catch(s){yield o.throw(s)}return a});exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Je=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,a=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,u=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,l=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,v=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||a||s||t||n||i||exports.CurrentClientBrowser.Rest,device:u||c||l||f||d||v||exports.CurrentClientDevice.Desktop}},_n=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},An=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Cn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device),jn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:i=0}={})=>{let a=r;return a*=Math.pow(t,e),a*=1+(Math.random()*i*2-i),a=Math.round(a),a=Math.min(a,n),a=Math.max(a,o),a};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let E,x;const me=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(me,"test"),localStorage.removeItem(me),x=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(me),x=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=p.RUNTIME;else throw r}else throw e}return x===p.RUNTIME&&(E=new Map),x},Ln=()=>Q()===p.LOCAL_STORAGE,xn=e=>{var r,t;const n=Q();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return E==null?void 0:E.get(e);default:N(n)}},Nn=(e,r)=>{const t=Q();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void(E==null?void 0:E.set(e,r));default:N(t)}},Mn=e=>{var r;const t=Q();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return N(t),!1}},Dn=e=>{const r=Q();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(E==null?void 0:E.delete(e));default:N(r)}},Fn=()=>{const e=Q();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return E==null?void 0:E.clear();default:N(e)}};var Gn=Object.freeze({__proto__:null,clear:Fn,get:xn,has:Mn,isPersistent:Ln,remove:Dn,set:Nn});const kn=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const $={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Vn=(e,r)=>$[e].height>$[r].height,Bn=(e,r)=>$[e].height>=$[r].height,Ze=(e,r)=>$[e].height<$[r].height,Un=(e,r)=>$[e].height<=$[r].height,Qn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ze(r,t)?1:-1)[0],ht=Object.keys($).sort((e,r)=>Ze(e,r)?-1:1),qn=(e,r=.02)=>[...ht].find(n=>$[n].height*(1+r)>=e),Kn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ht.find(o=>{const i=$[o];return i.width>=n&&i.height>=t})},Yn=e=>$[e].height,er=e=>e===exports.VideoQuality.INVARIANT,Wn=e=>e.every(r=>!er(r));function Hn(e){if(er(e))throw new Error("Expected exact quality")}const pt=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?t[n]=i:typeof o=="object"&&typeof i=="object"?t[n]=pt(i,o):t[n]=n in e?i:o}return t},zn=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function Xn(e,r=0,t){let n,o,i,a,s,u,c=0,l=!1,f=!1,v=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(l=!!t.leading,f="maxWait"in t,i=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function y(h){const S=n,L=o;return n=o=void 0,c=h,a=e.apply(L,S),a}function b(h,S){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,S)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=b(ee,r),l?y(h):a}function m(h){const S=h-u,L=h-c,br=r-S;return f?Math.min(br,i-L):br}function pr(h){const S=h-u,L=h-c;return u===void 0||S>=r||S<0||f&&L>=i}function ee(){const h=Date.now();if(pr(h))return yr(h);s=b(ee,m(h))}function yr(h){return s=void 0,v&&n?y(h):(n=o=void 0,a)}function yn(){s!==void 0&&O(s),c=0,n=u=o=s=void 0}function bn(){return s===void 0?a:yr(Date.now())}function gn(){return s!==void 0}function re(...h){const S=Date.now(),L=pr(S);if(n=h,o=this,u=S,L){if(s===void 0)return g(u);if(f)return s=b(ee,r),y(u)}return s===void 0&&(s=b(ee,r)),a}return re.cancel=yn,re.flush=bn,re.pending=gn,re}const rr=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=rr(e[n],r):t[n]=e[n]}return t},Jn=e=>rr(e);class Zn extends Xe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function eo(e){return new w(r=>{const t={};let n=Object.keys(e).length;const o=i=>a=>{i in t||n--,t[i]=a,n===0&&r.next(t)};return Object.entries(e).reduce((i,[a,s])=>i.add(s.subscribe(o(a))),new z)})}function ro(...e){return new w(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new z))}var to=e=>new w(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),no=e=>new w(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),oo=e=>new w(r=>{e.forEach(t=>r.next(t))}),io=(e,r)=>new w(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ao(e){return r=>new w(t=>r.subscribe(new so(t,e)))}class so{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const co={leading:!1,trailing:!0};function lo(e,r=co){return t=>new w(n=>t.subscribe(new uo(n,e,r)))}class uo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ft(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const fo={leading:!0,trailing:!1};function vo(e,r=fo){return t=>new w(n=>t.subscribe(new ho(n,e,r)))}class ho{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,vt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function po(e){return r=>new w(t=>r.subscribe(new yo(t,e)))}class yo{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function bo(e=(r,t)=>r===t){return r=>new w(t=>r.subscribe(new go(t,e)))}const gr={};class go{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=gr}next(r){let t;try{t=this.lastValue===gr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function yt(e){return r=>new w(t=>r.subscribe(new mo(t,e)))}let mo=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function wo(e){return yt(()=>e)}function Oo(){return e=>new w(r=>{let t=!1,n=!1;const o=e.subscribe(i=>{t||(t=!0,r.next(i)),n&&o.unsubscribe()},i=>{var a;t=!0,(a=r.error)===null||a===void 0||a.call(r,i),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Eo(){return e=>new w(r=>e.subscribe(new $o(r)))}class $o{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function So(e){return r=>new w(t=>r.subscribe(new To(t,e)))}class To{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class mr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,i=n.length;o<i;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,i=n.length;o<i;o++){const a=n[o];try{a.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}a.options&&a.options.once&&this.removeEventListener(r.type,a.callback)}return!r.defaultPrevented}}class bt extends mr{constructor(){super(),this.listeners||mr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class Io{constructor(){Object.defineProperty(this,"signal",{value:new bt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Io.prototype[Symbol.toStringTag]="AbortController",bt.prototype[Symbol.toStringTag]="AbortSignal");function gt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Ro(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!gt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:i};let i=t;(i&&!i.prototype.hasOwnProperty("signal")||o)&&(i=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const v=new t(c,l);return f&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),v},i.prototype=t.prototype);const a=r;return{fetch:(u,c)=>{const l=i&&i.prototype.isPrototypeOf(u)?u.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const v=new Promise((d,y)=>{l.addEventListener("abort",()=>y(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,a(u,c)])}return a(u,c)},Request:i}}const tr=gt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),mt=tr?Ro({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Po=tr?mt.fetch:window.fetch;tr?mt.Request:window.Request;var we=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function _o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A=function(e){try{return!!e()}catch(r){return!0}},Ao=A,ye=!Ao(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),wt=ye,Ot=Function.prototype,Be=Ot.call,Co=wt&&Ot.bind.bind(Be,Be),M=wt?Co:function(e){return function(){return Be.apply(e,arguments)}},Et=M,jo=Et({}.toString),Lo=Et("".slice),nr=function(e){return Lo(jo(e),8,-1)},xo=M,No=A,Mo=nr,Oe=Object,Do=xo("".split),Fo=No(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return Mo(e)=="String"?Do(e,""):Oe(e)}:Oe,or=function(e){return e==null},Go=or,ko=TypeError,$t=function(e){if(Go(e))throw ko("Can't call method on "+e);return e},Vo=Fo,Bo=$t,X=function(e){return Vo(Bo(e))},q={},te=function(e){return e&&e.Math==Math&&e},I=te(typeof globalThis=="object"&&globalThis)||te(typeof window=="object"&&window)||te(typeof self=="object"&&self)||te(typeof we=="object"&&we)||function(){return this}()||we||Function("return this")(),Ue=typeof document=="object"&&document.all,Uo=typeof Ue=="undefined"&&Ue!==void 0,St={all:Ue,IS_HTMLDDA:Uo},Tt=St,Qo=Tt.all,R=Tt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Qo}:function(e){return typeof e=="function"},qo=I,Ko=R,wr=qo.WeakMap,Yo=Ko(wr)&&/native code/.test(String(wr)),Or=R,It=St,Wo=It.all,K=It.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===Wo}:function(e){return typeof e=="object"?e!==null:Or(e)},Ho=A,D=!Ho(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},zo=I,Er=K,Qe=zo.document,Xo=Er(Qe)&&Er(Qe.createElement),Rt=function(e){return Xo?Qe.createElement(e):{}},Jo=D,Zo=A,ei=Rt,Pt=!Jo&&!Zo(function(){return Object.defineProperty(ei("div"),"a",{get:function(){return 7}}).a!=7}),ri=D,ti=A,_t=ri&&ti(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ni=K,oi=String,ii=TypeError,W=function(e){if(ni(e))return e;throw ii(oi(e)+" is not an object")},ai=ye,ne=Function.prototype.call,F=ai?ne.bind(ne):function(){return ne.apply(ne,arguments)},ir={},Ee=ir,$e=I,si=R,$r=function(e){return si(e)?e:void 0},At=function(e,r){return arguments.length<2?$r(Ee[e])||$r($e[e]):Ee[e]&&Ee[e][r]||$e[e]&&$e[e][r]},ci=M,Ct=ci({}.isPrototypeOf),li=typeof navigator!="undefined"&&String(navigator.userAgent)||"",jt=I,Se=li,Sr=jt.process,Tr=jt.Deno,Ir=Sr&&Sr.versions||Tr&&Tr.version,Rr=Ir&&Ir.v8,T,de;Rr&&(T=Rr.split("."),de=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!de&&Se&&(T=Se.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Se.match(/Chrome\/(\d+)/),T&&(de=+T[1])));var ui=de,Pr=ui,fi=A,vi=I,di=vi.String,Lt=!!Object.getOwnPropertySymbols&&!fi(function(){var e=Symbol();return!di(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),hi=Lt,xt=hi&&!Symbol.sham&&typeof Symbol.iterator=="symbol",pi=At,yi=R,bi=Ct,gi=xt,mi=Object,Nt=gi?function(e){return typeof e=="symbol"}:function(e){var r=pi("Symbol");return yi(r)&&bi(r.prototype,mi(e))},wi=String,ar=function(e){try{return wi(e)}catch(r){return"Object"}},Oi=R,Ei=ar,$i=TypeError,sr=function(e){if(Oi(e))return e;throw $i(Ei(e)+" is not a function")},Si=sr,Ti=or,cr=function(e,r){var t=e[r];return Ti(t)?void 0:Si(t)},Te=F,Ie=R,Re=K,Ii=TypeError,Ri=function(e,r){var t,n;if(r==="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e))||Ie(t=e.valueOf)&&!Re(n=Te(t,e))||r!=="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e)))return n;throw Ii("Can't convert object to primitive value")},Mt={exports:{}},_r=I,Pi=Object.defineProperty,_i=function(e,r){try{Pi(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},Ai=I,Ci=_i,Ar="__core-js_shared__",ji=Ai[Ar]||Ci(Ar,{}),Dt=ji,Cr=Dt;(Mt.exports=function(e,r){return Cr[e]||(Cr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ft=Mt.exports,Li=$t,xi=Object,Gt=function(e){return xi(Li(e))},Ni=M,Mi=Gt,Di=Ni({}.hasOwnProperty),j=Object.hasOwn||function(r,t){return Di(Mi(r),t)},Fi=M,Gi=0,ki=Math.random(),Vi=Fi(1 .toString),kt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Vi(++Gi+ki,36)},Bi=I,Ui=Ft,jr=j,Qi=kt,qi=Lt,Ki=xt,U=Bi.Symbol,Pe=Ui("wks"),Yi=Ki?U.for||U:U&&U.withoutSetter||Qi,C=function(e){return jr(Pe,e)||(Pe[e]=qi&&jr(U,e)?U[e]:Yi("Symbol."+e)),Pe[e]},Wi=F,Lr=K,xr=Nt,Hi=cr,zi=Ri,Xi=C,Ji=TypeError,Zi=Xi("toPrimitive"),ea=function(e,r){if(!Lr(e)||xr(e))return e;var t=Hi(e,Zi),n;if(t){if(r===void 0&&(r="default"),n=Wi(t,e,r),!Lr(n)||xr(n))return n;throw Ji("Can't convert object to primitive value")}return r===void 0&&(r="number"),zi(e,r)},ra=ea,ta=Nt,lr=function(e){var r=ra(e,"string");return ta(r)?r:r+""},na=D,oa=Pt,ia=_t,oe=W,Nr=lr,aa=TypeError,_e=Object.defineProperty,sa=Object.getOwnPropertyDescriptor,Ae="enumerable",Ce="configurable",je="writable";Y.f=na?ia?function(r,t,n){if(oe(r),t=Nr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&je in n&&!n[je]){var o=sa(r,t);o&&o[je]&&(r[t]=n.value,n={configurable:Ce in n?n[Ce]:o[Ce],enumerable:Ae in n?n[Ae]:o[Ae],writable:!1})}return _e(r,t,n)}:_e:function(r,t,n){if(oe(r),t=Nr(t),oe(n),oa)try{return _e(r,t,n)}catch(o){}if("get"in n||"set"in n)throw aa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var be=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},ca=D,la=Y,ua=be,J=ca?function(e,r,t){return la.f(e,r,ua(1,t))}:function(e,r,t){return e[r]=t,e},fa=Ft,va=kt,Mr=fa("keys"),ur=function(e){return Mr[e]||(Mr[e]=va(e))},fr={},da=Yo,Vt=I,ha=K,pa=J,Le=j,xe=Dt,ya=ur,ba=fr,Dr="Object already initialized",qe=Vt.TypeError,ga=Vt.WeakMap,he,H,pe,ma=function(e){return pe(e)?H(e):he(e,{})},wa=function(e){return function(r){var t;if(!ha(r)||(t=H(r)).type!==e)throw qe("Incompatible receiver, "+e+" required");return t}};if(da||xe.state){var P=xe.state||(xe.state=new ga);P.get=P.get,P.has=P.has,P.set=P.set,he=function(e,r){if(P.has(e))throw qe(Dr);return r.facade=e,P.set(e,r),r},H=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=ya("state");ba[G]=!0,he=function(e,r){if(Le(e,G))throw qe(Dr);return r.facade=e,pa(e,G,r),r},H=function(e){return Le(e,G)?e[G]:{}},pe=function(e){return Le(e,G)}}var Oa={set:he,get:H,has:pe,enforce:ma,getterFor:wa},Ea=ye,Bt=Function.prototype,Fr=Bt.apply,Gr=Bt.call,$a=typeof Reflect=="object"&&Reflect.apply||(Ea?Gr.bind(Fr):function(){return Gr.apply(Fr,arguments)}),Sa=nr,Ta=M,Ut=function(e){if(Sa(e)==="Function")return Ta(e)},Qt={},qt={},Kt={}.propertyIsEnumerable,Yt=Object.getOwnPropertyDescriptor,Ia=Yt&&!Kt.call({1:2},1);qt.f=Ia?function(r){var t=Yt(this,r);return!!t&&t.enumerable}:Kt;var Ra=D,Pa=F,_a=qt,Aa=be,Ca=X,ja=lr,La=j,xa=Pt,kr=Object.getOwnPropertyDescriptor;Qt.f=Ra?kr:function(r,t){if(r=Ca(r),t=ja(t),xa)try{return kr(r,t)}catch(n){}if(La(r,t))return Aa(!Pa(_a.f,r,t),r[t])};var Na=A,Ma=R,Da=/#|\.prototype\./,Z=function(e,r){var t=Ga[Fa(e)];return t==Va?!0:t==ka?!1:Ma(r)?Na(r):!!r},Fa=Z.normalize=function(e){return String(e).replace(Da,".").toLowerCase()},Ga=Z.data={},ka=Z.NATIVE="N",Va=Z.POLYFILL="P",Ba=Z,Vr=Ut,Ua=sr,Qa=ye,qa=Vr(Vr.bind),Wt=function(e,r){return Ua(e),r===void 0?e:Qa?qa(e,r):function(){return e.apply(r,arguments)}},ie=I,Ka=$a,Ya=Ut,Wa=R,Ha=Qt.f,za=Ba,k=ir,Xa=Wt,V=J,Br=j,Ja=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Ka(e,this,arguments)};return r.prototype=e.prototype,r},Ht=function(e,r){var t=e.target,n=e.global,o=e.stat,i=e.proto,a=n?ie:o?ie[t]:(ie[t]||{}).prototype,s=n?k:k[t]||V(k,t,{})[t],u=s.prototype,c,l,f,v,d,y,b,O,g;for(v in r)c=za(n?v:t+(o?".":"#")+v,e.forced),l=!c&&a&&Br(a,v),y=s[v],l&&(e.dontCallGetSet?(g=Ha(a,v),b=g&&g.value):b=a[v]),d=l&&b?b:r[v],!(l&&typeof y==typeof d)&&(e.bind&&l?O=Xa(d,ie):e.wrap&&l?O=Ja(d):i&&Wa(d)?O=Ya(d):O=d,(e.sham||d&&d.sham||y&&y.sham)&&V(O,"sham",!0),V(s,v,O),i&&(f=t+"Prototype",Br(k,f)||V(k,f,{}),V(k[f],v,d),e.real&&u&&(c||!u[v])&&V(u,v,d)))},Ke=D,Za=j,zt=Function.prototype,es=Ke&&Object.getOwnPropertyDescriptor,vr=Za(zt,"name"),rs=vr&&function(){}.name==="something",ts=vr&&(!Ke||Ke&&es(zt,"name").configurable),ns={EXISTS:vr,PROPER:rs,CONFIGURABLE:ts},Xt={},os=Math.ceil,is=Math.floor,as=Math.trunc||function(r){var t=+r;return(t>0?is:os)(t)},ss=as,Jt=function(e){var r=+e;return r!==r||r===0?0:ss(r)},cs=Jt,ls=Math.max,us=Math.min,fs=function(e,r){var t=cs(e);return t<0?ls(t+r,0):us(t,r)},vs=Jt,ds=Math.min,hs=function(e){return e>0?ds(vs(e),9007199254740991):0},ps=hs,Zt=function(e){return ps(e.length)},ys=X,bs=fs,gs=Zt,Ur=function(e){return function(r,t,n){var o=ys(r),i=gs(o),a=bs(n,i),s;if(e&&t!=t){for(;i>a;)if(s=o[a++],s!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===t)return e||a||0;return!e&&-1}},ms={includes:Ur(!0),indexOf:Ur(!1)},ws=M,Ne=j,Os=X,Es=ms.indexOf,$s=fr,Qr=ws([].push),Ss=function(e,r){var t=Os(e),n=0,o=[],i;for(i in t)!Ne($s,i)&&Ne(t,i)&&Qr(o,i);for(;r.length>n;)Ne(t,i=r[n++])&&(~Es(o,i)||Qr(o,i));return o},en=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ts=Ss,Is=en,Rs=Object.keys||function(r){return Ts(r,Is)},Ps=D,_s=_t,As=Y,Cs=W,js=X,Ls=Rs;Xt.f=Ps&&!_s?Object.defineProperties:function(r,t){Cs(r);for(var n=js(t),o=Ls(t),i=o.length,a=0,s;i>a;)As.f(r,s=o[a++],n[s]);return r};var xs=At,Ns=xs("document","documentElement"),Ms=W,Ds=Xt,qr=en,Fs=fr,Gs=Ns,ks=Rt,Vs=ur,Kr=">",Yr="<",Ye="prototype",We="script",rn=Vs("IE_PROTO"),Me=function(){},tn=function(e){return Yr+We+Kr+e+Yr+"/"+We+Kr},Wr=function(e){e.write(tn("")),e.close();var r=e.parentWindow.Object;return e=null,r},Bs=function(){var e=ks("iframe"),r="java"+We+":",t;return e.style.display="none",Gs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(tn("document.F=Object")),t.close(),t.F},ae,ue=function(){try{ae=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ae?Wr(ae):Bs():Wr(ae);for(var e=qr.length;e--;)delete ue[Ye][qr[e]];return ue()};Fs[rn]=!0;var nn=Object.create||function(r,t){var n;return r!==null?(Me[Ye]=Ms(r),n=new Me,Me[Ye]=null,n[rn]=r):n=ue(),t===void 0?n:Ds.f(n,t)},Us=A,Qs=!Us(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),qs=j,Ks=R,Ys=Gt,Ws=ur,Hs=Qs,Hr=Ws("IE_PROTO"),He=Object,zs=He.prototype,on=Hs?He.getPrototypeOf:function(e){var r=Ys(e);if(qs(r,Hr))return r[Hr];var t=r.constructor;return Ks(t)&&r instanceof t?t.prototype:r instanceof He?zs:null},Xs=J,an=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Xs(e,r,t),e},Js=A,Zs=R,ec=K,rc=nn,zr=on,tc=an,nc=C,ze=nc("iterator"),sn=!1,_,De,Fe;[].keys&&(Fe=[].keys(),"next"in Fe?(De=zr(zr(Fe)),De!==Object.prototype&&(_=De)):sn=!0);var oc=!ec(_)||Js(function(){var e={};return _[ze].call(e)!==e});oc?_={}:_=rc(_);Zs(_[ze])||tc(_,ze,function(){return this});var cn={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:sn},ic=C,ac=ic("toStringTag"),ln={};ln[ac]="z";var dr=String(ln)==="[object z]",sc=dr,cc=R,fe=nr,lc=C,uc=lc("toStringTag"),fc=Object,vc=fe(function(){return arguments}())=="Arguments",dc=function(e,r){try{return e[r]}catch(t){}},hr=sc?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=dc(r=fc(e),uc))=="string"?t:vc?fe(r):(n=fe(r))=="Object"&&cc(r.callee)?"Arguments":n},hc=dr,pc=hr,yc=hc?{}.toString:function(){return"[object "+pc(this)+"]"},bc=dr,gc=Y.f,mc=J,wc=j,Oc=yc,Ec=C,Xr=Ec("toStringTag"),un=function(e,r,t,n){if(e){var o=t?e:e.prototype;wc(o,Xr)||gc(o,Xr,{configurable:!0,value:r}),n&&!bc&&mc(o,"toString",Oc)}},$c=cn.IteratorPrototype,Sc=nn,Tc=be,Ic=un,Rc=q,Pc=function(){return this},_c=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Sc($c,{next:Tc(+!n,t)}),Ic(e,o,!1,!0),Rc[o]=Pc,e},Ac=Ht,Cc=F,fn=ns,jc=_c,Lc=on,xc=un,Jr=an,Nc=C,Zr=q,vn=cn,Mc=fn.PROPER;fn.CONFIGURABLE;vn.IteratorPrototype;var se=vn.BUGGY_SAFARI_ITERATORS,Ge=Nc("iterator"),et="keys",ce="values",rt="entries",Dc=function(){return this},Fc=function(e,r,t,n,o,i,a){jc(t,r,n);var s=function(g){if(g===o&&v)return v;if(!se&&g in l)return l[g];switch(g){case et:return function(){return new t(this,g)};case ce:return function(){return new t(this,g)};case rt:return function(){return new t(this,g)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[Ge]||l["@@iterator"]||o&&l[o],v=!se&&f||s(o),d=r=="Array"&&l.entries||f,y,b,O;if(d&&(y=Lc(d.call(new e)),y!==Object.prototype&&y.next&&(xc(y,u,!0,!0),Zr[u]=Dc)),Mc&&o==ce&&f&&f.name!==ce&&(c=!0,v=function(){return Cc(f,this)}),o)if(b={values:s(ce),keys:i?v:s(et),entries:s(rt)},a)for(O in b)(se||c||!(O in l))&&Jr(l,O,b[O]);else Ac({target:r,proto:!0,forced:se||c},b);return a&&l[Ge]!==v&&Jr(l,Ge,v,{name:o}),Zr[r]=v,b},Gc=function(e,r){return{value:e,done:r}},kc=X,tt=q,dn=Oa;Y.f;var Vc=Fc,le=Gc,hn="Array Iterator",Bc=dn.set,Uc=dn.getterFor(hn);Vc(Array,"Array",function(e,r){Bc(this,{type:hn,target:kc(e),index:0,kind:r})},function(){var e=Uc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,le(void 0,!0)):t=="keys"?le(n,!1):t=="values"?le(r[n],!1):le([n,r[n]],!1)},"values");tt.Arguments=tt.Array;var Qc=C,qc=q,Kc=Qc("iterator"),Yc=Array.prototype,Wc=function(e){return e!==void 0&&(qc.Array===e||Yc[Kc]===e)},Hc=hr,nt=cr,zc=or,Xc=q,Jc=C,Zc=Jc("iterator"),pn=function(e){if(!zc(e))return nt(e,Zc)||nt(e,"@@iterator")||Xc[Hc(e)]},el=F,rl=sr,tl=W,nl=ar,ol=pn,il=TypeError,al=function(e,r){var t=arguments.length<2?ol(e):r;if(rl(t))return tl(el(t,e));throw il(nl(e)+" is not iterable")},sl=F,ot=W,cl=cr,ll=function(e,r,t){var n,o;ot(e);try{if(n=cl(e,"return"),!n){if(r==="throw")throw t;return t}n=sl(n,e)}catch(i){o=!0,n=i}if(r==="throw")throw t;if(o)throw n;return ot(n),t},ul=Wt,fl=F,vl=W,dl=ar,hl=Wc,pl=Zt,it=Ct,yl=al,bl=pn,at=ll,gl=TypeError,ve=function(e,r){this.stopped=e,this.result=r},st=ve.prototype,ml=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),i=!!(t&&t.IS_RECORD),a=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=ul(r,n),c,l,f,v,d,y,b,O=function(m){return c&&at(c,"normal",m),new ve(!0,m)},g=function(m){return o?(vl(m),s?u(m[0],m[1],O):u(m[0],m[1])):s?u(m,O):u(m)};if(i)c=e.iterator;else if(a)c=e;else{if(l=bl(e),!l)throw gl(dl(e)+" is not iterable");if(hl(l)){for(f=0,v=pl(e);v>f;f++)if(d=g(e[f]),d&&it(st,d))return d;return new ve(!1)}c=yl(e,l)}for(y=i?e.next:c.next;!(b=fl(y,c)).done;){try{d=g(b.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&it(st,d))return d}return new ve(!1)},wl=lr,Ol=Y,El=be,$l=function(e,r,t){var n=wl(r);n in e?Ol.f(e,n,El(0,t)):e[n]=t},Sl=Ht,Tl=ml,Il=$l;Sl({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Tl(r,function(n,o){Il(t,n,o)},{AS_ENTRIES:!0}),t}});var Rl=ir,Pl=Rl.Object.fromEntries,_l={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Al=_l,Cl=I,jl=hr,Ll=J,ct=q,xl=C,lt=xl("toStringTag");for(var ke in Al){var ut=Cl[ke],Ve=ut&&ut.prototype;Ve&&jl(Ve)!==lt&&Ll(Ve,lt,ke),ct[ke]=ct.Array}var Nl=Pl,Ml=Nl,Dl=Ml,Fl=Dl,Gl=_o(Fl);exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const kl="vk.com",Vl=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${kl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const i=yield(yield Po(n.toString())).json();return Bl(i,t)}),Bl=(e,r)=>Gl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Ul(n)])),Ul=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=On;exports.Observable=w;exports.Subject=Xe;exports.Subscription=z;exports.VERSION=mn;exports.ValueSubject=Zn;exports.abortable=Pn;exports.addScript=In;exports.areQualitiesExact=Wn;exports.assertEmptyArray=Tn;exports.assertNever=N;exports.assertNonNullable=En;exports.assertNotEmptyArray=Sn;exports.assertNullable=$n;exports.assertQualityIsExact=Hn;exports.buffer=ao;exports.checkNever=wn;exports.cloneDeep=Jn;exports.cloneDeepWith=rr;exports.combine=eo;exports.debounce=lo;exports.debounceFn=Xn;exports.detectEmbed=kn;exports.fillWithDefault=pt;exports.filter=po;exports.filterChanged=bo;exports.fromEvent=io;exports.getCurrentBrowser=Je;exports.getExponentialDelay=jn;exports.getHighestQuality=Qn;exports.getIOSVersion=An;exports.interval=no;exports.isHigher=Vn;exports.isHigherOrEqual=Bn;exports.isIOS=_n;exports.isInvariantQuality=er;exports.isLower=Ze;exports.isLowerOrEqual=Un;exports.isMacLike=Cn;exports.isNonNullable=ft;exports.isNullable=vt;exports.loadVKLangPack=Vl;exports.map=yt;exports.mapTo=wo;exports.merge=ro;exports.noop=B;exports.now=Rn;exports.observableFrom=oo;exports.once=Oo;exports.pairwise=Eo;exports.safeStorage=Gn;exports.tap=So;exports.throttle=vo;exports.timeCodeToString=zn;exports.timeout=to;exports.videoHeightToQuality=qn;exports.videoQualityToHeight=Yn;exports.videoSizeToQuality=Kn;
|
|
6
|
+
"use strict";const mn="1.0.32";class z{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const N=e=>{throw new Error(`${e} is value of unexpected type`)},wn=e=>{},B=()=>{};class w{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}:o={next:s=>t.next(s),error:s=>{var u;return(u=t.error)===null||u===void 0?void 0:u.call(t,s)}}:o={next:B,error:B};const i=typeof r=="function"?{next:s=>{try{r(s)}catch(u){o.next(u)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let a;try{a=this._subscribe(i)}catch(s){(n=i.error)===null||n===void 0||n.call(i,s)}return new z().add(()=>{switch(i.next=B,i.error=B,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return N(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Xe extends w{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new z().add(()=>this.subscribers.delete(t))}}class On{constructor(){this.log$=new Xe,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function En(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function $n(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ft(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function Sn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Tn(e,r){if(e!=null&&e.length)throw new Error(r)}const In=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const i=()=>{s(),o()},a=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",a),c.removeEventListener("error",i)};let u;t&&(u=window.setTimeout(i,t));const c=document.createElement("script");c.addEventListener("load",a),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)});var ge;const Rn=typeof((ge=window.performance)===null||ge===void 0?void 0:ge.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(e,r,t,n){function o(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function s(l){try{c(n.next(l))}catch(f){a(f)}}function u(l){try{c(n.throw(l))}catch(f){a(f)}}function c(l){l.done?i(l.value):o(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const Pn=(e,r)=>(...t)=>dt(void 0,void 0,void 0,function*(){var n;const o=r(...t);let i=e.aborted,a;for(;!i&&!e.aborted;)try{const s=yield o.next(a);i=(n=s.done)!==null&&n!==void 0?n:!1,a=s.value}catch(s){yield o.throw(s)}return a});exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Je=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,a=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,u=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,l=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,v=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||a||s||t||n||i||exports.CurrentClientBrowser.Rest,device:u||c||l||f||d||v||exports.CurrentClientDevice.Desktop}},_n=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},An=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Cn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device),Ln=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:i=0}={})=>{let a=r;return a*=Math.pow(t,e),a*=1+(Math.random()*i*2-i),a=Math.round(a),a=Math.min(a,n),a=Math.max(a,o),a};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let E,x;const me=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(me,"test"),localStorage.removeItem(me),x=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(me),x=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=p.RUNTIME;else throw r}else throw e}return x===p.RUNTIME&&(E=new Map),x},jn=()=>Q()===p.LOCAL_STORAGE,xn=e=>{var r,t;const n=Q();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return E==null?void 0:E.get(e);default:N(n)}},Nn=(e,r)=>{const t=Q();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void(E==null?void 0:E.set(e,r));default:N(t)}},Mn=e=>{var r;const t=Q();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return N(t),!1}},Dn=e=>{const r=Q();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(E==null?void 0:E.delete(e));default:N(r)}},Fn=()=>{const e=Q();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return E==null?void 0:E.clear();default:N(e)}};var Gn=Object.freeze({__proto__:null,clear:Fn,get:xn,has:Mn,isPersistent:jn,remove:Dn,set:Nn});const kn=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const $={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Vn=(e,r)=>$[e].height>$[r].height,Bn=(e,r)=>$[e].height>=$[r].height,Ze=(e,r)=>$[e].height<$[r].height,Un=(e,r)=>$[e].height<=$[r].height,Qn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ze(r,t)?1:-1)[0],ht=Object.keys($).sort((e,r)=>Ze(e,r)?-1:1),qn=(e,r=.02)=>[...ht].find(n=>$[n].height*(1+r)>=e),Kn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ht.find(o=>{const i=$[o];return i.width>=n&&i.height>=t})},Yn=e=>$[e].height,er=e=>e===exports.VideoQuality.INVARIANT,Wn=e=>e.every(r=>!er(r));function Hn(e){if(er(e))throw new Error("Expected exact quality")}const pt=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?t[n]=i:typeof o=="object"&&typeof i=="object"?t[n]=pt(i,o):t[n]=n in e?i:o}return t},zn=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function Xn(e,r=0,t){let n,o,i,a,s,u,c=0,l=!1,f=!1,v=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(l=!!t.leading,f="maxWait"in t,i=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function y(h){const S=n,j=o;return n=o=void 0,c=h,a=e.apply(j,S),a}function b(h,S){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,S)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=b(ee,r),l?y(h):a}function m(h){const S=h-u,j=h-c,br=r-S;return f?Math.min(br,i-j):br}function pr(h){const S=h-u,j=h-c;return u===void 0||S>=r||S<0||f&&j>=i}function ee(){const h=Date.now();if(pr(h))return yr(h);s=b(ee,m(h))}function yr(h){return s=void 0,v&&n?y(h):(n=o=void 0,a)}function yn(){s!==void 0&&O(s),c=0,n=u=o=s=void 0}function bn(){return s===void 0?a:yr(Date.now())}function gn(){return s!==void 0}function re(...h){const S=Date.now(),j=pr(S);if(n=h,o=this,u=S,j){if(s===void 0)return g(u);if(f)return s=b(ee,r),y(u)}return s===void 0&&(s=b(ee,r)),a}return re.cancel=yn,re.flush=bn,re.pending=gn,re}const rr=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=rr(e[n],r):t[n]=e[n]}return t},Jn=e=>rr(e);class Zn extends Xe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function eo(e){return new w(r=>{const t={};let n=Object.keys(e).length;const o=i=>a=>{i in t||n--,t[i]=a,n===0&&r.next(t)};return Object.entries(e).reduce((i,[a,s])=>i.add(s.subscribe(o(a))),new z)})}function ro(...e){return new w(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new z))}var to=e=>new w(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),no=e=>new w(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),oo=e=>new w(r=>{e.forEach(t=>r.next(t))}),io=(e,r)=>new w(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ao(e){return r=>new w(t=>r.subscribe(new so(t,e)))}class so{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const co={leading:!1,trailing:!0};function lo(e,r=co){return t=>new w(n=>t.subscribe(new uo(n,e,r)))}class uo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ft(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const fo={leading:!0,trailing:!1};function vo(e,r=fo){return t=>new w(n=>t.subscribe(new ho(n,e,r)))}class ho{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,vt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function po(e){return r=>new w(t=>r.subscribe(new yo(t,e)))}class yo{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function bo(e=(r,t)=>r===t){return r=>new w(t=>r.subscribe(new go(t,e)))}const gr={};class go{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=gr}next(r){let t;try{t=this.lastValue===gr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function yt(e){return r=>new w(t=>r.subscribe(new mo(t,e)))}let mo=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function wo(e){return yt(()=>e)}function Oo(){return e=>new w(r=>{let t=!1,n=!1;const o=e.subscribe(i=>{t||(t=!0,r.next(i)),n&&o.unsubscribe()},i=>{var a;t=!0,(a=r.error)===null||a===void 0||a.call(r,i),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Eo(){return e=>new w(r=>e.subscribe(new $o(r)))}class $o{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function So(e){return r=>new w(t=>r.subscribe(new To(t,e)))}class To{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class mr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,i=n.length;o<i;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,i=n.length;o<i;o++){const a=n[o];try{a.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}a.options&&a.options.once&&this.removeEventListener(r.type,a.callback)}return!r.defaultPrevented}}class bt extends mr{constructor(){super(),this.listeners||mr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class Io{constructor(){Object.defineProperty(this,"signal",{value:new bt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Io.prototype[Symbol.toStringTag]="AbortController",bt.prototype[Symbol.toStringTag]="AbortSignal");function gt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Ro(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!gt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:i};let i=t;(i&&!i.prototype.hasOwnProperty("signal")||o)&&(i=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const v=new t(c,l);return f&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),v},i.prototype=t.prototype);const a=r;return{fetch:(u,c)=>{const l=i&&i.prototype.isPrototypeOf(u)?u.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const v=new Promise((d,y)=>{l.addEventListener("abort",()=>y(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,a(u,c)])}return a(u,c)},Request:i}}const tr=gt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),mt=tr?Ro({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Po=tr?mt.fetch:window.fetch;tr?mt.Request:window.Request;var we=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function _o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A=function(e){try{return!!e()}catch(r){return!0}},Ao=A,ye=!Ao(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),wt=ye,Ot=Function.prototype,Be=Ot.call,Co=wt&&Ot.bind.bind(Be,Be),M=wt?Co:function(e){return function(){return Be.apply(e,arguments)}},Et=M,Lo=Et({}.toString),jo=Et("".slice),nr=function(e){return jo(Lo(e),8,-1)},xo=M,No=A,Mo=nr,Oe=Object,Do=xo("".split),Fo=No(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return Mo(e)=="String"?Do(e,""):Oe(e)}:Oe,or=function(e){return e==null},Go=or,ko=TypeError,$t=function(e){if(Go(e))throw ko("Can't call method on "+e);return e},Vo=Fo,Bo=$t,X=function(e){return Vo(Bo(e))},q={},te=function(e){return e&&e.Math==Math&&e},I=te(typeof globalThis=="object"&&globalThis)||te(typeof window=="object"&&window)||te(typeof self=="object"&&self)||te(typeof we=="object"&&we)||function(){return this}()||we||Function("return this")(),Ue=typeof document=="object"&&document.all,Uo=typeof Ue=="undefined"&&Ue!==void 0,St={all:Ue,IS_HTMLDDA:Uo},Tt=St,Qo=Tt.all,R=Tt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Qo}:function(e){return typeof e=="function"},qo=I,Ko=R,wr=qo.WeakMap,Yo=Ko(wr)&&/native code/.test(String(wr)),Or=R,It=St,Wo=It.all,K=It.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===Wo}:function(e){return typeof e=="object"?e!==null:Or(e)},Ho=A,D=!Ho(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},zo=I,Er=K,Qe=zo.document,Xo=Er(Qe)&&Er(Qe.createElement),Rt=function(e){return Xo?Qe.createElement(e):{}},Jo=D,Zo=A,ei=Rt,Pt=!Jo&&!Zo(function(){return Object.defineProperty(ei("div"),"a",{get:function(){return 7}}).a!=7}),ri=D,ti=A,_t=ri&&ti(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ni=K,oi=String,ii=TypeError,W=function(e){if(ni(e))return e;throw ii(oi(e)+" is not an object")},ai=ye,ne=Function.prototype.call,F=ai?ne.bind(ne):function(){return ne.apply(ne,arguments)},ir={},Ee=ir,$e=I,si=R,$r=function(e){return si(e)?e:void 0},At=function(e,r){return arguments.length<2?$r(Ee[e])||$r($e[e]):Ee[e]&&Ee[e][r]||$e[e]&&$e[e][r]},ci=M,Ct=ci({}.isPrototypeOf),li=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Lt=I,Se=li,Sr=Lt.process,Tr=Lt.Deno,Ir=Sr&&Sr.versions||Tr&&Tr.version,Rr=Ir&&Ir.v8,T,de;Rr&&(T=Rr.split("."),de=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!de&&Se&&(T=Se.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Se.match(/Chrome\/(\d+)/),T&&(de=+T[1])));var ui=de,Pr=ui,fi=A,vi=I,di=vi.String,jt=!!Object.getOwnPropertySymbols&&!fi(function(){var e=Symbol();return!di(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),hi=jt,xt=hi&&!Symbol.sham&&typeof Symbol.iterator=="symbol",pi=At,yi=R,bi=Ct,gi=xt,mi=Object,Nt=gi?function(e){return typeof e=="symbol"}:function(e){var r=pi("Symbol");return yi(r)&&bi(r.prototype,mi(e))},wi=String,ar=function(e){try{return wi(e)}catch(r){return"Object"}},Oi=R,Ei=ar,$i=TypeError,sr=function(e){if(Oi(e))return e;throw $i(Ei(e)+" is not a function")},Si=sr,Ti=or,cr=function(e,r){var t=e[r];return Ti(t)?void 0:Si(t)},Te=F,Ie=R,Re=K,Ii=TypeError,Ri=function(e,r){var t,n;if(r==="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e))||Ie(t=e.valueOf)&&!Re(n=Te(t,e))||r!=="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e)))return n;throw Ii("Can't convert object to primitive value")},Mt={exports:{}},_r=I,Pi=Object.defineProperty,_i=function(e,r){try{Pi(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},Ai=I,Ci=_i,Ar="__core-js_shared__",Li=Ai[Ar]||Ci(Ar,{}),Dt=Li,Cr=Dt;(Mt.exports=function(e,r){return Cr[e]||(Cr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ft=Mt.exports,ji=$t,xi=Object,Gt=function(e){return xi(ji(e))},Ni=M,Mi=Gt,Di=Ni({}.hasOwnProperty),L=Object.hasOwn||function(r,t){return Di(Mi(r),t)},Fi=M,Gi=0,ki=Math.random(),Vi=Fi(1 .toString),kt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Vi(++Gi+ki,36)},Bi=I,Ui=Ft,Lr=L,Qi=kt,qi=jt,Ki=xt,U=Bi.Symbol,Pe=Ui("wks"),Yi=Ki?U.for||U:U&&U.withoutSetter||Qi,C=function(e){return Lr(Pe,e)||(Pe[e]=qi&&Lr(U,e)?U[e]:Yi("Symbol."+e)),Pe[e]},Wi=F,jr=K,xr=Nt,Hi=cr,zi=Ri,Xi=C,Ji=TypeError,Zi=Xi("toPrimitive"),ea=function(e,r){if(!jr(e)||xr(e))return e;var t=Hi(e,Zi),n;if(t){if(r===void 0&&(r="default"),n=Wi(t,e,r),!jr(n)||xr(n))return n;throw Ji("Can't convert object to primitive value")}return r===void 0&&(r="number"),zi(e,r)},ra=ea,ta=Nt,lr=function(e){var r=ra(e,"string");return ta(r)?r:r+""},na=D,oa=Pt,ia=_t,oe=W,Nr=lr,aa=TypeError,_e=Object.defineProperty,sa=Object.getOwnPropertyDescriptor,Ae="enumerable",Ce="configurable",Le="writable";Y.f=na?ia?function(r,t,n){if(oe(r),t=Nr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Le in n&&!n[Le]){var o=sa(r,t);o&&o[Le]&&(r[t]=n.value,n={configurable:Ce in n?n[Ce]:o[Ce],enumerable:Ae in n?n[Ae]:o[Ae],writable:!1})}return _e(r,t,n)}:_e:function(r,t,n){if(oe(r),t=Nr(t),oe(n),oa)try{return _e(r,t,n)}catch(o){}if("get"in n||"set"in n)throw aa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var be=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},ca=D,la=Y,ua=be,J=ca?function(e,r,t){return la.f(e,r,ua(1,t))}:function(e,r,t){return e[r]=t,e},fa=Ft,va=kt,Mr=fa("keys"),ur=function(e){return Mr[e]||(Mr[e]=va(e))},fr={},da=Yo,Vt=I,ha=K,pa=J,je=L,xe=Dt,ya=ur,ba=fr,Dr="Object already initialized",qe=Vt.TypeError,ga=Vt.WeakMap,he,H,pe,ma=function(e){return pe(e)?H(e):he(e,{})},wa=function(e){return function(r){var t;if(!ha(r)||(t=H(r)).type!==e)throw qe("Incompatible receiver, "+e+" required");return t}};if(da||xe.state){var P=xe.state||(xe.state=new ga);P.get=P.get,P.has=P.has,P.set=P.set,he=function(e,r){if(P.has(e))throw qe(Dr);return r.facade=e,P.set(e,r),r},H=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=ya("state");ba[G]=!0,he=function(e,r){if(je(e,G))throw qe(Dr);return r.facade=e,pa(e,G,r),r},H=function(e){return je(e,G)?e[G]:{}},pe=function(e){return je(e,G)}}var Oa={set:he,get:H,has:pe,enforce:ma,getterFor:wa},Ea=ye,Bt=Function.prototype,Fr=Bt.apply,Gr=Bt.call,$a=typeof Reflect=="object"&&Reflect.apply||(Ea?Gr.bind(Fr):function(){return Gr.apply(Fr,arguments)}),Sa=nr,Ta=M,Ut=function(e){if(Sa(e)==="Function")return Ta(e)},Qt={},qt={},Kt={}.propertyIsEnumerable,Yt=Object.getOwnPropertyDescriptor,Ia=Yt&&!Kt.call({1:2},1);qt.f=Ia?function(r){var t=Yt(this,r);return!!t&&t.enumerable}:Kt;var Ra=D,Pa=F,_a=qt,Aa=be,Ca=X,La=lr,ja=L,xa=Pt,kr=Object.getOwnPropertyDescriptor;Qt.f=Ra?kr:function(r,t){if(r=Ca(r),t=La(t),xa)try{return kr(r,t)}catch(n){}if(ja(r,t))return Aa(!Pa(_a.f,r,t),r[t])};var Na=A,Ma=R,Da=/#|\.prototype\./,Z=function(e,r){var t=Ga[Fa(e)];return t==Va?!0:t==ka?!1:Ma(r)?Na(r):!!r},Fa=Z.normalize=function(e){return String(e).replace(Da,".").toLowerCase()},Ga=Z.data={},ka=Z.NATIVE="N",Va=Z.POLYFILL="P",Ba=Z,Vr=Ut,Ua=sr,Qa=ye,qa=Vr(Vr.bind),Wt=function(e,r){return Ua(e),r===void 0?e:Qa?qa(e,r):function(){return e.apply(r,arguments)}},ie=I,Ka=$a,Ya=Ut,Wa=R,Ha=Qt.f,za=Ba,k=ir,Xa=Wt,V=J,Br=L,Ja=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Ka(e,this,arguments)};return r.prototype=e.prototype,r},Ht=function(e,r){var t=e.target,n=e.global,o=e.stat,i=e.proto,a=n?ie:o?ie[t]:(ie[t]||{}).prototype,s=n?k:k[t]||V(k,t,{})[t],u=s.prototype,c,l,f,v,d,y,b,O,g;for(v in r)c=za(n?v:t+(o?".":"#")+v,e.forced),l=!c&&a&&Br(a,v),y=s[v],l&&(e.dontCallGetSet?(g=Ha(a,v),b=g&&g.value):b=a[v]),d=l&&b?b:r[v],!(l&&typeof y==typeof d)&&(e.bind&&l?O=Xa(d,ie):e.wrap&&l?O=Ja(d):i&&Wa(d)?O=Ya(d):O=d,(e.sham||d&&d.sham||y&&y.sham)&&V(O,"sham",!0),V(s,v,O),i&&(f=t+"Prototype",Br(k,f)||V(k,f,{}),V(k[f],v,d),e.real&&u&&(c||!u[v])&&V(u,v,d)))},Ke=D,Za=L,zt=Function.prototype,es=Ke&&Object.getOwnPropertyDescriptor,vr=Za(zt,"name"),rs=vr&&function(){}.name==="something",ts=vr&&(!Ke||Ke&&es(zt,"name").configurable),ns={EXISTS:vr,PROPER:rs,CONFIGURABLE:ts},Xt={},os=Math.ceil,is=Math.floor,as=Math.trunc||function(r){var t=+r;return(t>0?is:os)(t)},ss=as,Jt=function(e){var r=+e;return r!==r||r===0?0:ss(r)},cs=Jt,ls=Math.max,us=Math.min,fs=function(e,r){var t=cs(e);return t<0?ls(t+r,0):us(t,r)},vs=Jt,ds=Math.min,hs=function(e){return e>0?ds(vs(e),9007199254740991):0},ps=hs,Zt=function(e){return ps(e.length)},ys=X,bs=fs,gs=Zt,Ur=function(e){return function(r,t,n){var o=ys(r),i=gs(o),a=bs(n,i),s;if(e&&t!=t){for(;i>a;)if(s=o[a++],s!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===t)return e||a||0;return!e&&-1}},ms={includes:Ur(!0),indexOf:Ur(!1)},ws=M,Ne=L,Os=X,Es=ms.indexOf,$s=fr,Qr=ws([].push),Ss=function(e,r){var t=Os(e),n=0,o=[],i;for(i in t)!Ne($s,i)&&Ne(t,i)&&Qr(o,i);for(;r.length>n;)Ne(t,i=r[n++])&&(~Es(o,i)||Qr(o,i));return o},en=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ts=Ss,Is=en,Rs=Object.keys||function(r){return Ts(r,Is)},Ps=D,_s=_t,As=Y,Cs=W,Ls=X,js=Rs;Xt.f=Ps&&!_s?Object.defineProperties:function(r,t){Cs(r);for(var n=Ls(t),o=js(t),i=o.length,a=0,s;i>a;)As.f(r,s=o[a++],n[s]);return r};var xs=At,Ns=xs("document","documentElement"),Ms=W,Ds=Xt,qr=en,Fs=fr,Gs=Ns,ks=Rt,Vs=ur,Kr=">",Yr="<",Ye="prototype",We="script",rn=Vs("IE_PROTO"),Me=function(){},tn=function(e){return Yr+We+Kr+e+Yr+"/"+We+Kr},Wr=function(e){e.write(tn("")),e.close();var r=e.parentWindow.Object;return e=null,r},Bs=function(){var e=ks("iframe"),r="java"+We+":",t;return e.style.display="none",Gs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(tn("document.F=Object")),t.close(),t.F},ae,ue=function(){try{ae=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ae?Wr(ae):Bs():Wr(ae);for(var e=qr.length;e--;)delete ue[Ye][qr[e]];return ue()};Fs[rn]=!0;var nn=Object.create||function(r,t){var n;return r!==null?(Me[Ye]=Ms(r),n=new Me,Me[Ye]=null,n[rn]=r):n=ue(),t===void 0?n:Ds.f(n,t)},Us=A,Qs=!Us(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),qs=L,Ks=R,Ys=Gt,Ws=ur,Hs=Qs,Hr=Ws("IE_PROTO"),He=Object,zs=He.prototype,on=Hs?He.getPrototypeOf:function(e){var r=Ys(e);if(qs(r,Hr))return r[Hr];var t=r.constructor;return Ks(t)&&r instanceof t?t.prototype:r instanceof He?zs:null},Xs=J,an=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Xs(e,r,t),e},Js=A,Zs=R,ec=K,rc=nn,zr=on,tc=an,nc=C,ze=nc("iterator"),sn=!1,_,De,Fe;[].keys&&(Fe=[].keys(),"next"in Fe?(De=zr(zr(Fe)),De!==Object.prototype&&(_=De)):sn=!0);var oc=!ec(_)||Js(function(){var e={};return _[ze].call(e)!==e});oc?_={}:_=rc(_);Zs(_[ze])||tc(_,ze,function(){return this});var cn={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:sn},ic=C,ac=ic("toStringTag"),ln={};ln[ac]="z";var dr=String(ln)==="[object z]",sc=dr,cc=R,fe=nr,lc=C,uc=lc("toStringTag"),fc=Object,vc=fe(function(){return arguments}())=="Arguments",dc=function(e,r){try{return e[r]}catch(t){}},hr=sc?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=dc(r=fc(e),uc))=="string"?t:vc?fe(r):(n=fe(r))=="Object"&&cc(r.callee)?"Arguments":n},hc=dr,pc=hr,yc=hc?{}.toString:function(){return"[object "+pc(this)+"]"},bc=dr,gc=Y.f,mc=J,wc=L,Oc=yc,Ec=C,Xr=Ec("toStringTag"),un=function(e,r,t,n){if(e){var o=t?e:e.prototype;wc(o,Xr)||gc(o,Xr,{configurable:!0,value:r}),n&&!bc&&mc(o,"toString",Oc)}},$c=cn.IteratorPrototype,Sc=nn,Tc=be,Ic=un,Rc=q,Pc=function(){return this},_c=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Sc($c,{next:Tc(+!n,t)}),Ic(e,o,!1,!0),Rc[o]=Pc,e},Ac=Ht,Cc=F,fn=ns,Lc=_c,jc=on,xc=un,Jr=an,Nc=C,Zr=q,vn=cn,Mc=fn.PROPER;fn.CONFIGURABLE;vn.IteratorPrototype;var se=vn.BUGGY_SAFARI_ITERATORS,Ge=Nc("iterator"),et="keys",ce="values",rt="entries",Dc=function(){return this},Fc=function(e,r,t,n,o,i,a){Lc(t,r,n);var s=function(g){if(g===o&&v)return v;if(!se&&g in l)return l[g];switch(g){case et:return function(){return new t(this,g)};case ce:return function(){return new t(this,g)};case rt:return function(){return new t(this,g)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[Ge]||l["@@iterator"]||o&&l[o],v=!se&&f||s(o),d=r=="Array"&&l.entries||f,y,b,O;if(d&&(y=jc(d.call(new e)),y!==Object.prototype&&y.next&&(xc(y,u,!0,!0),Zr[u]=Dc)),Mc&&o==ce&&f&&f.name!==ce&&(c=!0,v=function(){return Cc(f,this)}),o)if(b={values:s(ce),keys:i?v:s(et),entries:s(rt)},a)for(O in b)(se||c||!(O in l))&&Jr(l,O,b[O]);else Ac({target:r,proto:!0,forced:se||c},b);return a&&l[Ge]!==v&&Jr(l,Ge,v,{name:o}),Zr[r]=v,b},Gc=function(e,r){return{value:e,done:r}},kc=X,tt=q,dn=Oa;Y.f;var Vc=Fc,le=Gc,hn="Array Iterator",Bc=dn.set,Uc=dn.getterFor(hn);Vc(Array,"Array",function(e,r){Bc(this,{type:hn,target:kc(e),index:0,kind:r})},function(){var e=Uc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,le(void 0,!0)):t=="keys"?le(n,!1):t=="values"?le(r[n],!1):le([n,r[n]],!1)},"values");tt.Arguments=tt.Array;var Qc=C,qc=q,Kc=Qc("iterator"),Yc=Array.prototype,Wc=function(e){return e!==void 0&&(qc.Array===e||Yc[Kc]===e)},Hc=hr,nt=cr,zc=or,Xc=q,Jc=C,Zc=Jc("iterator"),pn=function(e){if(!zc(e))return nt(e,Zc)||nt(e,"@@iterator")||Xc[Hc(e)]},el=F,rl=sr,tl=W,nl=ar,ol=pn,il=TypeError,al=function(e,r){var t=arguments.length<2?ol(e):r;if(rl(t))return tl(el(t,e));throw il(nl(e)+" is not iterable")},sl=F,ot=W,cl=cr,ll=function(e,r,t){var n,o;ot(e);try{if(n=cl(e,"return"),!n){if(r==="throw")throw t;return t}n=sl(n,e)}catch(i){o=!0,n=i}if(r==="throw")throw t;if(o)throw n;return ot(n),t},ul=Wt,fl=F,vl=W,dl=ar,hl=Wc,pl=Zt,it=Ct,yl=al,bl=pn,at=ll,gl=TypeError,ve=function(e,r){this.stopped=e,this.result=r},st=ve.prototype,ml=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),i=!!(t&&t.IS_RECORD),a=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=ul(r,n),c,l,f,v,d,y,b,O=function(m){return c&&at(c,"normal",m),new ve(!0,m)},g=function(m){return o?(vl(m),s?u(m[0],m[1],O):u(m[0],m[1])):s?u(m,O):u(m)};if(i)c=e.iterator;else if(a)c=e;else{if(l=bl(e),!l)throw gl(dl(e)+" is not iterable");if(hl(l)){for(f=0,v=pl(e);v>f;f++)if(d=g(e[f]),d&&it(st,d))return d;return new ve(!1)}c=yl(e,l)}for(y=i?e.next:c.next;!(b=fl(y,c)).done;){try{d=g(b.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&it(st,d))return d}return new ve(!1)},wl=lr,Ol=Y,El=be,$l=function(e,r,t){var n=wl(r);n in e?Ol.f(e,n,El(0,t)):e[n]=t},Sl=Ht,Tl=ml,Il=$l;Sl({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Tl(r,function(n,o){Il(t,n,o)},{AS_ENTRIES:!0}),t}});var Rl=ir,Pl=Rl.Object.fromEntries,_l={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Al=_l,Cl=I,Ll=hr,jl=J,ct=q,xl=C,lt=xl("toStringTag");for(var ke in Al){var ut=Cl[ke],Ve=ut&&ut.prototype;Ve&&Ll(Ve)!==lt&&jl(Ve,lt,ke),ct[ke]=ct.Array}var Nl=Pl,Ml=Nl,Dl=Ml,Fl=Dl,Gl=_o(Fl);exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const kl="vk.com",Vl=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${kl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const i=yield(yield Po(n.toString())).json();return Bl(i,t)}),Bl=(e,r)=>Gl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Ul(n)])),Ul=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=On;exports.Observable=w;exports.Subject=Xe;exports.Subscription=z;exports.VERSION=mn;exports.ValueSubject=Zn;exports.abortable=Pn;exports.addScript=In;exports.areQualitiesExact=Wn;exports.assertEmptyArray=Tn;exports.assertNever=N;exports.assertNonNullable=En;exports.assertNotEmptyArray=Sn;exports.assertNullable=$n;exports.assertQualityIsExact=Hn;exports.buffer=ao;exports.checkNever=wn;exports.cloneDeep=Jn;exports.cloneDeepWith=rr;exports.combine=eo;exports.debounce=lo;exports.debounceFn=Xn;exports.detectEmbed=kn;exports.fillWithDefault=pt;exports.filter=po;exports.filterChanged=bo;exports.fromEvent=io;exports.getCurrentBrowser=Je;exports.getExponentialDelay=Ln;exports.getHighestQuality=Qn;exports.getIOSVersion=An;exports.interval=no;exports.isHigher=Vn;exports.isHigherOrEqual=Bn;exports.isIOS=_n;exports.isInvariantQuality=er;exports.isLower=Ze;exports.isLowerOrEqual=Un;exports.isMacLike=Cn;exports.isNonNullable=ft;exports.isNullable=vt;exports.loadVKLangPack=Vl;exports.map=yt;exports.mapTo=wo;exports.merge=ro;exports.noop=B;exports.now=Rn;exports.observableFrom=oo;exports.once=Oo;exports.pairwise=Eo;exports.safeStorage=Gn;exports.tap=So;exports.throttle=vo;exports.timeCodeToString=zn;exports.timeout=to;exports.videoHeightToQuality=qn;exports.videoQualityToHeight=Yn;exports.videoSizeToQuality=Kn;
|
package/es2015.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const al="1.0.32-dev.935ac7b0.0";class ge{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const K=e=>{throw new Error(`${e} is value of unexpected type`)},il=e=>{},X=()=>{};class E{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:X}:o={next:s=>t.next(s),error:s=>{var u;return(u=t.error)===null||u===void 0?void 0:u.call(t,s)}}:o={next:X,error:X};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(u){o.next(u)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new ge().add(()=>{switch(a.next=X,a.error=X,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return K(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class vt extends E{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new ge().add(()=>this.subscribers.delete(t))}}class sl{constructor(){this.log$=new vt,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function cl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function ll(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function wn(e){return typeof e!="undefined"&&e!==null}function $n(e){return e==null}function ul(e,r){if(!(e!=null&&e.length))throw new Error(r)}function fl(e,r){if(e!=null&&e.length)throw new Error(r)}const vl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",i),c.removeEventListener("error",a)};let u;t&&(u=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var we;const dl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(l){try{c(n.next(l))}catch(f){i(f)}}function u(l){try{c(n.throw(l))}catch(f){i(f)}}function c(l){l.done?a(l.value):o(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const hl=(e,r)=>(...t)=>dt(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){yield o.throw(s)}return i});var j;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(j||(j={}));var w;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(w||(w={}));const ht=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?j.Yandex:void 0,t=/chrome|crios/i.test(e)?j.Chrome:void 0,n=/chromium/i.test(e)?j.Chromium:void 0,o=/firefox|fxios/i.test(e)?j.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?j.Safari:void 0,i=/opr\//i.test(e)?j.Opera:void 0,s=/edg/i.test(e)?j.Edge:void 0,u=/android/i.test(e)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,l=/ipad/i.test(e)?w.iPad:void 0,f=/ipod/i.test(e)?w.iPod:void 0,v=/mac/i.test(e)?w.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:u||c||l||f||d||v||w.Desktop}},pl=(e=!1)=>{const t=[w.iPhone,w.iPad,w.iPod].includes(ht().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},bl=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},yl=()=>[w.Mac,w.iPhone,w.iPad,w.iPod].includes(ht().device),gl=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let $,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&($=new Map),F},En=()=>Y()===p.LOCAL_STORAGE,Sn=e=>{var r,t;const n=Y();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return $==null?void 0:$.get(e);default:K(n)}},Tn=(e,r)=>{const t=Y();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void($==null?void 0:$.set(e,r));default:K(t)}},In=e=>{var r;const t=Y();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=$==null?void 0:$.has(e))!==null&&r!==void 0?r:!1;default:return K(t),!1}},Rn=e=>{const r=Y();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void($==null?void 0:$.delete(e));default:K(r)}},Pn=()=>{const e=Y();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return $==null?void 0:$.clear();default:K(e)}};var ml=Object.freeze({__proto__:null,clear:Pn,get:Sn,has:In,isPersistent:En,remove:Rn,set:Tn});const Ol=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var S;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(S||(S={}));const T={[S.Q_144P]:{width:256,height:144},[S.Q_240P]:{width:428,height:240},[S.Q_360P]:{width:640,height:360},[S.Q_480P]:{width:856,height:480},[S.Q_720P]:{width:1280,height:720},[S.Q_1080P]:{width:1920,height:1080},[S.Q_1440P]:{width:2560,height:1440},[S.Q_2160P]:{width:3840,height:2160},[S.Q_4320P]:{width:7680,height:4320}},wl=(e,r)=>T[e].height>T[r].height,$l=(e,r)=>T[e].height>=T[r].height,pt=(e,r)=>T[e].height<T[r].height,El=(e,r)=>T[e].height<=T[r].height,Sl=e=>e.sort((r,t)=>r===t?0:r===S.INVARIANT?1:t===S.INVARIANT?-1:pt(r,t)?1:-1)[0],bt=Object.keys(T).sort((e,r)=>pt(e,r)?-1:1),Tl=(e,r=.02)=>[...bt].find(n=>T[n].height*(1+r)>=e),Il=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return bt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Rl=e=>T[e].height,yt=e=>e===S.INVARIANT,Pl=e=>e.every(r=>!yt(r));function _l(e){if(yt(e))throw new Error("Expected exact quality")}const _n=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=_n(a,o):t[n]=n in e?a:o}return t},Al=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function jl(e,r=0,t){let n,o,a,i,s,u,c=0,l=!1,f=!1,v=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(l=!!t.leading,f="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,v="trailing"in t?!!t.trailing:v);function b(h){const I=n,C=o;return n=o=void 0,c=h,i=e.apply(C,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=y(te,r),l?b(h):i}function m(h){const I=h-u,C=h-c,pr=r-I;return f?Math.min(pr,a-C):pr}function dr(h){const I=h-u,C=h-c;return u===void 0||I>=r||I<0||f&&C>=a}function te(){const h=Date.now();if(dr(h))return hr(h);s=y(te,m(h))}function hr(h){return s=void 0,v&&n?b(h):(n=o=void 0,i)}function gn(){s!==void 0&&O(s),c=0,n=u=o=s=void 0}function mn(){return s===void 0?i:hr(Date.now())}function On(){return s!==void 0}function ne(...h){const I=Date.now(),C=dr(I);if(n=h,o=this,u=I,C){if(s===void 0)return g(u);if(f)return s=y(te,r),b(u)}return s===void 0&&(s=y(te,r)),i}return ne.cancel=gn,ne.flush=mn,ne.pending=On,ne}const gt=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=gt(e[n],r):t[n]=e[n]}return t},xl=e=>gt(e);class Ll extends vt{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Ml(e){return new E(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new ge)})}function Nl(...e){return new E(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Cl=e=>new E(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Fl=e=>new E(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Dl=e=>new E(r=>{e.forEach(t=>r.next(t))}),Gl=(e,r)=>new E(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function kl(e){return r=>new E(t=>r.subscribe(new An(t,e)))}class An{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const jn={leading:!1,trailing:!0};function Ul(e,r=jn){return t=>new E(n=>t.subscribe(new xn(n,e,r)))}class xn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,wn(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Ln={leading:!0,trailing:!1};function Vl(e,r=Ln){return t=>new E(n=>t.subscribe(new Mn(n,e,r)))}class Mn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,$n(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Bl(e){return r=>new E(t=>r.subscribe(new Nn(t,e)))}class Nn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ql(e=(r,t)=>r===t){return r=>new E(t=>r.subscribe(new Cn(t,e)))}const br={};class Cn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=br}next(r){let t;try{t=this.lastValue===br||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Fn(e){return r=>new E(t=>r.subscribe(new Dn(t,e)))}let Dn=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Yl(e){return Fn(()=>e)}function Wl(){return e=>new E(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Ql(){return e=>new E(r=>e.subscribe(new Gn(r)))}class Gn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function zl(e){return r=>new E(t=>r.subscribe(new kn(t,e)))}class kn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var yr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(yr||(yr={}));class gr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class mt extends gr{constructor(){super(),this.listeners||gr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class Un{constructor(){Object.defineProperty(this,"signal",{value:new mt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Un.prototype[Symbol.toStringTag]="AbortController",mt.prototype[Symbol.toStringTag]="AbortSignal");function Ot(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Vn(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!Ot({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const v=new t(c,l);return f&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),v},a.prototype=t.prototype);const i=r;return{fetch:(u,c)=>{const l=a&&a.prototype.isPrototypeOf(u)?u.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const v=new Promise((d,b)=>{l.addEventListener("abort",()=>b(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,i(u,c)])}return i(u,c)},Request:a}}const er=Ot({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),wt=er?Vn({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Bn=er?wt.fetch:window.fetch;er?wt.Request:window.Request;var Ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L=function(e){try{return!!e()}catch(r){return!0}},Kn=L,me=!Kn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),$t=me,Et=Function.prototype,Ke=Et.call,Yn=$t&&Et.bind.bind(Ke,Ke),D=$t?Yn:function(e){return function(){return Ke.apply(e,arguments)}},St=D,Wn=St({}.toString),Qn=St("".slice),rr=function(e){return Qn(Wn(e),8,-1)},zn=D,Hn=L,Xn=rr,Se=Object,Jn=zn("".split),Zn=Hn(function(){return!Se("z").propertyIsEnumerable(0)})?function(e){return Xn(e)=="String"?Jn(e,""):Se(e)}:Se,tr=function(e){return e==null},eo=tr,ro=TypeError,Tt=function(e){if(eo(e))throw ro("Can't call method on "+e);return e},to=Zn,no=Tt,Z=function(e){return to(no(e))},W={},oe=function(e){return e&&e.Math==Math&&e},P=oe(typeof globalThis=="object"&&globalThis)||oe(typeof window=="object"&&window)||oe(typeof self=="object"&&self)||oe(typeof Ee=="object"&&Ee)||function(){return this}()||Ee||Function("return this")(),Ye=typeof document=="object"&&document.all,oo=typeof Ye=="undefined"&&Ye!==void 0,It={all:Ye,IS_HTMLDDA:oo},Rt=It,ao=Rt.all,_=Rt.IS_HTMLDDA?function(e){return typeof e=="function"||e===ao}:function(e){return typeof e=="function"},io=P,so=_,mr=io.WeakMap,co=so(mr)&&/native code/.test(String(mr)),Or=_,Pt=It,lo=Pt.all,Q=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===lo}:function(e){return typeof e=="object"?e!==null:Or(e)},uo=L,G=!uo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},fo=P,wr=Q,We=fo.document,vo=wr(We)&&wr(We.createElement),_t=function(e){return vo?We.createElement(e):{}},ho=G,po=L,bo=_t,At=!ho&&!po(function(){return Object.defineProperty(bo("div"),"a",{get:function(){return 7}}).a!=7}),yo=G,go=L,jt=yo&&go(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),mo=Q,Oo=String,wo=TypeError,H=function(e){if(mo(e))return e;throw wo(Oo(e)+" is not an object")},$o=me,ae=Function.prototype.call,k=$o?ae.bind(ae):function(){return ae.apply(ae,arguments)},nr={},Te=nr,Ie=P,Eo=_,$r=function(e){return Eo(e)?e:void 0},xt=function(e,r){return arguments.length<2?$r(Te[e])||$r(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},So=D,Lt=So({}.isPrototypeOf),To=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Mt=P,Re=To,Er=Mt.process,Sr=Mt.Deno,Tr=Er&&Er.versions||Sr&&Sr.version,Ir=Tr&&Tr.v8,R,pe;Ir&&(R=Ir.split("."),pe=R[0]>0&&R[0]<4?1:+(R[0]+R[1]));!pe&&Re&&(R=Re.match(/Edge\/(\d+)/),(!R||R[1]>=74)&&(R=Re.match(/Chrome\/(\d+)/),R&&(pe=+R[1])));var Io=pe,Rr=Io,Ro=L,Po=P,_o=Po.String,Nt=!!Object.getOwnPropertySymbols&&!Ro(function(){var e=Symbol();return!_o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rr&&Rr<41}),Ao=Nt,Ct=Ao&&!Symbol.sham&&typeof Symbol.iterator=="symbol",jo=xt,xo=_,Lo=Lt,Mo=Ct,No=Object,Ft=Mo?function(e){return typeof e=="symbol"}:function(e){var r=jo("Symbol");return xo(r)&&Lo(r.prototype,No(e))},Co=String,or=function(e){try{return Co(e)}catch(r){return"Object"}},Fo=_,Do=or,Go=TypeError,ar=function(e){if(Fo(e))return e;throw Go(Do(e)+" is not a function")},ko=ar,Uo=tr,ir=function(e,r){var t=e[r];return Uo(t)?void 0:ko(t)},Pe=k,_e=_,Ae=Q,Vo=TypeError,Bo=function(e,r){var t,n;if(r==="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e))||_e(t=e.valueOf)&&!Ae(n=Pe(t,e))||r!=="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e)))return n;throw Vo("Can't convert object to primitive value")},Dt={exports:{}},Pr=P,qo=Object.defineProperty,Ko=function(e,r){try{qo(Pr,e,{value:r,configurable:!0,writable:!0})}catch(t){Pr[e]=r}return r},Yo=P,Wo=Ko,_r="__core-js_shared__",Qo=Yo[_r]||Wo(_r,{}),Gt=Qo,Ar=Gt;(Dt.exports=function(e,r){return Ar[e]||(Ar[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var kt=Dt.exports,zo=Tt,Ho=Object,Ut=function(e){return Ho(zo(e))},Xo=D,Jo=Ut,Zo=Xo({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return Zo(Jo(r),t)},ea=D,ra=0,ta=Math.random(),na=ea(1 .toString),Vt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+na(++ra+ta,36)},oa=P,aa=kt,jr=N,ia=Vt,sa=Nt,ca=Ct,q=oa.Symbol,je=aa("wks"),la=ca?q.for||q:q&&q.withoutSetter||ia,M=function(e){return jr(je,e)||(je[e]=sa&&jr(q,e)?q[e]:la("Symbol."+e)),je[e]},ua=k,xr=Q,Lr=Ft,fa=ir,va=Bo,da=M,ha=TypeError,pa=da("toPrimitive"),ba=function(e,r){if(!xr(e)||Lr(e))return e;var t=fa(e,pa),n;if(t){if(r===void 0&&(r="default"),n=ua(t,e,r),!xr(n)||Lr(n))return n;throw ha("Can't convert object to primitive value")}return r===void 0&&(r="number"),va(e,r)},ya=ba,ga=Ft,sr=function(e){var r=ya(e,"string");return ga(r)?r:r+""},ma=G,Oa=At,wa=jt,ie=H,Mr=sr,$a=TypeError,xe=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",Ne="writable";z.f=ma?wa?function(r,t,n){if(ie(r),t=Mr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=Ea(r,t);o&&o[Ne]&&(r[t]=n.value,n={configurable:Me in n?n[Me]:o[Me],enumerable:Le in n?n[Le]:o[Le],writable:!1})}return xe(r,t,n)}:xe:function(r,t,n){if(ie(r),t=Mr(t),ie(n),Oa)try{return xe(r,t,n)}catch(o){}if("get"in n||"set"in n)throw $a("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var Oe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Sa=G,Ta=z,Ia=Oe,ee=Sa?function(e,r,t){return Ta.f(e,r,Ia(1,t))}:function(e,r,t){return e[r]=t,e},Ra=kt,Pa=Vt,Nr=Ra("keys"),cr=function(e){return Nr[e]||(Nr[e]=Pa(e))},lr={},_a=co,Bt=P,Aa=Q,ja=ee,Ce=N,Fe=Gt,xa=cr,La=lr,Cr="Object already initialized",Qe=Bt.TypeError,Ma=Bt.WeakMap,be,J,ye,Na=function(e){return ye(e)?J(e):be(e,{})},Ca=function(e){return function(r){var t;if(!Aa(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(_a||Fe.state){var A=Fe.state||(Fe.state=new Ma);A.get=A.get,A.has=A.has,A.set=A.set,be=function(e,r){if(A.has(e))throw Qe(Cr);return r.facade=e,A.set(e,r),r},J=function(e){return A.get(e)||{}},ye=function(e){return A.has(e)}}else{var U=xa("state");La[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Cr);return r.facade=e,ja(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Fa={set:be,get:J,has:ye,enforce:Na,getterFor:Ca},Da=me,qt=Function.prototype,Fr=qt.apply,Dr=qt.call,Ga=typeof Reflect=="object"&&Reflect.apply||(Da?Dr.bind(Fr):function(){return Dr.apply(Fr,arguments)}),ka=rr,Ua=D,Kt=function(e){if(ka(e)==="Function")return Ua(e)},Yt={},Wt={},Qt={}.propertyIsEnumerable,zt=Object.getOwnPropertyDescriptor,Va=zt&&!Qt.call({1:2},1);Wt.f=Va?function(r){var t=zt(this,r);return!!t&&t.enumerable}:Qt;var Ba=G,qa=k,Ka=Wt,Ya=Oe,Wa=Z,Qa=sr,za=N,Ha=At,Gr=Object.getOwnPropertyDescriptor;Yt.f=Ba?Gr:function(r,t){if(r=Wa(r),t=Qa(t),Ha)try{return Gr(r,t)}catch(n){}if(za(r,t))return Ya(!qa(Ka.f,r,t),r[t])};var Xa=L,Ja=_,Za=/#|\.prototype\./,re=function(e,r){var t=ri[ei(e)];return t==ni?!0:t==ti?!1:Ja(r)?Xa(r):!!r},ei=re.normalize=function(e){return String(e).replace(Za,".").toLowerCase()},ri=re.data={},ti=re.NATIVE="N",ni=re.POLYFILL="P",oi=re,kr=Kt,ai=ar,ii=me,si=kr(kr.bind),Ht=function(e,r){return ai(e),r===void 0?e:ii?si(e,r):function(){return e.apply(r,arguments)}},se=P,ci=Ga,li=Kt,ui=_,fi=Yt.f,vi=oi,V=nr,di=Ht,B=ee,Ur=N,hi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return ci(e,this,arguments)};return r.prototype=e.prototype,r},Xt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?se:o?se[t]:(se[t]||{}).prototype,s=n?V:V[t]||B(V,t,{})[t],u=s.prototype,c,l,f,v,d,b,y,O,g;for(v in r)c=vi(n?v:t+(o?".":"#")+v,e.forced),l=!c&&i&&Ur(i,v),b=s[v],l&&(e.dontCallGetSet?(g=fi(i,v),y=g&&g.value):y=i[v]),d=l&&y?y:r[v],!(l&&typeof b==typeof d)&&(e.bind&&l?O=di(d,se):e.wrap&&l?O=hi(d):a&&ui(d)?O=li(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&B(O,"sham",!0),B(s,v,O),a&&(f=t+"Prototype",Ur(V,f)||B(V,f,{}),B(V[f],v,d),e.real&&u&&(c||!u[v])&&B(u,v,d)))},ze=G,pi=N,Jt=Function.prototype,bi=ze&&Object.getOwnPropertyDescriptor,ur=pi(Jt,"name"),yi=ur&&function(){}.name==="something",gi=ur&&(!ze||ze&&bi(Jt,"name").configurable),mi={EXISTS:ur,PROPER:yi,CONFIGURABLE:gi},Zt={},Oi=Math.ceil,wi=Math.floor,$i=Math.trunc||function(r){var t=+r;return(t>0?wi:Oi)(t)},Ei=$i,en=function(e){var r=+e;return r!==r||r===0?0:Ei(r)},Si=en,Ti=Math.max,Ii=Math.min,Ri=function(e,r){var t=Si(e);return t<0?Ti(t+r,0):Ii(t,r)},Pi=en,_i=Math.min,Ai=function(e){return e>0?_i(Pi(e),9007199254740991):0},ji=Ai,rn=function(e){return ji(e.length)},xi=Z,Li=Ri,Mi=rn,Vr=function(e){return function(r,t,n){var o=xi(r),a=Mi(o),i=Li(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Ni={includes:Vr(!0),indexOf:Vr(!1)},Ci=D,De=N,Fi=Z,Di=Ni.indexOf,Gi=lr,Br=Ci([].push),ki=function(e,r){var t=Fi(e),n=0,o=[],a;for(a in t)!De(Gi,a)&&De(t,a)&&Br(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Di(o,a)||Br(o,a));return o},tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ui=ki,Vi=tn,Bi=Object.keys||function(r){return Ui(r,Vi)},qi=G,Ki=jt,Yi=z,Wi=H,Qi=Z,zi=Bi;Zt.f=qi&&!Ki?Object.defineProperties:function(r,t){Wi(r);for(var n=Qi(t),o=zi(t),a=o.length,i=0,s;a>i;)Yi.f(r,s=o[i++],n[s]);return r};var Hi=xt,Xi=Hi("document","documentElement"),Ji=H,Zi=Zt,qr=tn,es=lr,rs=Xi,ts=_t,ns=cr,Kr=">",Yr="<",He="prototype",Xe="script",nn=ns("IE_PROTO"),Ge=function(){},on=function(e){return Yr+Xe+Kr+e+Yr+"/"+Xe+Kr},Wr=function(e){e.write(on("")),e.close();var r=e.parentWindow.Object;return e=null,r},os=function(){var e=ts("iframe"),r="java"+Xe+":",t;return e.style.display="none",rs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(on("document.F=Object")),t.close(),t.F},ce,ve=function(){try{ce=new ActiveXObject("htmlfile")}catch(r){}ve=typeof document!="undefined"?document.domain&&ce?Wr(ce):os():Wr(ce);for(var e=qr.length;e--;)delete ve[He][qr[e]];return ve()};es[nn]=!0;var an=Object.create||function(r,t){var n;return r!==null?(Ge[He]=Ji(r),n=new Ge,Ge[He]=null,n[nn]=r):n=ve(),t===void 0?n:Zi.f(n,t)},as=L,is=!as(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ss=N,cs=_,ls=Ut,us=cr,fs=is,Qr=us("IE_PROTO"),Je=Object,vs=Je.prototype,sn=fs?Je.getPrototypeOf:function(e){var r=ls(e);if(ss(r,Qr))return r[Qr];var t=r.constructor;return cs(t)&&r instanceof t?t.prototype:r instanceof Je?vs:null},ds=ee,cn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:ds(e,r,t),e},hs=L,ps=_,bs=Q,ys=an,zr=sn,gs=cn,ms=M,Ze=ms("iterator"),ln=!1,x,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=zr(zr(Ue)),ke!==Object.prototype&&(x=ke)):ln=!0);var Os=!bs(x)||hs(function(){var e={};return x[Ze].call(e)!==e});Os?x={}:x=ys(x);ps(x[Ze])||gs(x,Ze,function(){return this});var un={IteratorPrototype:x,BUGGY_SAFARI_ITERATORS:ln},ws=M,$s=ws("toStringTag"),fn={};fn[$s]="z";var fr=String(fn)==="[object z]",Es=fr,Ss=_,de=rr,Ts=M,Is=Ts("toStringTag"),Rs=Object,Ps=de(function(){return arguments}())=="Arguments",_s=function(e,r){try{return e[r]}catch(t){}},vr=Es?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=_s(r=Rs(e),Is))=="string"?t:Ps?de(r):(n=de(r))=="Object"&&Ss(r.callee)?"Arguments":n},As=fr,js=vr,xs=As?{}.toString:function(){return"[object "+js(this)+"]"},Ls=fr,Ms=z.f,Ns=ee,Cs=N,Fs=xs,Ds=M,Hr=Ds("toStringTag"),vn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Cs(o,Hr)||Ms(o,Hr,{configurable:!0,value:r}),n&&!Ls&&Ns(o,"toString",Fs)}},Gs=un.IteratorPrototype,ks=an,Us=Oe,Vs=vn,Bs=W,qs=function(){return this},Ks=function(e,r,t,n){var o=r+" Iterator";return e.prototype=ks(Gs,{next:Us(+!n,t)}),Vs(e,o,!1,!0),Bs[o]=qs,e},Ys=Xt,Ws=k,dn=mi,Qs=Ks,zs=sn,Hs=vn,Xr=cn,Xs=M,Jr=W,hn=un,Js=dn.PROPER;dn.CONFIGURABLE;hn.IteratorPrototype;var le=hn.BUGGY_SAFARI_ITERATORS,Ve=Xs("iterator"),Zr="keys",ue="values",et="entries",Zs=function(){return this},ec=function(e,r,t,n,o,a,i){Qs(t,r,n);var s=function(g){if(g===o&&v)return v;if(!le&&g in l)return l[g];switch(g){case Zr:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case et:return function(){return new t(this,g)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[Ve]||l["@@iterator"]||o&&l[o],v=!le&&f||s(o),d=r=="Array"&&l.entries||f,b,y,O;if(d&&(b=zs(d.call(new e)),b!==Object.prototype&&b.next&&(Hs(b,u,!0,!0),Jr[u]=Zs)),Js&&o==ue&&f&&f.name!==ue&&(c=!0,v=function(){return Ws(f,this)}),o)if(y={values:s(ue),keys:a?v:s(Zr),entries:s(et)},i)for(O in y)(le||c||!(O in l))&&Xr(l,O,y[O]);else Ys({target:r,proto:!0,forced:le||c},y);return i&&l[Ve]!==v&&Xr(l,Ve,v,{name:o}),Jr[r]=v,y},rc=function(e,r){return{value:e,done:r}},tc=Z,rt=W,pn=Fa;z.f;var nc=ec,fe=rc,bn="Array Iterator",oc=pn.set,ac=pn.getterFor(bn);nc(Array,"Array",function(e,r){oc(this,{type:bn,target:tc(e),index:0,kind:r})},function(){var e=ac(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,fe(void 0,!0)):t=="keys"?fe(n,!1):t=="values"?fe(r[n],!1):fe([n,r[n]],!1)},"values");rt.Arguments=rt.Array;var ic=M,sc=W,cc=ic("iterator"),lc=Array.prototype,uc=function(e){return e!==void 0&&(sc.Array===e||lc[cc]===e)},fc=vr,tt=ir,vc=tr,dc=W,hc=M,pc=hc("iterator"),yn=function(e){if(!vc(e))return tt(e,pc)||tt(e,"@@iterator")||dc[fc(e)]},bc=k,yc=ar,gc=H,mc=or,Oc=yn,wc=TypeError,$c=function(e,r){var t=arguments.length<2?Oc(e):r;if(yc(t))return gc(bc(t,e));throw wc(mc(e)+" is not iterable")},Ec=k,nt=H,Sc=ir,Tc=function(e,r,t){var n,o;nt(e);try{if(n=Sc(e,"return"),!n){if(r==="throw")throw t;return t}n=Ec(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return nt(n),t},Ic=Ht,Rc=k,Pc=H,_c=or,Ac=uc,jc=rn,ot=Lt,xc=$c,Lc=yn,at=Tc,Mc=TypeError,he=function(e,r){this.stopped=e,this.result=r},it=he.prototype,Nc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=Ic(r,n),c,l,f,v,d,b,y,O=function(m){return c&&at(c,"normal",m),new he(!0,m)},g=function(m){return o?(Pc(m),s?u(m[0],m[1],O):u(m[0],m[1])):s?u(m,O):u(m)};if(a)c=e.iterator;else if(i)c=e;else{if(l=Lc(e),!l)throw Mc(_c(e)+" is not iterable");if(Ac(l)){for(f=0,v=jc(e);v>f;f++)if(d=g(e[f]),d&&ot(it,d))return d;return new he(!1)}c=xc(e,l)}for(b=a?e.next:c.next;!(y=Rc(b,c)).done;){try{d=g(y.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&ot(it,d))return d}return new he(!1)},Cc=sr,Fc=z,Dc=Oe,Gc=function(e,r,t){var n=Cc(r);n in e?Fc.f(e,n,Dc(0,t)):e[n]=t},kc=Xt,Uc=Nc,Vc=Gc;kc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Uc(r,function(n,o){Vc(t,n,o)},{AS_ENTRIES:!0}),t}});var Bc=nr,qc=Bc.Object.fromEntries,Kc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Yc=Kc,Wc=P,Qc=vr,zc=ee,st=W,Hc=M,ct=Hc("toStringTag");for(var Be in Yc){var lt=Wc[Be],qe=lt&<.prototype;qe&&Qc(qe)!==ct&&zc(qe,ct,Be),st[Be]=st.Array}var Xc=qc,Jc=Xc,Zc=Jc,el=Zc,rl=qn(el),ut;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(ut||(ut={}));const tl="vk.com",Hl=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${tl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield Bn(n.toString())).json();return nl(a,t)}),nl=(e,r)=>rl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),ol(n)])),ol=e=>Array.isArray(e)?e[0]:e;var ft;(function(e){e.RU="ru",e.EN="en"})(ft||(ft={}));export{j as CurrentClientBrowser,w as CurrentClientDevice,yr as ErrorCategory,ft as InterfaceLanguage,sl as Logger,E as Observable,vt as Subject,ge as Subscription,al as VERSION,ut as VKNumericLanguage,Ll as ValueSubject,S as VideoQuality,hl as abortable,vl as addScript,Pl as areQualitiesExact,fl as assertEmptyArray,K as assertNever,cl as assertNonNullable,ul as assertNotEmptyArray,ll as assertNullable,_l as assertQualityIsExact,kl as buffer,il as checkNever,xl as cloneDeep,gt as cloneDeepWith,Ml as combine,Ul as debounce,jl as debounceFn,Ol as detectEmbed,_n as fillWithDefault,Bl as filter,ql as filterChanged,Gl as fromEvent,ht as getCurrentBrowser,gl as getExponentialDelay,Sl as getHighestQuality,bl as getIOSVersion,Fl as interval,wl as isHigher,$l as isHigherOrEqual,pl as isIOS,yt as isInvariantQuality,pt as isLower,El as isLowerOrEqual,yl as isMacLike,wn as isNonNullable,$n as isNullable,Hl as loadVKLangPack,Fn as map,Yl as mapTo,Nl as merge,X as noop,dl as now,Dl as observableFrom,Wl as once,Ql as pairwise,ml as safeStorage,zl as tap,Vl as throttle,Al as timeCodeToString,Cl as timeout,Tl as videoHeightToQuality,Rl as videoQualityToHeight,Il as videoSizeToQuality};
|
|
6
|
+
const al="1.0.32";class ge{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const K=e=>{throw new Error(`${e} is value of unexpected type`)},il=e=>{},X=()=>{};class E{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:X}:o={next:s=>t.next(s),error:s=>{var u;return(u=t.error)===null||u===void 0?void 0:u.call(t,s)}}:o={next:X,error:X};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(u){o.next(u)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new ge().add(()=>{switch(a.next=X,a.error=X,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return K(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class vt extends E{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new ge().add(()=>this.subscribers.delete(t))}}class sl{constructor(){this.log$=new vt,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function cl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function ll(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function wn(e){return typeof e!="undefined"&&e!==null}function $n(e){return e==null}function ul(e,r){if(!(e!=null&&e.length))throw new Error(r)}function fl(e,r){if(e!=null&&e.length)throw new Error(r)}const vl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",i),c.removeEventListener("error",a)};let u;t&&(u=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var we;const dl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(l){try{c(n.next(l))}catch(f){i(f)}}function u(l){try{c(n.throw(l))}catch(f){i(f)}}function c(l){l.done?a(l.value):o(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const hl=(e,r)=>(...t)=>dt(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){yield o.throw(s)}return i});var j;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(j||(j={}));var w;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(w||(w={}));const ht=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?j.Yandex:void 0,t=/chrome|crios/i.test(e)?j.Chrome:void 0,n=/chromium/i.test(e)?j.Chromium:void 0,o=/firefox|fxios/i.test(e)?j.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?j.Safari:void 0,i=/opr\//i.test(e)?j.Opera:void 0,s=/edg/i.test(e)?j.Edge:void 0,u=/android/i.test(e)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,l=/ipad/i.test(e)?w.iPad:void 0,f=/ipod/i.test(e)?w.iPod:void 0,v=/mac/i.test(e)?w.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:u||c||l||f||d||v||w.Desktop}},pl=(e=!1)=>{const t=[w.iPhone,w.iPad,w.iPod].includes(ht().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},bl=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},yl=()=>[w.Mac,w.iPhone,w.iPad,w.iPod].includes(ht().device),gl=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let $,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&($=new Map),F},En=()=>Y()===p.LOCAL_STORAGE,Sn=e=>{var r,t;const n=Y();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return $==null?void 0:$.get(e);default:K(n)}},Tn=(e,r)=>{const t=Y();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void($==null?void 0:$.set(e,r));default:K(t)}},In=e=>{var r;const t=Y();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=$==null?void 0:$.has(e))!==null&&r!==void 0?r:!1;default:return K(t),!1}},Rn=e=>{const r=Y();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void($==null?void 0:$.delete(e));default:K(r)}},Pn=()=>{const e=Y();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return $==null?void 0:$.clear();default:K(e)}};var ml=Object.freeze({__proto__:null,clear:Pn,get:Sn,has:In,isPersistent:En,remove:Rn,set:Tn});const Ol=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var S;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(S||(S={}));const T={[S.Q_144P]:{width:256,height:144},[S.Q_240P]:{width:428,height:240},[S.Q_360P]:{width:640,height:360},[S.Q_480P]:{width:856,height:480},[S.Q_720P]:{width:1280,height:720},[S.Q_1080P]:{width:1920,height:1080},[S.Q_1440P]:{width:2560,height:1440},[S.Q_2160P]:{width:3840,height:2160},[S.Q_4320P]:{width:7680,height:4320}},wl=(e,r)=>T[e].height>T[r].height,$l=(e,r)=>T[e].height>=T[r].height,pt=(e,r)=>T[e].height<T[r].height,El=(e,r)=>T[e].height<=T[r].height,Sl=e=>e.sort((r,t)=>r===t?0:r===S.INVARIANT?1:t===S.INVARIANT?-1:pt(r,t)?1:-1)[0],bt=Object.keys(T).sort((e,r)=>pt(e,r)?-1:1),Tl=(e,r=.02)=>[...bt].find(n=>T[n].height*(1+r)>=e),Il=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return bt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Rl=e=>T[e].height,yt=e=>e===S.INVARIANT,Pl=e=>e.every(r=>!yt(r));function _l(e){if(yt(e))throw new Error("Expected exact quality")}const _n=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=_n(a,o):t[n]=n in e?a:o}return t},Al=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function jl(e,r=0,t){let n,o,a,i,s,u,c=0,l=!1,f=!1,v=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(l=!!t.leading,f="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,v="trailing"in t?!!t.trailing:v);function b(h){const I=n,C=o;return n=o=void 0,c=h,i=e.apply(C,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=y(te,r),l?b(h):i}function m(h){const I=h-u,C=h-c,pr=r-I;return f?Math.min(pr,a-C):pr}function dr(h){const I=h-u,C=h-c;return u===void 0||I>=r||I<0||f&&C>=a}function te(){const h=Date.now();if(dr(h))return hr(h);s=y(te,m(h))}function hr(h){return s=void 0,v&&n?b(h):(n=o=void 0,i)}function gn(){s!==void 0&&O(s),c=0,n=u=o=s=void 0}function mn(){return s===void 0?i:hr(Date.now())}function On(){return s!==void 0}function ne(...h){const I=Date.now(),C=dr(I);if(n=h,o=this,u=I,C){if(s===void 0)return g(u);if(f)return s=y(te,r),b(u)}return s===void 0&&(s=y(te,r)),i}return ne.cancel=gn,ne.flush=mn,ne.pending=On,ne}const gt=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=gt(e[n],r):t[n]=e[n]}return t},xl=e=>gt(e);class Ll extends vt{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Ml(e){return new E(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new ge)})}function Nl(...e){return new E(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Cl=e=>new E(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Fl=e=>new E(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Dl=e=>new E(r=>{e.forEach(t=>r.next(t))}),Gl=(e,r)=>new E(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function kl(e){return r=>new E(t=>r.subscribe(new An(t,e)))}class An{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const jn={leading:!1,trailing:!0};function Ul(e,r=jn){return t=>new E(n=>t.subscribe(new xn(n,e,r)))}class xn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,wn(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Ln={leading:!0,trailing:!1};function Vl(e,r=Ln){return t=>new E(n=>t.subscribe(new Mn(n,e,r)))}class Mn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,$n(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Bl(e){return r=>new E(t=>r.subscribe(new Nn(t,e)))}class Nn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ql(e=(r,t)=>r===t){return r=>new E(t=>r.subscribe(new Cn(t,e)))}const br={};class Cn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=br}next(r){let t;try{t=this.lastValue===br||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Fn(e){return r=>new E(t=>r.subscribe(new Dn(t,e)))}let Dn=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Yl(e){return Fn(()=>e)}function Wl(){return e=>new E(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Ql(){return e=>new E(r=>e.subscribe(new Gn(r)))}class Gn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function zl(e){return r=>new E(t=>r.subscribe(new kn(t,e)))}class kn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var yr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(yr||(yr={}));class gr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class mt extends gr{constructor(){super(),this.listeners||gr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class Un{constructor(){Object.defineProperty(this,"signal",{value:new mt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Un.prototype[Symbol.toStringTag]="AbortController",mt.prototype[Symbol.toStringTag]="AbortSignal");function Ot(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Vn(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!Ot({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const v=new t(c,l);return f&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),v},a.prototype=t.prototype);const i=r;return{fetch:(u,c)=>{const l=a&&a.prototype.isPrototypeOf(u)?u.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const v=new Promise((d,b)=>{l.addEventListener("abort",()=>b(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,i(u,c)])}return i(u,c)},Request:a}}const er=Ot({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),wt=er?Vn({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Bn=er?wt.fetch:window.fetch;er?wt.Request:window.Request;var Ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L=function(e){try{return!!e()}catch(r){return!0}},Kn=L,me=!Kn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),$t=me,Et=Function.prototype,Ke=Et.call,Yn=$t&&Et.bind.bind(Ke,Ke),D=$t?Yn:function(e){return function(){return Ke.apply(e,arguments)}},St=D,Wn=St({}.toString),Qn=St("".slice),rr=function(e){return Qn(Wn(e),8,-1)},zn=D,Hn=L,Xn=rr,Se=Object,Jn=zn("".split),Zn=Hn(function(){return!Se("z").propertyIsEnumerable(0)})?function(e){return Xn(e)=="String"?Jn(e,""):Se(e)}:Se,tr=function(e){return e==null},eo=tr,ro=TypeError,Tt=function(e){if(eo(e))throw ro("Can't call method on "+e);return e},to=Zn,no=Tt,Z=function(e){return to(no(e))},W={},oe=function(e){return e&&e.Math==Math&&e},P=oe(typeof globalThis=="object"&&globalThis)||oe(typeof window=="object"&&window)||oe(typeof self=="object"&&self)||oe(typeof Ee=="object"&&Ee)||function(){return this}()||Ee||Function("return this")(),Ye=typeof document=="object"&&document.all,oo=typeof Ye=="undefined"&&Ye!==void 0,It={all:Ye,IS_HTMLDDA:oo},Rt=It,ao=Rt.all,_=Rt.IS_HTMLDDA?function(e){return typeof e=="function"||e===ao}:function(e){return typeof e=="function"},io=P,so=_,mr=io.WeakMap,co=so(mr)&&/native code/.test(String(mr)),Or=_,Pt=It,lo=Pt.all,Q=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===lo}:function(e){return typeof e=="object"?e!==null:Or(e)},uo=L,G=!uo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},fo=P,wr=Q,We=fo.document,vo=wr(We)&&wr(We.createElement),_t=function(e){return vo?We.createElement(e):{}},ho=G,po=L,bo=_t,At=!ho&&!po(function(){return Object.defineProperty(bo("div"),"a",{get:function(){return 7}}).a!=7}),yo=G,go=L,jt=yo&&go(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),mo=Q,Oo=String,wo=TypeError,H=function(e){if(mo(e))return e;throw wo(Oo(e)+" is not an object")},$o=me,ae=Function.prototype.call,k=$o?ae.bind(ae):function(){return ae.apply(ae,arguments)},nr={},Te=nr,Ie=P,Eo=_,$r=function(e){return Eo(e)?e:void 0},xt=function(e,r){return arguments.length<2?$r(Te[e])||$r(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},So=D,Lt=So({}.isPrototypeOf),To=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Mt=P,Re=To,Er=Mt.process,Sr=Mt.Deno,Tr=Er&&Er.versions||Sr&&Sr.version,Ir=Tr&&Tr.v8,R,pe;Ir&&(R=Ir.split("."),pe=R[0]>0&&R[0]<4?1:+(R[0]+R[1]));!pe&&Re&&(R=Re.match(/Edge\/(\d+)/),(!R||R[1]>=74)&&(R=Re.match(/Chrome\/(\d+)/),R&&(pe=+R[1])));var Io=pe,Rr=Io,Ro=L,Po=P,_o=Po.String,Nt=!!Object.getOwnPropertySymbols&&!Ro(function(){var e=Symbol();return!_o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rr&&Rr<41}),Ao=Nt,Ct=Ao&&!Symbol.sham&&typeof Symbol.iterator=="symbol",jo=xt,xo=_,Lo=Lt,Mo=Ct,No=Object,Ft=Mo?function(e){return typeof e=="symbol"}:function(e){var r=jo("Symbol");return xo(r)&&Lo(r.prototype,No(e))},Co=String,or=function(e){try{return Co(e)}catch(r){return"Object"}},Fo=_,Do=or,Go=TypeError,ar=function(e){if(Fo(e))return e;throw Go(Do(e)+" is not a function")},ko=ar,Uo=tr,ir=function(e,r){var t=e[r];return Uo(t)?void 0:ko(t)},Pe=k,_e=_,Ae=Q,Vo=TypeError,Bo=function(e,r){var t,n;if(r==="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e))||_e(t=e.valueOf)&&!Ae(n=Pe(t,e))||r!=="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e)))return n;throw Vo("Can't convert object to primitive value")},Dt={exports:{}},Pr=P,qo=Object.defineProperty,Ko=function(e,r){try{qo(Pr,e,{value:r,configurable:!0,writable:!0})}catch(t){Pr[e]=r}return r},Yo=P,Wo=Ko,_r="__core-js_shared__",Qo=Yo[_r]||Wo(_r,{}),Gt=Qo,Ar=Gt;(Dt.exports=function(e,r){return Ar[e]||(Ar[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var kt=Dt.exports,zo=Tt,Ho=Object,Ut=function(e){return Ho(zo(e))},Xo=D,Jo=Ut,Zo=Xo({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return Zo(Jo(r),t)},ea=D,ra=0,ta=Math.random(),na=ea(1 .toString),Vt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+na(++ra+ta,36)},oa=P,aa=kt,jr=N,ia=Vt,sa=Nt,ca=Ct,q=oa.Symbol,je=aa("wks"),la=ca?q.for||q:q&&q.withoutSetter||ia,M=function(e){return jr(je,e)||(je[e]=sa&&jr(q,e)?q[e]:la("Symbol."+e)),je[e]},ua=k,xr=Q,Lr=Ft,fa=ir,va=Bo,da=M,ha=TypeError,pa=da("toPrimitive"),ba=function(e,r){if(!xr(e)||Lr(e))return e;var t=fa(e,pa),n;if(t){if(r===void 0&&(r="default"),n=ua(t,e,r),!xr(n)||Lr(n))return n;throw ha("Can't convert object to primitive value")}return r===void 0&&(r="number"),va(e,r)},ya=ba,ga=Ft,sr=function(e){var r=ya(e,"string");return ga(r)?r:r+""},ma=G,Oa=At,wa=jt,ie=H,Mr=sr,$a=TypeError,xe=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",Ne="writable";z.f=ma?wa?function(r,t,n){if(ie(r),t=Mr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=Ea(r,t);o&&o[Ne]&&(r[t]=n.value,n={configurable:Me in n?n[Me]:o[Me],enumerable:Le in n?n[Le]:o[Le],writable:!1})}return xe(r,t,n)}:xe:function(r,t,n){if(ie(r),t=Mr(t),ie(n),Oa)try{return xe(r,t,n)}catch(o){}if("get"in n||"set"in n)throw $a("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var Oe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Sa=G,Ta=z,Ia=Oe,ee=Sa?function(e,r,t){return Ta.f(e,r,Ia(1,t))}:function(e,r,t){return e[r]=t,e},Ra=kt,Pa=Vt,Nr=Ra("keys"),cr=function(e){return Nr[e]||(Nr[e]=Pa(e))},lr={},_a=co,Bt=P,Aa=Q,ja=ee,Ce=N,Fe=Gt,xa=cr,La=lr,Cr="Object already initialized",Qe=Bt.TypeError,Ma=Bt.WeakMap,be,J,ye,Na=function(e){return ye(e)?J(e):be(e,{})},Ca=function(e){return function(r){var t;if(!Aa(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(_a||Fe.state){var A=Fe.state||(Fe.state=new Ma);A.get=A.get,A.has=A.has,A.set=A.set,be=function(e,r){if(A.has(e))throw Qe(Cr);return r.facade=e,A.set(e,r),r},J=function(e){return A.get(e)||{}},ye=function(e){return A.has(e)}}else{var U=xa("state");La[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Cr);return r.facade=e,ja(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Fa={set:be,get:J,has:ye,enforce:Na,getterFor:Ca},Da=me,qt=Function.prototype,Fr=qt.apply,Dr=qt.call,Ga=typeof Reflect=="object"&&Reflect.apply||(Da?Dr.bind(Fr):function(){return Dr.apply(Fr,arguments)}),ka=rr,Ua=D,Kt=function(e){if(ka(e)==="Function")return Ua(e)},Yt={},Wt={},Qt={}.propertyIsEnumerable,zt=Object.getOwnPropertyDescriptor,Va=zt&&!Qt.call({1:2},1);Wt.f=Va?function(r){var t=zt(this,r);return!!t&&t.enumerable}:Qt;var Ba=G,qa=k,Ka=Wt,Ya=Oe,Wa=Z,Qa=sr,za=N,Ha=At,Gr=Object.getOwnPropertyDescriptor;Yt.f=Ba?Gr:function(r,t){if(r=Wa(r),t=Qa(t),Ha)try{return Gr(r,t)}catch(n){}if(za(r,t))return Ya(!qa(Ka.f,r,t),r[t])};var Xa=L,Ja=_,Za=/#|\.prototype\./,re=function(e,r){var t=ri[ei(e)];return t==ni?!0:t==ti?!1:Ja(r)?Xa(r):!!r},ei=re.normalize=function(e){return String(e).replace(Za,".").toLowerCase()},ri=re.data={},ti=re.NATIVE="N",ni=re.POLYFILL="P",oi=re,kr=Kt,ai=ar,ii=me,si=kr(kr.bind),Ht=function(e,r){return ai(e),r===void 0?e:ii?si(e,r):function(){return e.apply(r,arguments)}},se=P,ci=Ga,li=Kt,ui=_,fi=Yt.f,vi=oi,V=nr,di=Ht,B=ee,Ur=N,hi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return ci(e,this,arguments)};return r.prototype=e.prototype,r},Xt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?se:o?se[t]:(se[t]||{}).prototype,s=n?V:V[t]||B(V,t,{})[t],u=s.prototype,c,l,f,v,d,b,y,O,g;for(v in r)c=vi(n?v:t+(o?".":"#")+v,e.forced),l=!c&&i&&Ur(i,v),b=s[v],l&&(e.dontCallGetSet?(g=fi(i,v),y=g&&g.value):y=i[v]),d=l&&y?y:r[v],!(l&&typeof b==typeof d)&&(e.bind&&l?O=di(d,se):e.wrap&&l?O=hi(d):a&&ui(d)?O=li(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&B(O,"sham",!0),B(s,v,O),a&&(f=t+"Prototype",Ur(V,f)||B(V,f,{}),B(V[f],v,d),e.real&&u&&(c||!u[v])&&B(u,v,d)))},ze=G,pi=N,Jt=Function.prototype,bi=ze&&Object.getOwnPropertyDescriptor,ur=pi(Jt,"name"),yi=ur&&function(){}.name==="something",gi=ur&&(!ze||ze&&bi(Jt,"name").configurable),mi={EXISTS:ur,PROPER:yi,CONFIGURABLE:gi},Zt={},Oi=Math.ceil,wi=Math.floor,$i=Math.trunc||function(r){var t=+r;return(t>0?wi:Oi)(t)},Ei=$i,en=function(e){var r=+e;return r!==r||r===0?0:Ei(r)},Si=en,Ti=Math.max,Ii=Math.min,Ri=function(e,r){var t=Si(e);return t<0?Ti(t+r,0):Ii(t,r)},Pi=en,_i=Math.min,Ai=function(e){return e>0?_i(Pi(e),9007199254740991):0},ji=Ai,rn=function(e){return ji(e.length)},xi=Z,Li=Ri,Mi=rn,Vr=function(e){return function(r,t,n){var o=xi(r),a=Mi(o),i=Li(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Ni={includes:Vr(!0),indexOf:Vr(!1)},Ci=D,De=N,Fi=Z,Di=Ni.indexOf,Gi=lr,Br=Ci([].push),ki=function(e,r){var t=Fi(e),n=0,o=[],a;for(a in t)!De(Gi,a)&&De(t,a)&&Br(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Di(o,a)||Br(o,a));return o},tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ui=ki,Vi=tn,Bi=Object.keys||function(r){return Ui(r,Vi)},qi=G,Ki=jt,Yi=z,Wi=H,Qi=Z,zi=Bi;Zt.f=qi&&!Ki?Object.defineProperties:function(r,t){Wi(r);for(var n=Qi(t),o=zi(t),a=o.length,i=0,s;a>i;)Yi.f(r,s=o[i++],n[s]);return r};var Hi=xt,Xi=Hi("document","documentElement"),Ji=H,Zi=Zt,qr=tn,es=lr,rs=Xi,ts=_t,ns=cr,Kr=">",Yr="<",He="prototype",Xe="script",nn=ns("IE_PROTO"),Ge=function(){},on=function(e){return Yr+Xe+Kr+e+Yr+"/"+Xe+Kr},Wr=function(e){e.write(on("")),e.close();var r=e.parentWindow.Object;return e=null,r},os=function(){var e=ts("iframe"),r="java"+Xe+":",t;return e.style.display="none",rs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(on("document.F=Object")),t.close(),t.F},ce,ve=function(){try{ce=new ActiveXObject("htmlfile")}catch(r){}ve=typeof document!="undefined"?document.domain&&ce?Wr(ce):os():Wr(ce);for(var e=qr.length;e--;)delete ve[He][qr[e]];return ve()};es[nn]=!0;var an=Object.create||function(r,t){var n;return r!==null?(Ge[He]=Ji(r),n=new Ge,Ge[He]=null,n[nn]=r):n=ve(),t===void 0?n:Zi.f(n,t)},as=L,is=!as(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ss=N,cs=_,ls=Ut,us=cr,fs=is,Qr=us("IE_PROTO"),Je=Object,vs=Je.prototype,sn=fs?Je.getPrototypeOf:function(e){var r=ls(e);if(ss(r,Qr))return r[Qr];var t=r.constructor;return cs(t)&&r instanceof t?t.prototype:r instanceof Je?vs:null},ds=ee,cn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:ds(e,r,t),e},hs=L,ps=_,bs=Q,ys=an,zr=sn,gs=cn,ms=M,Ze=ms("iterator"),ln=!1,x,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=zr(zr(Ue)),ke!==Object.prototype&&(x=ke)):ln=!0);var Os=!bs(x)||hs(function(){var e={};return x[Ze].call(e)!==e});Os?x={}:x=ys(x);ps(x[Ze])||gs(x,Ze,function(){return this});var un={IteratorPrototype:x,BUGGY_SAFARI_ITERATORS:ln},ws=M,$s=ws("toStringTag"),fn={};fn[$s]="z";var fr=String(fn)==="[object z]",Es=fr,Ss=_,de=rr,Ts=M,Is=Ts("toStringTag"),Rs=Object,Ps=de(function(){return arguments}())=="Arguments",_s=function(e,r){try{return e[r]}catch(t){}},vr=Es?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=_s(r=Rs(e),Is))=="string"?t:Ps?de(r):(n=de(r))=="Object"&&Ss(r.callee)?"Arguments":n},As=fr,js=vr,xs=As?{}.toString:function(){return"[object "+js(this)+"]"},Ls=fr,Ms=z.f,Ns=ee,Cs=N,Fs=xs,Ds=M,Hr=Ds("toStringTag"),vn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Cs(o,Hr)||Ms(o,Hr,{configurable:!0,value:r}),n&&!Ls&&Ns(o,"toString",Fs)}},Gs=un.IteratorPrototype,ks=an,Us=Oe,Vs=vn,Bs=W,qs=function(){return this},Ks=function(e,r,t,n){var o=r+" Iterator";return e.prototype=ks(Gs,{next:Us(+!n,t)}),Vs(e,o,!1,!0),Bs[o]=qs,e},Ys=Xt,Ws=k,dn=mi,Qs=Ks,zs=sn,Hs=vn,Xr=cn,Xs=M,Jr=W,hn=un,Js=dn.PROPER;dn.CONFIGURABLE;hn.IteratorPrototype;var le=hn.BUGGY_SAFARI_ITERATORS,Ve=Xs("iterator"),Zr="keys",ue="values",et="entries",Zs=function(){return this},ec=function(e,r,t,n,o,a,i){Qs(t,r,n);var s=function(g){if(g===o&&v)return v;if(!le&&g in l)return l[g];switch(g){case Zr:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case et:return function(){return new t(this,g)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[Ve]||l["@@iterator"]||o&&l[o],v=!le&&f||s(o),d=r=="Array"&&l.entries||f,b,y,O;if(d&&(b=zs(d.call(new e)),b!==Object.prototype&&b.next&&(Hs(b,u,!0,!0),Jr[u]=Zs)),Js&&o==ue&&f&&f.name!==ue&&(c=!0,v=function(){return Ws(f,this)}),o)if(y={values:s(ue),keys:a?v:s(Zr),entries:s(et)},i)for(O in y)(le||c||!(O in l))&&Xr(l,O,y[O]);else Ys({target:r,proto:!0,forced:le||c},y);return i&&l[Ve]!==v&&Xr(l,Ve,v,{name:o}),Jr[r]=v,y},rc=function(e,r){return{value:e,done:r}},tc=Z,rt=W,pn=Fa;z.f;var nc=ec,fe=rc,bn="Array Iterator",oc=pn.set,ac=pn.getterFor(bn);nc(Array,"Array",function(e,r){oc(this,{type:bn,target:tc(e),index:0,kind:r})},function(){var e=ac(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,fe(void 0,!0)):t=="keys"?fe(n,!1):t=="values"?fe(r[n],!1):fe([n,r[n]],!1)},"values");rt.Arguments=rt.Array;var ic=M,sc=W,cc=ic("iterator"),lc=Array.prototype,uc=function(e){return e!==void 0&&(sc.Array===e||lc[cc]===e)},fc=vr,tt=ir,vc=tr,dc=W,hc=M,pc=hc("iterator"),yn=function(e){if(!vc(e))return tt(e,pc)||tt(e,"@@iterator")||dc[fc(e)]},bc=k,yc=ar,gc=H,mc=or,Oc=yn,wc=TypeError,$c=function(e,r){var t=arguments.length<2?Oc(e):r;if(yc(t))return gc(bc(t,e));throw wc(mc(e)+" is not iterable")},Ec=k,nt=H,Sc=ir,Tc=function(e,r,t){var n,o;nt(e);try{if(n=Sc(e,"return"),!n){if(r==="throw")throw t;return t}n=Ec(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return nt(n),t},Ic=Ht,Rc=k,Pc=H,_c=or,Ac=uc,jc=rn,ot=Lt,xc=$c,Lc=yn,at=Tc,Mc=TypeError,he=function(e,r){this.stopped=e,this.result=r},it=he.prototype,Nc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=Ic(r,n),c,l,f,v,d,b,y,O=function(m){return c&&at(c,"normal",m),new he(!0,m)},g=function(m){return o?(Pc(m),s?u(m[0],m[1],O):u(m[0],m[1])):s?u(m,O):u(m)};if(a)c=e.iterator;else if(i)c=e;else{if(l=Lc(e),!l)throw Mc(_c(e)+" is not iterable");if(Ac(l)){for(f=0,v=jc(e);v>f;f++)if(d=g(e[f]),d&&ot(it,d))return d;return new he(!1)}c=xc(e,l)}for(b=a?e.next:c.next;!(y=Rc(b,c)).done;){try{d=g(y.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&ot(it,d))return d}return new he(!1)},Cc=sr,Fc=z,Dc=Oe,Gc=function(e,r,t){var n=Cc(r);n in e?Fc.f(e,n,Dc(0,t)):e[n]=t},kc=Xt,Uc=Nc,Vc=Gc;kc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Uc(r,function(n,o){Vc(t,n,o)},{AS_ENTRIES:!0}),t}});var Bc=nr,qc=Bc.Object.fromEntries,Kc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Yc=Kc,Wc=P,Qc=vr,zc=ee,st=W,Hc=M,ct=Hc("toStringTag");for(var Be in Yc){var lt=Wc[Be],qe=lt&<.prototype;qe&&Qc(qe)!==ct&&zc(qe,ct,Be),st[Be]=st.Array}var Xc=qc,Jc=Xc,Zc=Jc,el=Zc,rl=qn(el),ut;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(ut||(ut={}));const tl="vk.com",Hl=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${tl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield Bn(n.toString())).json();return nl(a,t)}),nl=(e,r)=>rl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),ol(n)])),ol=e=>Array.isArray(e)?e[0]:e;var ft;(function(e){e.RU="ru",e.EN="en"})(ft||(ft={}));export{j as CurrentClientBrowser,w as CurrentClientDevice,yr as ErrorCategory,ft as InterfaceLanguage,sl as Logger,E as Observable,vt as Subject,ge as Subscription,al as VERSION,ut as VKNumericLanguage,Ll as ValueSubject,S as VideoQuality,hl as abortable,vl as addScript,Pl as areQualitiesExact,fl as assertEmptyArray,K as assertNever,cl as assertNonNullable,ul as assertNotEmptyArray,ll as assertNullable,_l as assertQualityIsExact,kl as buffer,il as checkNever,xl as cloneDeep,gt as cloneDeepWith,Ml as combine,Ul as debounce,jl as debounceFn,Ol as detectEmbed,_n as fillWithDefault,Bl as filter,ql as filterChanged,Gl as fromEvent,ht as getCurrentBrowser,gl as getExponentialDelay,Sl as getHighestQuality,bl as getIOSVersion,Fl as interval,wl as isHigher,$l as isHigherOrEqual,pl as isIOS,yt as isInvariantQuality,pt as isLower,El as isLowerOrEqual,yl as isMacLike,wn as isNonNullable,$n as isNullable,Hl as loadVKLangPack,Fn as map,Yl as mapTo,Nl as merge,X as noop,dl as now,Dl as observableFrom,Wl as once,Ql as pairwise,ml as safeStorage,zl as tap,Vl as throttle,Al as timeCodeToString,Cl as timeout,Tl as videoHeightToQuality,Rl as videoQualityToHeight,Il as videoSizeToQuality};
|
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const gn="1.0.32-dev.935ac7b0.0";class z{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const N=e=>{throw new Error(`${e} is value of unexpected type`)},mn=e=>{},B=()=>{};class w{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}:o={next:s=>t.next(s),error:s=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,s)}}:o={next:B,error:B};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(l){o.next(l)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new z().add(()=>{switch(a.next=B,a.error=B,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return N(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Xe extends w{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new z().add(()=>this.subscribers.delete(t))}}class wn{constructor(){this.log$=new Xe,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function On(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function En(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ft(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function $n(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Sn(e,r){if(e!=null&&e.length)throw new Error(r)}const Tn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{l&&clearTimeout(l),c.removeEventListener("load",i),c.removeEventListener("error",a)};let l;t&&(l=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var ge;const In=typeof((ge=window.performance)===null||ge===void 0?void 0:ge.now)=="function"?()=>window.performance.now():()=>Date.now(),Rn=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){await o.throw(s)}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Je=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,l=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,u=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,v=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:l||c||u||v||d||f||exports.CurrentClientDevice.Desktop}},Pn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},_n=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},An=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device),Cn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let E,x;const me=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(me,"test"),localStorage.removeItem(me),x=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(me),x=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=p.RUNTIME;else throw r}else throw e}return x===p.RUNTIME&&(E=new Map),x},Ln=()=>Q()===p.LOCAL_STORAGE,jn=e=>{var r,t;const n=Q();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return E==null?void 0:E.get(e);default:N(n)}},xn=(e,r)=>{const t=Q();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void(E==null?void 0:E.set(e,r));default:N(t)}},Nn=e=>{var r;const t=Q();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return N(t),!1}},Mn=e=>{const r=Q();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(E==null?void 0:E.delete(e));default:N(r)}},Dn=()=>{const e=Q();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return E==null?void 0:E.clear();default:N(e)}};var Fn=Object.freeze({__proto__:null,clear:Dn,get:jn,has:Nn,isPersistent:Ln,remove:Mn,set:xn});const Gn=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const $={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},kn=(e,r)=>$[e].height>$[r].height,Vn=(e,r)=>$[e].height>=$[r].height,Ze=(e,r)=>$[e].height<$[r].height,Bn=(e,r)=>$[e].height<=$[r].height,Un=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ze(r,t)?1:-1)[0],dt=Object.keys($).sort((e,r)=>Ze(e,r)?-1:1),Qn=(e,r=.02)=>[...dt].find(n=>$[n].height*(1+r)>=e),qn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return dt.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Kn=e=>$[e].height,er=e=>e===exports.VideoQuality.INVARIANT,Yn=e=>e.every(r=>!er(r));function Wn(e){if(er(e))throw new Error("Expected exact quality")}const ht=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=ht(a,o):t[n]=n in e?a:o}return t},Hn=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function zn(e,r=0,t){let n,o,a,i,s,l,c=0,u=!1,v=!1,f=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(u=!!t.leading,v="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function y(h){const S=n,j=o;return n=o=void 0,c=h,i=e.apply(j,S),i}function b(h,S){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,S)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=b(ee,r),u?y(h):i}function m(h){const S=h-l,j=h-c,br=r-S;return v?Math.min(br,a-j):br}function pr(h){const S=h-l,j=h-c;return l===void 0||S>=r||S<0||v&&j>=a}function ee(){const h=Date.now();if(pr(h))return yr(h);s=b(ee,m(h))}function yr(h){return s=void 0,f&&n?y(h):(n=o=void 0,i)}function pn(){s!==void 0&&O(s),c=0,n=l=o=s=void 0}function yn(){return s===void 0?i:yr(Date.now())}function bn(){return s!==void 0}function re(...h){const S=Date.now(),j=pr(S);if(n=h,o=this,l=S,j){if(s===void 0)return g(l);if(v)return s=b(ee,r),y(l)}return s===void 0&&(s=b(ee,r)),i}return re.cancel=pn,re.flush=yn,re.pending=bn,re}const rr=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=rr(e[n],r):t[n]=e[n]}return t},Xn=e=>rr(e);class Jn extends Xe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Zn(e){return new w(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new z)})}function eo(...e){return new w(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new z))}var ro=e=>new w(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),to=e=>new w(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),no=e=>new w(r=>{e.forEach(t=>r.next(t))}),oo=(e,r)=>new w(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ao(e){return r=>new w(t=>r.subscribe(new io(t,e)))}class io{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const so={leading:!1,trailing:!0};function co(e,r=so){return t=>new w(n=>t.subscribe(new lo(n,e,r)))}class lo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ft(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const uo={leading:!0,trailing:!1};function fo(e,r=uo){return t=>new w(n=>t.subscribe(new vo(n,e,r)))}class vo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,vt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ho(e){return r=>new w(t=>r.subscribe(new po(t,e)))}class po{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function yo(e=(r,t)=>r===t){return r=>new w(t=>r.subscribe(new bo(t,e)))}const gr={};class bo{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=gr}next(r){let t;try{t=this.lastValue===gr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function pt(e){return r=>new w(t=>r.subscribe(new go(t,e)))}let go=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function mo(e){return pt(()=>e)}function wo(){return e=>new w(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Oo(){return e=>new w(r=>e.subscribe(new Eo(r)))}class Eo{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function $o(e){return r=>new w(t=>r.subscribe(new So(t,e)))}class So{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class mr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class yt extends mr{constructor(){super(),this.listeners||mr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class To{constructor(){Object.defineProperty(this,"signal",{value:new yt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(To.prototype[Symbol.toStringTag]="AbortController",yt.prototype[Symbol.toStringTag]="AbortSignal");function bt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Io(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!bt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,u){let v;u&&u.signal&&(v=u.signal,delete u.signal);const f=new t(c,u);return v&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),f},a.prototype=t.prototype);const i=r;return{fetch:(l,c)=>{const u=a&&a.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(u){let v;try{v=new DOMException("Aborted","AbortError")}catch(d){v=new Error("Aborted"),v.name="AbortError"}if(u.aborted)return Promise.reject(v);const f=new Promise((d,y)=>{u.addEventListener("abort",()=>y(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(l,c)])}return i(l,c)},Request:a}}const tr=bt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),gt=tr?Io({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ro=tr?gt.fetch:window.fetch;tr?gt.Request:window.Request;var we=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A=function(e){try{return!!e()}catch(r){return!0}},_o=A,ye=!_o(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),mt=ye,wt=Function.prototype,Be=wt.call,Ao=mt&&wt.bind.bind(Be,Be),M=mt?Ao:function(e){return function(){return Be.apply(e,arguments)}},Ot=M,Co=Ot({}.toString),Lo=Ot("".slice),nr=function(e){return Lo(Co(e),8,-1)},jo=M,xo=A,No=nr,Oe=Object,Mo=jo("".split),Do=xo(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return No(e)=="String"?Mo(e,""):Oe(e)}:Oe,or=function(e){return e==null},Fo=or,Go=TypeError,Et=function(e){if(Fo(e))throw Go("Can't call method on "+e);return e},ko=Do,Vo=Et,X=function(e){return ko(Vo(e))},q={},te=function(e){return e&&e.Math==Math&&e},I=te(typeof globalThis=="object"&&globalThis)||te(typeof window=="object"&&window)||te(typeof self=="object"&&self)||te(typeof we=="object"&&we)||function(){return this}()||we||Function("return this")(),Ue=typeof document=="object"&&document.all,Bo=typeof Ue=="undefined"&&Ue!==void 0,$t={all:Ue,IS_HTMLDDA:Bo},St=$t,Uo=St.all,R=St.IS_HTMLDDA?function(e){return typeof e=="function"||e===Uo}:function(e){return typeof e=="function"},Qo=I,qo=R,wr=Qo.WeakMap,Ko=qo(wr)&&/native code/.test(String(wr)),Or=R,Tt=$t,Yo=Tt.all,K=Tt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===Yo}:function(e){return typeof e=="object"?e!==null:Or(e)},Wo=A,D=!Wo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Ho=I,Er=K,Qe=Ho.document,zo=Er(Qe)&&Er(Qe.createElement),It=function(e){return zo?Qe.createElement(e):{}},Xo=D,Jo=A,Zo=It,Rt=!Xo&&!Jo(function(){return Object.defineProperty(Zo("div"),"a",{get:function(){return 7}}).a!=7}),ea=D,ra=A,Pt=ea&&ra(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ta=K,na=String,oa=TypeError,W=function(e){if(ta(e))return e;throw oa(na(e)+" is not an object")},aa=ye,ne=Function.prototype.call,F=aa?ne.bind(ne):function(){return ne.apply(ne,arguments)},ar={},Ee=ar,$e=I,ia=R,$r=function(e){return ia(e)?e:void 0},_t=function(e,r){return arguments.length<2?$r(Ee[e])||$r($e[e]):Ee[e]&&Ee[e][r]||$e[e]&&$e[e][r]},sa=M,At=sa({}.isPrototypeOf),ca=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Ct=I,Se=ca,Sr=Ct.process,Tr=Ct.Deno,Ir=Sr&&Sr.versions||Tr&&Tr.version,Rr=Ir&&Ir.v8,T,de;Rr&&(T=Rr.split("."),de=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!de&&Se&&(T=Se.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Se.match(/Chrome\/(\d+)/),T&&(de=+T[1])));var la=de,Pr=la,ua=A,fa=I,va=fa.String,Lt=!!Object.getOwnPropertySymbols&&!ua(function(){var e=Symbol();return!va(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),da=Lt,jt=da&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ha=_t,pa=R,ya=At,ba=jt,ga=Object,xt=ba?function(e){return typeof e=="symbol"}:function(e){var r=ha("Symbol");return pa(r)&&ya(r.prototype,ga(e))},ma=String,ir=function(e){try{return ma(e)}catch(r){return"Object"}},wa=R,Oa=ir,Ea=TypeError,sr=function(e){if(wa(e))return e;throw Ea(Oa(e)+" is not a function")},$a=sr,Sa=or,cr=function(e,r){var t=e[r];return Sa(t)?void 0:$a(t)},Te=F,Ie=R,Re=K,Ta=TypeError,Ia=function(e,r){var t,n;if(r==="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e))||Ie(t=e.valueOf)&&!Re(n=Te(t,e))||r!=="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e)))return n;throw Ta("Can't convert object to primitive value")},Nt={exports:{}},_r=I,Ra=Object.defineProperty,Pa=function(e,r){try{Ra(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},_a=I,Aa=Pa,Ar="__core-js_shared__",Ca=_a[Ar]||Aa(Ar,{}),Mt=Ca,Cr=Mt;(Nt.exports=function(e,r){return Cr[e]||(Cr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Dt=Nt.exports,La=Et,ja=Object,Ft=function(e){return ja(La(e))},xa=M,Na=Ft,Ma=xa({}.hasOwnProperty),L=Object.hasOwn||function(r,t){return Ma(Na(r),t)},Da=M,Fa=0,Ga=Math.random(),ka=Da(1 .toString),Gt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ka(++Fa+Ga,36)},Va=I,Ba=Dt,Lr=L,Ua=Gt,Qa=Lt,qa=jt,U=Va.Symbol,Pe=Ba("wks"),Ka=qa?U.for||U:U&&U.withoutSetter||Ua,C=function(e){return Lr(Pe,e)||(Pe[e]=Qa&&Lr(U,e)?U[e]:Ka("Symbol."+e)),Pe[e]},Ya=F,jr=K,xr=xt,Wa=cr,Ha=Ia,za=C,Xa=TypeError,Ja=za("toPrimitive"),Za=function(e,r){if(!jr(e)||xr(e))return e;var t=Wa(e,Ja),n;if(t){if(r===void 0&&(r="default"),n=Ya(t,e,r),!jr(n)||xr(n))return n;throw Xa("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ha(e,r)},ei=Za,ri=xt,lr=function(e){var r=ei(e,"string");return ri(r)?r:r+""},ti=D,ni=Rt,oi=Pt,oe=W,Nr=lr,ai=TypeError,_e=Object.defineProperty,ii=Object.getOwnPropertyDescriptor,Ae="enumerable",Ce="configurable",Le="writable";Y.f=ti?oi?function(r,t,n){if(oe(r),t=Nr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Le in n&&!n[Le]){var o=ii(r,t);o&&o[Le]&&(r[t]=n.value,n={configurable:Ce in n?n[Ce]:o[Ce],enumerable:Ae in n?n[Ae]:o[Ae],writable:!1})}return _e(r,t,n)}:_e:function(r,t,n){if(oe(r),t=Nr(t),oe(n),ni)try{return _e(r,t,n)}catch(o){}if("get"in n||"set"in n)throw ai("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var be=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},si=D,ci=Y,li=be,J=si?function(e,r,t){return ci.f(e,r,li(1,t))}:function(e,r,t){return e[r]=t,e},ui=Dt,fi=Gt,Mr=ui("keys"),ur=function(e){return Mr[e]||(Mr[e]=fi(e))},fr={},vi=Ko,kt=I,di=K,hi=J,je=L,xe=Mt,pi=ur,yi=fr,Dr="Object already initialized",qe=kt.TypeError,bi=kt.WeakMap,he,H,pe,gi=function(e){return pe(e)?H(e):he(e,{})},mi=function(e){return function(r){var t;if(!di(r)||(t=H(r)).type!==e)throw qe("Incompatible receiver, "+e+" required");return t}};if(vi||xe.state){var P=xe.state||(xe.state=new bi);P.get=P.get,P.has=P.has,P.set=P.set,he=function(e,r){if(P.has(e))throw qe(Dr);return r.facade=e,P.set(e,r),r},H=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=pi("state");yi[G]=!0,he=function(e,r){if(je(e,G))throw qe(Dr);return r.facade=e,hi(e,G,r),r},H=function(e){return je(e,G)?e[G]:{}},pe=function(e){return je(e,G)}}var wi={set:he,get:H,has:pe,enforce:gi,getterFor:mi},Oi=ye,Vt=Function.prototype,Fr=Vt.apply,Gr=Vt.call,Ei=typeof Reflect=="object"&&Reflect.apply||(Oi?Gr.bind(Fr):function(){return Gr.apply(Fr,arguments)}),$i=nr,Si=M,Bt=function(e){if($i(e)==="Function")return Si(e)},Ut={},Qt={},qt={}.propertyIsEnumerable,Kt=Object.getOwnPropertyDescriptor,Ti=Kt&&!qt.call({1:2},1);Qt.f=Ti?function(r){var t=Kt(this,r);return!!t&&t.enumerable}:qt;var Ii=D,Ri=F,Pi=Qt,_i=be,Ai=X,Ci=lr,Li=L,ji=Rt,kr=Object.getOwnPropertyDescriptor;Ut.f=Ii?kr:function(r,t){if(r=Ai(r),t=Ci(t),ji)try{return kr(r,t)}catch(n){}if(Li(r,t))return _i(!Ri(Pi.f,r,t),r[t])};var xi=A,Ni=R,Mi=/#|\.prototype\./,Z=function(e,r){var t=Fi[Di(e)];return t==ki?!0:t==Gi?!1:Ni(r)?xi(r):!!r},Di=Z.normalize=function(e){return String(e).replace(Mi,".").toLowerCase()},Fi=Z.data={},Gi=Z.NATIVE="N",ki=Z.POLYFILL="P",Vi=Z,Vr=Bt,Bi=sr,Ui=ye,Qi=Vr(Vr.bind),Yt=function(e,r){return Bi(e),r===void 0?e:Ui?Qi(e,r):function(){return e.apply(r,arguments)}},ae=I,qi=Ei,Ki=Bt,Yi=R,Wi=Ut.f,Hi=Vi,k=ar,zi=Yt,V=J,Br=L,Xi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return qi(e,this,arguments)};return r.prototype=e.prototype,r},Wt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ae:o?ae[t]:(ae[t]||{}).prototype,s=n?k:k[t]||V(k,t,{})[t],l=s.prototype,c,u,v,f,d,y,b,O,g;for(f in r)c=Hi(n?f:t+(o?".":"#")+f,e.forced),u=!c&&i&&Br(i,f),y=s[f],u&&(e.dontCallGetSet?(g=Wi(i,f),b=g&&g.value):b=i[f]),d=u&&b?b:r[f],!(u&&typeof y==typeof d)&&(e.bind&&u?O=zi(d,ae):e.wrap&&u?O=Xi(d):a&&Yi(d)?O=Ki(d):O=d,(e.sham||d&&d.sham||y&&y.sham)&&V(O,"sham",!0),V(s,f,O),a&&(v=t+"Prototype",Br(k,v)||V(k,v,{}),V(k[v],f,d),e.real&&l&&(c||!l[f])&&V(l,f,d)))},Ke=D,Ji=L,Ht=Function.prototype,Zi=Ke&&Object.getOwnPropertyDescriptor,vr=Ji(Ht,"name"),es=vr&&function(){}.name==="something",rs=vr&&(!Ke||Ke&&Zi(Ht,"name").configurable),ts={EXISTS:vr,PROPER:es,CONFIGURABLE:rs},zt={},ns=Math.ceil,os=Math.floor,as=Math.trunc||function(r){var t=+r;return(t>0?os:ns)(t)},is=as,Xt=function(e){var r=+e;return r!==r||r===0?0:is(r)},ss=Xt,cs=Math.max,ls=Math.min,us=function(e,r){var t=ss(e);return t<0?cs(t+r,0):ls(t,r)},fs=Xt,vs=Math.min,ds=function(e){return e>0?vs(fs(e),9007199254740991):0},hs=ds,Jt=function(e){return hs(e.length)},ps=X,ys=us,bs=Jt,Ur=function(e){return function(r,t,n){var o=ps(r),a=bs(o),i=ys(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},gs={includes:Ur(!0),indexOf:Ur(!1)},ms=M,Ne=L,ws=X,Os=gs.indexOf,Es=fr,Qr=ms([].push),$s=function(e,r){var t=ws(e),n=0,o=[],a;for(a in t)!Ne(Es,a)&&Ne(t,a)&&Qr(o,a);for(;r.length>n;)Ne(t,a=r[n++])&&(~Os(o,a)||Qr(o,a));return o},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ss=$s,Ts=Zt,Is=Object.keys||function(r){return Ss(r,Ts)},Rs=D,Ps=Pt,_s=Y,As=W,Cs=X,Ls=Is;zt.f=Rs&&!Ps?Object.defineProperties:function(r,t){As(r);for(var n=Cs(t),o=Ls(t),a=o.length,i=0,s;a>i;)_s.f(r,s=o[i++],n[s]);return r};var js=_t,xs=js("document","documentElement"),Ns=W,Ms=zt,qr=Zt,Ds=fr,Fs=xs,Gs=It,ks=ur,Kr=">",Yr="<",Ye="prototype",We="script",en=ks("IE_PROTO"),Me=function(){},rn=function(e){return Yr+We+Kr+e+Yr+"/"+We+Kr},Wr=function(e){e.write(rn("")),e.close();var r=e.parentWindow.Object;return e=null,r},Vs=function(){var e=Gs("iframe"),r="java"+We+":",t;return e.style.display="none",Fs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(rn("document.F=Object")),t.close(),t.F},ie,ue=function(){try{ie=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ie?Wr(ie):Vs():Wr(ie);for(var e=qr.length;e--;)delete ue[Ye][qr[e]];return ue()};Ds[en]=!0;var tn=Object.create||function(r,t){var n;return r!==null?(Me[Ye]=Ns(r),n=new Me,Me[Ye]=null,n[en]=r):n=ue(),t===void 0?n:Ms.f(n,t)},Bs=A,Us=!Bs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Qs=L,qs=R,Ks=Ft,Ys=ur,Ws=Us,Hr=Ys("IE_PROTO"),He=Object,Hs=He.prototype,nn=Ws?He.getPrototypeOf:function(e){var r=Ks(e);if(Qs(r,Hr))return r[Hr];var t=r.constructor;return qs(t)&&r instanceof t?t.prototype:r instanceof He?Hs:null},zs=J,on=function(e,r,t,n){return n&&n.enumerable?e[r]=t:zs(e,r,t),e},Xs=A,Js=R,Zs=K,ec=tn,zr=nn,rc=on,tc=C,ze=tc("iterator"),an=!1,_,De,Fe;[].keys&&(Fe=[].keys(),"next"in Fe?(De=zr(zr(Fe)),De!==Object.prototype&&(_=De)):an=!0);var nc=!Zs(_)||Xs(function(){var e={};return _[ze].call(e)!==e});nc?_={}:_=ec(_);Js(_[ze])||rc(_,ze,function(){return this});var sn={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:an},oc=C,ac=oc("toStringTag"),cn={};cn[ac]="z";var dr=String(cn)==="[object z]",ic=dr,sc=R,fe=nr,cc=C,lc=cc("toStringTag"),uc=Object,fc=fe(function(){return arguments}())=="Arguments",vc=function(e,r){try{return e[r]}catch(t){}},hr=ic?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=vc(r=uc(e),lc))=="string"?t:fc?fe(r):(n=fe(r))=="Object"&&sc(r.callee)?"Arguments":n},dc=dr,hc=hr,pc=dc?{}.toString:function(){return"[object "+hc(this)+"]"},yc=dr,bc=Y.f,gc=J,mc=L,wc=pc,Oc=C,Xr=Oc("toStringTag"),ln=function(e,r,t,n){if(e){var o=t?e:e.prototype;mc(o,Xr)||bc(o,Xr,{configurable:!0,value:r}),n&&!yc&&gc(o,"toString",wc)}},Ec=sn.IteratorPrototype,$c=tn,Sc=be,Tc=ln,Ic=q,Rc=function(){return this},Pc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=$c(Ec,{next:Sc(+!n,t)}),Tc(e,o,!1,!0),Ic[o]=Rc,e},_c=Wt,Ac=F,un=ts,Cc=Pc,Lc=nn,jc=ln,Jr=on,xc=C,Zr=q,fn=sn,Nc=un.PROPER;un.CONFIGURABLE;fn.IteratorPrototype;var se=fn.BUGGY_SAFARI_ITERATORS,Ge=xc("iterator"),et="keys",ce="values",rt="entries",Mc=function(){return this},Dc=function(e,r,t,n,o,a,i){Cc(t,r,n);var s=function(g){if(g===o&&f)return f;if(!se&&g in u)return u[g];switch(g){case et:return function(){return new t(this,g)};case ce:return function(){return new t(this,g)};case rt:return function(){return new t(this,g)}}return function(){return new t(this)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[Ge]||u["@@iterator"]||o&&u[o],f=!se&&v||s(o),d=r=="Array"&&u.entries||v,y,b,O;if(d&&(y=Lc(d.call(new e)),y!==Object.prototype&&y.next&&(jc(y,l,!0,!0),Zr[l]=Mc)),Nc&&o==ce&&v&&v.name!==ce&&(c=!0,f=function(){return Ac(v,this)}),o)if(b={values:s(ce),keys:a?f:s(et),entries:s(rt)},i)for(O in b)(se||c||!(O in u))&&Jr(u,O,b[O]);else _c({target:r,proto:!0,forced:se||c},b);return i&&u[Ge]!==f&&Jr(u,Ge,f,{name:o}),Zr[r]=f,b},Fc=function(e,r){return{value:e,done:r}},Gc=X,tt=q,vn=wi;Y.f;var kc=Dc,le=Fc,dn="Array Iterator",Vc=vn.set,Bc=vn.getterFor(dn);kc(Array,"Array",function(e,r){Vc(this,{type:dn,target:Gc(e),index:0,kind:r})},function(){var e=Bc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,le(void 0,!0)):t=="keys"?le(n,!1):t=="values"?le(r[n],!1):le([n,r[n]],!1)},"values");tt.Arguments=tt.Array;var Uc=C,Qc=q,qc=Uc("iterator"),Kc=Array.prototype,Yc=function(e){return e!==void 0&&(Qc.Array===e||Kc[qc]===e)},Wc=hr,nt=cr,Hc=or,zc=q,Xc=C,Jc=Xc("iterator"),hn=function(e){if(!Hc(e))return nt(e,Jc)||nt(e,"@@iterator")||zc[Wc(e)]},Zc=F,el=sr,rl=W,tl=ir,nl=hn,ol=TypeError,al=function(e,r){var t=arguments.length<2?nl(e):r;if(el(t))return rl(Zc(t,e));throw ol(tl(e)+" is not iterable")},il=F,ot=W,sl=cr,cl=function(e,r,t){var n,o;ot(e);try{if(n=sl(e,"return"),!n){if(r==="throw")throw t;return t}n=il(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ot(n),t},ll=Yt,ul=F,fl=W,vl=ir,dl=Yc,hl=Jt,at=At,pl=al,yl=hn,it=cl,bl=TypeError,ve=function(e,r){this.stopped=e,this.result=r},st=ve.prototype,gl=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),l=ll(r,n),c,u,v,f,d,y,b,O=function(m){return c&&it(c,"normal",m),new ve(!0,m)},g=function(m){return o?(fl(m),s?l(m[0],m[1],O):l(m[0],m[1])):s?l(m,O):l(m)};if(a)c=e.iterator;else if(i)c=e;else{if(u=yl(e),!u)throw bl(vl(e)+" is not iterable");if(dl(u)){for(v=0,f=hl(e);f>v;v++)if(d=g(e[v]),d&&at(st,d))return d;return new ve(!1)}c=pl(e,u)}for(y=a?e.next:c.next;!(b=ul(y,c)).done;){try{d=g(b.value)}catch(m){it(c,"throw",m)}if(typeof d=="object"&&d&&at(st,d))return d}return new ve(!1)},ml=lr,wl=Y,Ol=be,El=function(e,r,t){var n=ml(r);n in e?wl.f(e,n,Ol(0,t)):e[n]=t},$l=Wt,Sl=gl,Tl=El;$l({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Sl(r,function(n,o){Tl(t,n,o)},{AS_ENTRIES:!0}),t}});var Il=ar,Rl=Il.Object.fromEntries,Pl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},_l=Pl,Al=I,Cl=hr,Ll=J,ct=q,jl=C,lt=jl("toStringTag");for(var ke in _l){var ut=Al[ke],Ve=ut&&ut.prototype;Ve&&Cl(Ve)!==lt&&Ll(Ve,lt,ke),ct[ke]=ct.Array}var xl=Rl,Nl=xl,Ml=Nl,Dl=Ml,Fl=Po(Dl);exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const Gl="vk.com",kl=async(e,r,t)=>{const n=new URL(`https://${Gl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Ro(n.toString())).json();return Vl(a,t)},Vl=(e,r)=>Fl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Bl(n)])),Bl=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=wn;exports.Observable=w;exports.Subject=Xe;exports.Subscription=z;exports.VERSION=gn;exports.ValueSubject=Jn;exports.abortable=Rn;exports.addScript=Tn;exports.areQualitiesExact=Yn;exports.assertEmptyArray=Sn;exports.assertNever=N;exports.assertNonNullable=On;exports.assertNotEmptyArray=$n;exports.assertNullable=En;exports.assertQualityIsExact=Wn;exports.buffer=ao;exports.checkNever=mn;exports.cloneDeep=Xn;exports.cloneDeepWith=rr;exports.combine=Zn;exports.debounce=co;exports.debounceFn=zn;exports.detectEmbed=Gn;exports.fillWithDefault=ht;exports.filter=ho;exports.filterChanged=yo;exports.fromEvent=oo;exports.getCurrentBrowser=Je;exports.getExponentialDelay=Cn;exports.getHighestQuality=Un;exports.getIOSVersion=_n;exports.interval=to;exports.isHigher=kn;exports.isHigherOrEqual=Vn;exports.isIOS=Pn;exports.isInvariantQuality=er;exports.isLower=Ze;exports.isLowerOrEqual=Bn;exports.isMacLike=An;exports.isNonNullable=ft;exports.isNullable=vt;exports.loadVKLangPack=kl;exports.map=pt;exports.mapTo=mo;exports.merge=eo;exports.noop=B;exports.now=In;exports.observableFrom=no;exports.once=wo;exports.pairwise=Oo;exports.safeStorage=Fn;exports.tap=$o;exports.throttle=fo;exports.timeCodeToString=Hn;exports.timeout=ro;exports.videoHeightToQuality=Qn;exports.videoQualityToHeight=Kn;exports.videoSizeToQuality=qn;
|
|
6
|
+
"use strict";const gn="1.0.32";class z{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const N=e=>{throw new Error(`${e} is value of unexpected type`)},mn=e=>{},B=()=>{};class w{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}:o={next:s=>t.next(s),error:s=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,s)}}:o={next:B,error:B};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(l){o.next(l)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new z().add(()=>{switch(a.next=B,a.error=B,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return N(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Xe extends w{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new z().add(()=>this.subscribers.delete(t))}}class wn{constructor(){this.log$=new Xe,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function On(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function En(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ft(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function $n(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Sn(e,r){if(e!=null&&e.length)throw new Error(r)}const Tn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{l&&clearTimeout(l),c.removeEventListener("load",i),c.removeEventListener("error",a)};let l;t&&(l=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var ge;const In=typeof((ge=window.performance)===null||ge===void 0?void 0:ge.now)=="function"?()=>window.performance.now():()=>Date.now(),Rn=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){await o.throw(s)}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Je=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,l=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,u=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,v=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:l||c||u||v||d||f||exports.CurrentClientDevice.Desktop}},Pn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},_n=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},An=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device),Cn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let E,x;const me=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(me,"test"),localStorage.removeItem(me),x=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(me),x=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=p.RUNTIME;else throw r}else throw e}return x===p.RUNTIME&&(E=new Map),x},Ln=()=>Q()===p.LOCAL_STORAGE,jn=e=>{var r,t;const n=Q();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return E==null?void 0:E.get(e);default:N(n)}},xn=(e,r)=>{const t=Q();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void(E==null?void 0:E.set(e,r));default:N(t)}},Nn=e=>{var r;const t=Q();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return N(t),!1}},Mn=e=>{const r=Q();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(E==null?void 0:E.delete(e));default:N(r)}},Dn=()=>{const e=Q();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return E==null?void 0:E.clear();default:N(e)}};var Fn=Object.freeze({__proto__:null,clear:Dn,get:jn,has:Nn,isPersistent:Ln,remove:Mn,set:xn});const Gn=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const $={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},kn=(e,r)=>$[e].height>$[r].height,Vn=(e,r)=>$[e].height>=$[r].height,Ze=(e,r)=>$[e].height<$[r].height,Bn=(e,r)=>$[e].height<=$[r].height,Un=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ze(r,t)?1:-1)[0],dt=Object.keys($).sort((e,r)=>Ze(e,r)?-1:1),Qn=(e,r=.02)=>[...dt].find(n=>$[n].height*(1+r)>=e),qn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return dt.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Kn=e=>$[e].height,er=e=>e===exports.VideoQuality.INVARIANT,Yn=e=>e.every(r=>!er(r));function Wn(e){if(er(e))throw new Error("Expected exact quality")}const ht=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=ht(a,o):t[n]=n in e?a:o}return t},Hn=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function zn(e,r=0,t){let n,o,a,i,s,l,c=0,u=!1,v=!1,f=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(u=!!t.leading,v="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function y(h){const S=n,j=o;return n=o=void 0,c=h,i=e.apply(j,S),i}function b(h,S){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,S)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=b(ee,r),u?y(h):i}function m(h){const S=h-l,j=h-c,br=r-S;return v?Math.min(br,a-j):br}function pr(h){const S=h-l,j=h-c;return l===void 0||S>=r||S<0||v&&j>=a}function ee(){const h=Date.now();if(pr(h))return yr(h);s=b(ee,m(h))}function yr(h){return s=void 0,f&&n?y(h):(n=o=void 0,i)}function pn(){s!==void 0&&O(s),c=0,n=l=o=s=void 0}function yn(){return s===void 0?i:yr(Date.now())}function bn(){return s!==void 0}function re(...h){const S=Date.now(),j=pr(S);if(n=h,o=this,l=S,j){if(s===void 0)return g(l);if(v)return s=b(ee,r),y(l)}return s===void 0&&(s=b(ee,r)),i}return re.cancel=pn,re.flush=yn,re.pending=bn,re}const rr=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=rr(e[n],r):t[n]=e[n]}return t},Xn=e=>rr(e);class Jn extends Xe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Zn(e){return new w(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new z)})}function eo(...e){return new w(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new z))}var ro=e=>new w(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),to=e=>new w(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),no=e=>new w(r=>{e.forEach(t=>r.next(t))}),oo=(e,r)=>new w(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ao(e){return r=>new w(t=>r.subscribe(new io(t,e)))}class io{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const so={leading:!1,trailing:!0};function co(e,r=so){return t=>new w(n=>t.subscribe(new lo(n,e,r)))}class lo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ft(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const uo={leading:!0,trailing:!1};function fo(e,r=uo){return t=>new w(n=>t.subscribe(new vo(n,e,r)))}class vo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,vt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ho(e){return r=>new w(t=>r.subscribe(new po(t,e)))}class po{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function yo(e=(r,t)=>r===t){return r=>new w(t=>r.subscribe(new bo(t,e)))}const gr={};class bo{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=gr}next(r){let t;try{t=this.lastValue===gr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function pt(e){return r=>new w(t=>r.subscribe(new go(t,e)))}let go=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function mo(e){return pt(()=>e)}function wo(){return e=>new w(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Oo(){return e=>new w(r=>e.subscribe(new Eo(r)))}class Eo{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function $o(e){return r=>new w(t=>r.subscribe(new So(t,e)))}class So{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class mr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class yt extends mr{constructor(){super(),this.listeners||mr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class To{constructor(){Object.defineProperty(this,"signal",{value:new yt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(To.prototype[Symbol.toStringTag]="AbortController",yt.prototype[Symbol.toStringTag]="AbortSignal");function bt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Io(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!bt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,u){let v;u&&u.signal&&(v=u.signal,delete u.signal);const f=new t(c,u);return v&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),f},a.prototype=t.prototype);const i=r;return{fetch:(l,c)=>{const u=a&&a.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(u){let v;try{v=new DOMException("Aborted","AbortError")}catch(d){v=new Error("Aborted"),v.name="AbortError"}if(u.aborted)return Promise.reject(v);const f=new Promise((d,y)=>{u.addEventListener("abort",()=>y(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(l,c)])}return i(l,c)},Request:a}}const tr=bt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),gt=tr?Io({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ro=tr?gt.fetch:window.fetch;tr?gt.Request:window.Request;var we=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A=function(e){try{return!!e()}catch(r){return!0}},_o=A,ye=!_o(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),mt=ye,wt=Function.prototype,Be=wt.call,Ao=mt&&wt.bind.bind(Be,Be),M=mt?Ao:function(e){return function(){return Be.apply(e,arguments)}},Ot=M,Co=Ot({}.toString),Lo=Ot("".slice),nr=function(e){return Lo(Co(e),8,-1)},jo=M,xo=A,No=nr,Oe=Object,Mo=jo("".split),Do=xo(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return No(e)=="String"?Mo(e,""):Oe(e)}:Oe,or=function(e){return e==null},Fo=or,Go=TypeError,Et=function(e){if(Fo(e))throw Go("Can't call method on "+e);return e},ko=Do,Vo=Et,X=function(e){return ko(Vo(e))},q={},te=function(e){return e&&e.Math==Math&&e},I=te(typeof globalThis=="object"&&globalThis)||te(typeof window=="object"&&window)||te(typeof self=="object"&&self)||te(typeof we=="object"&&we)||function(){return this}()||we||Function("return this")(),Ue=typeof document=="object"&&document.all,Bo=typeof Ue=="undefined"&&Ue!==void 0,$t={all:Ue,IS_HTMLDDA:Bo},St=$t,Uo=St.all,R=St.IS_HTMLDDA?function(e){return typeof e=="function"||e===Uo}:function(e){return typeof e=="function"},Qo=I,qo=R,wr=Qo.WeakMap,Ko=qo(wr)&&/native code/.test(String(wr)),Or=R,Tt=$t,Yo=Tt.all,K=Tt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===Yo}:function(e){return typeof e=="object"?e!==null:Or(e)},Wo=A,D=!Wo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Ho=I,Er=K,Qe=Ho.document,zo=Er(Qe)&&Er(Qe.createElement),It=function(e){return zo?Qe.createElement(e):{}},Xo=D,Jo=A,Zo=It,Rt=!Xo&&!Jo(function(){return Object.defineProperty(Zo("div"),"a",{get:function(){return 7}}).a!=7}),ea=D,ra=A,Pt=ea&&ra(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ta=K,na=String,oa=TypeError,W=function(e){if(ta(e))return e;throw oa(na(e)+" is not an object")},aa=ye,ne=Function.prototype.call,F=aa?ne.bind(ne):function(){return ne.apply(ne,arguments)},ar={},Ee=ar,$e=I,ia=R,$r=function(e){return ia(e)?e:void 0},_t=function(e,r){return arguments.length<2?$r(Ee[e])||$r($e[e]):Ee[e]&&Ee[e][r]||$e[e]&&$e[e][r]},sa=M,At=sa({}.isPrototypeOf),ca=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Ct=I,Se=ca,Sr=Ct.process,Tr=Ct.Deno,Ir=Sr&&Sr.versions||Tr&&Tr.version,Rr=Ir&&Ir.v8,T,de;Rr&&(T=Rr.split("."),de=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!de&&Se&&(T=Se.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Se.match(/Chrome\/(\d+)/),T&&(de=+T[1])));var la=de,Pr=la,ua=A,fa=I,va=fa.String,Lt=!!Object.getOwnPropertySymbols&&!ua(function(){var e=Symbol();return!va(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),da=Lt,jt=da&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ha=_t,pa=R,ya=At,ba=jt,ga=Object,xt=ba?function(e){return typeof e=="symbol"}:function(e){var r=ha("Symbol");return pa(r)&&ya(r.prototype,ga(e))},ma=String,ir=function(e){try{return ma(e)}catch(r){return"Object"}},wa=R,Oa=ir,Ea=TypeError,sr=function(e){if(wa(e))return e;throw Ea(Oa(e)+" is not a function")},$a=sr,Sa=or,cr=function(e,r){var t=e[r];return Sa(t)?void 0:$a(t)},Te=F,Ie=R,Re=K,Ta=TypeError,Ia=function(e,r){var t,n;if(r==="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e))||Ie(t=e.valueOf)&&!Re(n=Te(t,e))||r!=="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e)))return n;throw Ta("Can't convert object to primitive value")},Nt={exports:{}},_r=I,Ra=Object.defineProperty,Pa=function(e,r){try{Ra(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},_a=I,Aa=Pa,Ar="__core-js_shared__",Ca=_a[Ar]||Aa(Ar,{}),Mt=Ca,Cr=Mt;(Nt.exports=function(e,r){return Cr[e]||(Cr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Dt=Nt.exports,La=Et,ja=Object,Ft=function(e){return ja(La(e))},xa=M,Na=Ft,Ma=xa({}.hasOwnProperty),L=Object.hasOwn||function(r,t){return Ma(Na(r),t)},Da=M,Fa=0,Ga=Math.random(),ka=Da(1 .toString),Gt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ka(++Fa+Ga,36)},Va=I,Ba=Dt,Lr=L,Ua=Gt,Qa=Lt,qa=jt,U=Va.Symbol,Pe=Ba("wks"),Ka=qa?U.for||U:U&&U.withoutSetter||Ua,C=function(e){return Lr(Pe,e)||(Pe[e]=Qa&&Lr(U,e)?U[e]:Ka("Symbol."+e)),Pe[e]},Ya=F,jr=K,xr=xt,Wa=cr,Ha=Ia,za=C,Xa=TypeError,Ja=za("toPrimitive"),Za=function(e,r){if(!jr(e)||xr(e))return e;var t=Wa(e,Ja),n;if(t){if(r===void 0&&(r="default"),n=Ya(t,e,r),!jr(n)||xr(n))return n;throw Xa("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ha(e,r)},ei=Za,ri=xt,lr=function(e){var r=ei(e,"string");return ri(r)?r:r+""},ti=D,ni=Rt,oi=Pt,oe=W,Nr=lr,ai=TypeError,_e=Object.defineProperty,ii=Object.getOwnPropertyDescriptor,Ae="enumerable",Ce="configurable",Le="writable";Y.f=ti?oi?function(r,t,n){if(oe(r),t=Nr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Le in n&&!n[Le]){var o=ii(r,t);o&&o[Le]&&(r[t]=n.value,n={configurable:Ce in n?n[Ce]:o[Ce],enumerable:Ae in n?n[Ae]:o[Ae],writable:!1})}return _e(r,t,n)}:_e:function(r,t,n){if(oe(r),t=Nr(t),oe(n),ni)try{return _e(r,t,n)}catch(o){}if("get"in n||"set"in n)throw ai("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var be=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},si=D,ci=Y,li=be,J=si?function(e,r,t){return ci.f(e,r,li(1,t))}:function(e,r,t){return e[r]=t,e},ui=Dt,fi=Gt,Mr=ui("keys"),ur=function(e){return Mr[e]||(Mr[e]=fi(e))},fr={},vi=Ko,kt=I,di=K,hi=J,je=L,xe=Mt,pi=ur,yi=fr,Dr="Object already initialized",qe=kt.TypeError,bi=kt.WeakMap,he,H,pe,gi=function(e){return pe(e)?H(e):he(e,{})},mi=function(e){return function(r){var t;if(!di(r)||(t=H(r)).type!==e)throw qe("Incompatible receiver, "+e+" required");return t}};if(vi||xe.state){var P=xe.state||(xe.state=new bi);P.get=P.get,P.has=P.has,P.set=P.set,he=function(e,r){if(P.has(e))throw qe(Dr);return r.facade=e,P.set(e,r),r},H=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=pi("state");yi[G]=!0,he=function(e,r){if(je(e,G))throw qe(Dr);return r.facade=e,hi(e,G,r),r},H=function(e){return je(e,G)?e[G]:{}},pe=function(e){return je(e,G)}}var wi={set:he,get:H,has:pe,enforce:gi,getterFor:mi},Oi=ye,Vt=Function.prototype,Fr=Vt.apply,Gr=Vt.call,Ei=typeof Reflect=="object"&&Reflect.apply||(Oi?Gr.bind(Fr):function(){return Gr.apply(Fr,arguments)}),$i=nr,Si=M,Bt=function(e){if($i(e)==="Function")return Si(e)},Ut={},Qt={},qt={}.propertyIsEnumerable,Kt=Object.getOwnPropertyDescriptor,Ti=Kt&&!qt.call({1:2},1);Qt.f=Ti?function(r){var t=Kt(this,r);return!!t&&t.enumerable}:qt;var Ii=D,Ri=F,Pi=Qt,_i=be,Ai=X,Ci=lr,Li=L,ji=Rt,kr=Object.getOwnPropertyDescriptor;Ut.f=Ii?kr:function(r,t){if(r=Ai(r),t=Ci(t),ji)try{return kr(r,t)}catch(n){}if(Li(r,t))return _i(!Ri(Pi.f,r,t),r[t])};var xi=A,Ni=R,Mi=/#|\.prototype\./,Z=function(e,r){var t=Fi[Di(e)];return t==ki?!0:t==Gi?!1:Ni(r)?xi(r):!!r},Di=Z.normalize=function(e){return String(e).replace(Mi,".").toLowerCase()},Fi=Z.data={},Gi=Z.NATIVE="N",ki=Z.POLYFILL="P",Vi=Z,Vr=Bt,Bi=sr,Ui=ye,Qi=Vr(Vr.bind),Yt=function(e,r){return Bi(e),r===void 0?e:Ui?Qi(e,r):function(){return e.apply(r,arguments)}},ae=I,qi=Ei,Ki=Bt,Yi=R,Wi=Ut.f,Hi=Vi,k=ar,zi=Yt,V=J,Br=L,Xi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return qi(e,this,arguments)};return r.prototype=e.prototype,r},Wt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ae:o?ae[t]:(ae[t]||{}).prototype,s=n?k:k[t]||V(k,t,{})[t],l=s.prototype,c,u,v,f,d,y,b,O,g;for(f in r)c=Hi(n?f:t+(o?".":"#")+f,e.forced),u=!c&&i&&Br(i,f),y=s[f],u&&(e.dontCallGetSet?(g=Wi(i,f),b=g&&g.value):b=i[f]),d=u&&b?b:r[f],!(u&&typeof y==typeof d)&&(e.bind&&u?O=zi(d,ae):e.wrap&&u?O=Xi(d):a&&Yi(d)?O=Ki(d):O=d,(e.sham||d&&d.sham||y&&y.sham)&&V(O,"sham",!0),V(s,f,O),a&&(v=t+"Prototype",Br(k,v)||V(k,v,{}),V(k[v],f,d),e.real&&l&&(c||!l[f])&&V(l,f,d)))},Ke=D,Ji=L,Ht=Function.prototype,Zi=Ke&&Object.getOwnPropertyDescriptor,vr=Ji(Ht,"name"),es=vr&&function(){}.name==="something",rs=vr&&(!Ke||Ke&&Zi(Ht,"name").configurable),ts={EXISTS:vr,PROPER:es,CONFIGURABLE:rs},zt={},ns=Math.ceil,os=Math.floor,as=Math.trunc||function(r){var t=+r;return(t>0?os:ns)(t)},is=as,Xt=function(e){var r=+e;return r!==r||r===0?0:is(r)},ss=Xt,cs=Math.max,ls=Math.min,us=function(e,r){var t=ss(e);return t<0?cs(t+r,0):ls(t,r)},fs=Xt,vs=Math.min,ds=function(e){return e>0?vs(fs(e),9007199254740991):0},hs=ds,Jt=function(e){return hs(e.length)},ps=X,ys=us,bs=Jt,Ur=function(e){return function(r,t,n){var o=ps(r),a=bs(o),i=ys(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},gs={includes:Ur(!0),indexOf:Ur(!1)},ms=M,Ne=L,ws=X,Os=gs.indexOf,Es=fr,Qr=ms([].push),$s=function(e,r){var t=ws(e),n=0,o=[],a;for(a in t)!Ne(Es,a)&&Ne(t,a)&&Qr(o,a);for(;r.length>n;)Ne(t,a=r[n++])&&(~Os(o,a)||Qr(o,a));return o},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ss=$s,Ts=Zt,Is=Object.keys||function(r){return Ss(r,Ts)},Rs=D,Ps=Pt,_s=Y,As=W,Cs=X,Ls=Is;zt.f=Rs&&!Ps?Object.defineProperties:function(r,t){As(r);for(var n=Cs(t),o=Ls(t),a=o.length,i=0,s;a>i;)_s.f(r,s=o[i++],n[s]);return r};var js=_t,xs=js("document","documentElement"),Ns=W,Ms=zt,qr=Zt,Ds=fr,Fs=xs,Gs=It,ks=ur,Kr=">",Yr="<",Ye="prototype",We="script",en=ks("IE_PROTO"),Me=function(){},rn=function(e){return Yr+We+Kr+e+Yr+"/"+We+Kr},Wr=function(e){e.write(rn("")),e.close();var r=e.parentWindow.Object;return e=null,r},Vs=function(){var e=Gs("iframe"),r="java"+We+":",t;return e.style.display="none",Fs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(rn("document.F=Object")),t.close(),t.F},ie,ue=function(){try{ie=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ie?Wr(ie):Vs():Wr(ie);for(var e=qr.length;e--;)delete ue[Ye][qr[e]];return ue()};Ds[en]=!0;var tn=Object.create||function(r,t){var n;return r!==null?(Me[Ye]=Ns(r),n=new Me,Me[Ye]=null,n[en]=r):n=ue(),t===void 0?n:Ms.f(n,t)},Bs=A,Us=!Bs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Qs=L,qs=R,Ks=Ft,Ys=ur,Ws=Us,Hr=Ys("IE_PROTO"),He=Object,Hs=He.prototype,nn=Ws?He.getPrototypeOf:function(e){var r=Ks(e);if(Qs(r,Hr))return r[Hr];var t=r.constructor;return qs(t)&&r instanceof t?t.prototype:r instanceof He?Hs:null},zs=J,on=function(e,r,t,n){return n&&n.enumerable?e[r]=t:zs(e,r,t),e},Xs=A,Js=R,Zs=K,ec=tn,zr=nn,rc=on,tc=C,ze=tc("iterator"),an=!1,_,De,Fe;[].keys&&(Fe=[].keys(),"next"in Fe?(De=zr(zr(Fe)),De!==Object.prototype&&(_=De)):an=!0);var nc=!Zs(_)||Xs(function(){var e={};return _[ze].call(e)!==e});nc?_={}:_=ec(_);Js(_[ze])||rc(_,ze,function(){return this});var sn={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:an},oc=C,ac=oc("toStringTag"),cn={};cn[ac]="z";var dr=String(cn)==="[object z]",ic=dr,sc=R,fe=nr,cc=C,lc=cc("toStringTag"),uc=Object,fc=fe(function(){return arguments}())=="Arguments",vc=function(e,r){try{return e[r]}catch(t){}},hr=ic?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=vc(r=uc(e),lc))=="string"?t:fc?fe(r):(n=fe(r))=="Object"&&sc(r.callee)?"Arguments":n},dc=dr,hc=hr,pc=dc?{}.toString:function(){return"[object "+hc(this)+"]"},yc=dr,bc=Y.f,gc=J,mc=L,wc=pc,Oc=C,Xr=Oc("toStringTag"),ln=function(e,r,t,n){if(e){var o=t?e:e.prototype;mc(o,Xr)||bc(o,Xr,{configurable:!0,value:r}),n&&!yc&&gc(o,"toString",wc)}},Ec=sn.IteratorPrototype,$c=tn,Sc=be,Tc=ln,Ic=q,Rc=function(){return this},Pc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=$c(Ec,{next:Sc(+!n,t)}),Tc(e,o,!1,!0),Ic[o]=Rc,e},_c=Wt,Ac=F,un=ts,Cc=Pc,Lc=nn,jc=ln,Jr=on,xc=C,Zr=q,fn=sn,Nc=un.PROPER;un.CONFIGURABLE;fn.IteratorPrototype;var se=fn.BUGGY_SAFARI_ITERATORS,Ge=xc("iterator"),et="keys",ce="values",rt="entries",Mc=function(){return this},Dc=function(e,r,t,n,o,a,i){Cc(t,r,n);var s=function(g){if(g===o&&f)return f;if(!se&&g in u)return u[g];switch(g){case et:return function(){return new t(this,g)};case ce:return function(){return new t(this,g)};case rt:return function(){return new t(this,g)}}return function(){return new t(this)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[Ge]||u["@@iterator"]||o&&u[o],f=!se&&v||s(o),d=r=="Array"&&u.entries||v,y,b,O;if(d&&(y=Lc(d.call(new e)),y!==Object.prototype&&y.next&&(jc(y,l,!0,!0),Zr[l]=Mc)),Nc&&o==ce&&v&&v.name!==ce&&(c=!0,f=function(){return Ac(v,this)}),o)if(b={values:s(ce),keys:a?f:s(et),entries:s(rt)},i)for(O in b)(se||c||!(O in u))&&Jr(u,O,b[O]);else _c({target:r,proto:!0,forced:se||c},b);return i&&u[Ge]!==f&&Jr(u,Ge,f,{name:o}),Zr[r]=f,b},Fc=function(e,r){return{value:e,done:r}},Gc=X,tt=q,vn=wi;Y.f;var kc=Dc,le=Fc,dn="Array Iterator",Vc=vn.set,Bc=vn.getterFor(dn);kc(Array,"Array",function(e,r){Vc(this,{type:dn,target:Gc(e),index:0,kind:r})},function(){var e=Bc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,le(void 0,!0)):t=="keys"?le(n,!1):t=="values"?le(r[n],!1):le([n,r[n]],!1)},"values");tt.Arguments=tt.Array;var Uc=C,Qc=q,qc=Uc("iterator"),Kc=Array.prototype,Yc=function(e){return e!==void 0&&(Qc.Array===e||Kc[qc]===e)},Wc=hr,nt=cr,Hc=or,zc=q,Xc=C,Jc=Xc("iterator"),hn=function(e){if(!Hc(e))return nt(e,Jc)||nt(e,"@@iterator")||zc[Wc(e)]},Zc=F,el=sr,rl=W,tl=ir,nl=hn,ol=TypeError,al=function(e,r){var t=arguments.length<2?nl(e):r;if(el(t))return rl(Zc(t,e));throw ol(tl(e)+" is not iterable")},il=F,ot=W,sl=cr,cl=function(e,r,t){var n,o;ot(e);try{if(n=sl(e,"return"),!n){if(r==="throw")throw t;return t}n=il(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ot(n),t},ll=Yt,ul=F,fl=W,vl=ir,dl=Yc,hl=Jt,at=At,pl=al,yl=hn,it=cl,bl=TypeError,ve=function(e,r){this.stopped=e,this.result=r},st=ve.prototype,gl=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),l=ll(r,n),c,u,v,f,d,y,b,O=function(m){return c&&it(c,"normal",m),new ve(!0,m)},g=function(m){return o?(fl(m),s?l(m[0],m[1],O):l(m[0],m[1])):s?l(m,O):l(m)};if(a)c=e.iterator;else if(i)c=e;else{if(u=yl(e),!u)throw bl(vl(e)+" is not iterable");if(dl(u)){for(v=0,f=hl(e);f>v;v++)if(d=g(e[v]),d&&at(st,d))return d;return new ve(!1)}c=pl(e,u)}for(y=a?e.next:c.next;!(b=ul(y,c)).done;){try{d=g(b.value)}catch(m){it(c,"throw",m)}if(typeof d=="object"&&d&&at(st,d))return d}return new ve(!1)},ml=lr,wl=Y,Ol=be,El=function(e,r,t){var n=ml(r);n in e?wl.f(e,n,Ol(0,t)):e[n]=t},$l=Wt,Sl=gl,Tl=El;$l({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Sl(r,function(n,o){Tl(t,n,o)},{AS_ENTRIES:!0}),t}});var Il=ar,Rl=Il.Object.fromEntries,Pl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},_l=Pl,Al=I,Cl=hr,Ll=J,ct=q,jl=C,lt=jl("toStringTag");for(var ke in _l){var ut=Al[ke],Ve=ut&&ut.prototype;Ve&&Cl(Ve)!==lt&&Ll(Ve,lt,ke),ct[ke]=ct.Array}var xl=Rl,Nl=xl,Ml=Nl,Dl=Ml,Fl=Po(Dl);exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const Gl="vk.com",kl=async(e,r,t)=>{const n=new URL(`https://${Gl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Ro(n.toString())).json();return Vl(a,t)},Vl=(e,r)=>Fl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Bl(n)])),Bl=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=wn;exports.Observable=w;exports.Subject=Xe;exports.Subscription=z;exports.VERSION=gn;exports.ValueSubject=Jn;exports.abortable=Rn;exports.addScript=Tn;exports.areQualitiesExact=Yn;exports.assertEmptyArray=Sn;exports.assertNever=N;exports.assertNonNullable=On;exports.assertNotEmptyArray=$n;exports.assertNullable=En;exports.assertQualityIsExact=Wn;exports.buffer=ao;exports.checkNever=mn;exports.cloneDeep=Xn;exports.cloneDeepWith=rr;exports.combine=Zn;exports.debounce=co;exports.debounceFn=zn;exports.detectEmbed=Gn;exports.fillWithDefault=ht;exports.filter=ho;exports.filterChanged=yo;exports.fromEvent=oo;exports.getCurrentBrowser=Je;exports.getExponentialDelay=Cn;exports.getHighestQuality=Un;exports.getIOSVersion=_n;exports.interval=to;exports.isHigher=kn;exports.isHigherOrEqual=Vn;exports.isIOS=Pn;exports.isInvariantQuality=er;exports.isLower=Ze;exports.isLowerOrEqual=Bn;exports.isMacLike=An;exports.isNonNullable=ft;exports.isNullable=vt;exports.loadVKLangPack=kl;exports.map=pt;exports.mapTo=mo;exports.merge=eo;exports.noop=B;exports.now=In;exports.observableFrom=no;exports.once=wo;exports.pairwise=Oo;exports.safeStorage=Fn;exports.tap=$o;exports.throttle=fo;exports.timeCodeToString=Hn;exports.timeout=ro;exports.videoHeightToQuality=Qn;exports.videoQualityToHeight=Kn;exports.videoSizeToQuality=qn;
|
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const ol="1.0.32-dev.935ac7b0.0";class ge{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const K=e=>{throw new Error(`${e} is value of unexpected type`)},al=e=>{},X=()=>{};class E{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:X}:o={next:s=>t.next(s),error:s=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,s)}}:o={next:X,error:X};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(l){o.next(l)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new ge().add(()=>{switch(a.next=X,a.error=X,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return K(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class vt extends E{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new ge().add(()=>this.subscribers.delete(t))}}class il{constructor(){this.log$=new vt,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function sl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function cl(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function On(e){return typeof e!="undefined"&&e!==null}function wn(e){return e==null}function ll(e,r){if(!(e!=null&&e.length))throw new Error(r)}function ul(e,r){if(e!=null&&e.length)throw new Error(r)}const fl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{l&&clearTimeout(l),c.removeEventListener("load",i),c.removeEventListener("error",a)};let l;t&&(l=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var we;const vl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now(),dl=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){await o.throw(s)}return i};var j;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(j||(j={}));var w;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(w||(w={}));const dt=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?j.Yandex:void 0,t=/chrome|crios/i.test(e)?j.Chrome:void 0,n=/chromium/i.test(e)?j.Chromium:void 0,o=/firefox|fxios/i.test(e)?j.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?j.Safari:void 0,i=/opr\//i.test(e)?j.Opera:void 0,s=/edg/i.test(e)?j.Edge:void 0,l=/android/i.test(e)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,u=/ipad/i.test(e)?w.iPad:void 0,v=/ipod/i.test(e)?w.iPod:void 0,f=/mac/i.test(e)?w.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:l||c||u||v||d||f||w.Desktop}},hl=(e=!1)=>{const t=[w.iPhone,w.iPad,w.iPod].includes(dt().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},pl=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},bl=()=>[w.Mac,w.iPhone,w.iPad,w.iPod].includes(dt().device),yl=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let $,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&($=new Map),F},$n=()=>Y()===p.LOCAL_STORAGE,En=e=>{var r,t;const n=Y();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return $==null?void 0:$.get(e);default:K(n)}},Sn=(e,r)=>{const t=Y();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void($==null?void 0:$.set(e,r));default:K(t)}},Tn=e=>{var r;const t=Y();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=$==null?void 0:$.has(e))!==null&&r!==void 0?r:!1;default:return K(t),!1}},In=e=>{const r=Y();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void($==null?void 0:$.delete(e));default:K(r)}},Rn=()=>{const e=Y();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return $==null?void 0:$.clear();default:K(e)}};var gl=Object.freeze({__proto__:null,clear:Rn,get:En,has:Tn,isPersistent:$n,remove:In,set:Sn});const ml=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var S;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(S||(S={}));const T={[S.Q_144P]:{width:256,height:144},[S.Q_240P]:{width:428,height:240},[S.Q_360P]:{width:640,height:360},[S.Q_480P]:{width:856,height:480},[S.Q_720P]:{width:1280,height:720},[S.Q_1080P]:{width:1920,height:1080},[S.Q_1440P]:{width:2560,height:1440},[S.Q_2160P]:{width:3840,height:2160},[S.Q_4320P]:{width:7680,height:4320}},Ol=(e,r)=>T[e].height>T[r].height,wl=(e,r)=>T[e].height>=T[r].height,ht=(e,r)=>T[e].height<T[r].height,$l=(e,r)=>T[e].height<=T[r].height,El=e=>e.sort((r,t)=>r===t?0:r===S.INVARIANT?1:t===S.INVARIANT?-1:ht(r,t)?1:-1)[0],pt=Object.keys(T).sort((e,r)=>ht(e,r)?-1:1),Sl=(e,r=.02)=>[...pt].find(n=>T[n].height*(1+r)>=e),Tl=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return pt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Il=e=>T[e].height,bt=e=>e===S.INVARIANT,Rl=e=>e.every(r=>!bt(r));function Pl(e){if(bt(e))throw new Error("Expected exact quality")}const Pn=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=Pn(a,o):t[n]=n in e?a:o}return t},_l=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function Al(e,r=0,t){let n,o,a,i,s,l,c=0,u=!1,v=!1,f=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(u=!!t.leading,v="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function b(h){const I=n,C=o;return n=o=void 0,c=h,i=e.apply(C,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=y(te,r),u?b(h):i}function m(h){const I=h-l,C=h-c,pr=r-I;return v?Math.min(pr,a-C):pr}function dr(h){const I=h-l,C=h-c;return l===void 0||I>=r||I<0||v&&C>=a}function te(){const h=Date.now();if(dr(h))return hr(h);s=y(te,m(h))}function hr(h){return s=void 0,f&&n?b(h):(n=o=void 0,i)}function yn(){s!==void 0&&O(s),c=0,n=l=o=s=void 0}function gn(){return s===void 0?i:hr(Date.now())}function mn(){return s!==void 0}function ne(...h){const I=Date.now(),C=dr(I);if(n=h,o=this,l=I,C){if(s===void 0)return g(l);if(v)return s=y(te,r),b(l)}return s===void 0&&(s=y(te,r)),i}return ne.cancel=yn,ne.flush=gn,ne.pending=mn,ne}const yt=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=yt(e[n],r):t[n]=e[n]}return t},jl=e=>yt(e);class Ll extends vt{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function xl(e){return new E(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new ge)})}function Ml(...e){return new E(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Nl=e=>new E(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Cl=e=>new E(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Fl=e=>new E(r=>{e.forEach(t=>r.next(t))}),Dl=(e,r)=>new E(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Gl(e){return r=>new E(t=>r.subscribe(new _n(t,e)))}class _n{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const An={leading:!1,trailing:!0};function kl(e,r=An){return t=>new E(n=>t.subscribe(new jn(n,e,r)))}class jn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,On(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Ln={leading:!0,trailing:!1};function Ul(e,r=Ln){return t=>new E(n=>t.subscribe(new xn(n,e,r)))}class xn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,wn(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Vl(e){return r=>new E(t=>r.subscribe(new Mn(t,e)))}class Mn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Bl(e=(r,t)=>r===t){return r=>new E(t=>r.subscribe(new Nn(t,e)))}const br={};class Nn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=br}next(r){let t;try{t=this.lastValue===br||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Cn(e){return r=>new E(t=>r.subscribe(new Fn(t,e)))}let Fn=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Kl(e){return Cn(()=>e)}function Yl(){return e=>new E(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Wl(){return e=>new E(r=>e.subscribe(new Dn(r)))}class Dn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Ql(e){return r=>new E(t=>r.subscribe(new Gn(t,e)))}class Gn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var yr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(yr||(yr={}));class gr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class gt extends gr{constructor(){super(),this.listeners||gr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class kn{constructor(){Object.defineProperty(this,"signal",{value:new gt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(kn.prototype[Symbol.toStringTag]="AbortController",gt.prototype[Symbol.toStringTag]="AbortSignal");function mt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Un(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!mt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,u){let v;u&&u.signal&&(v=u.signal,delete u.signal);const f=new t(c,u);return v&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),f},a.prototype=t.prototype);const i=r;return{fetch:(l,c)=>{const u=a&&a.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(u){let v;try{v=new DOMException("Aborted","AbortError")}catch(d){v=new Error("Aborted"),v.name="AbortError"}if(u.aborted)return Promise.reject(v);const f=new Promise((d,b)=>{u.addEventListener("abort",()=>b(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(l,c)])}return i(l,c)},Request:a}}const er=mt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Ot=er?Un({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Vn=er?Ot.fetch:window.fetch;er?Ot.Request:window.Request;var Ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x=function(e){try{return!!e()}catch(r){return!0}},qn=x,me=!qn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),wt=me,$t=Function.prototype,Ke=$t.call,Kn=wt&&$t.bind.bind(Ke,Ke),D=wt?Kn:function(e){return function(){return Ke.apply(e,arguments)}},Et=D,Yn=Et({}.toString),Wn=Et("".slice),rr=function(e){return Wn(Yn(e),8,-1)},Qn=D,zn=x,Hn=rr,Se=Object,Xn=Qn("".split),Jn=zn(function(){return!Se("z").propertyIsEnumerable(0)})?function(e){return Hn(e)=="String"?Xn(e,""):Se(e)}:Se,tr=function(e){return e==null},Zn=tr,eo=TypeError,St=function(e){if(Zn(e))throw eo("Can't call method on "+e);return e},ro=Jn,to=St,Z=function(e){return ro(to(e))},W={},oe=function(e){return e&&e.Math==Math&&e},P=oe(typeof globalThis=="object"&&globalThis)||oe(typeof window=="object"&&window)||oe(typeof self=="object"&&self)||oe(typeof Ee=="object"&&Ee)||function(){return this}()||Ee||Function("return this")(),Ye=typeof document=="object"&&document.all,no=typeof Ye=="undefined"&&Ye!==void 0,Tt={all:Ye,IS_HTMLDDA:no},It=Tt,oo=It.all,_=It.IS_HTMLDDA?function(e){return typeof e=="function"||e===oo}:function(e){return typeof e=="function"},ao=P,io=_,mr=ao.WeakMap,so=io(mr)&&/native code/.test(String(mr)),Or=_,Rt=Tt,co=Rt.all,Q=Rt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===co}:function(e){return typeof e=="object"?e!==null:Or(e)},lo=x,G=!lo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},uo=P,wr=Q,We=uo.document,fo=wr(We)&&wr(We.createElement),Pt=function(e){return fo?We.createElement(e):{}},vo=G,ho=x,po=Pt,_t=!vo&&!ho(function(){return Object.defineProperty(po("div"),"a",{get:function(){return 7}}).a!=7}),bo=G,yo=x,At=bo&&yo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),go=Q,mo=String,Oo=TypeError,H=function(e){if(go(e))return e;throw Oo(mo(e)+" is not an object")},wo=me,ae=Function.prototype.call,k=wo?ae.bind(ae):function(){return ae.apply(ae,arguments)},nr={},Te=nr,Ie=P,$o=_,$r=function(e){return $o(e)?e:void 0},jt=function(e,r){return arguments.length<2?$r(Te[e])||$r(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},Eo=D,Lt=Eo({}.isPrototypeOf),So=typeof navigator!="undefined"&&String(navigator.userAgent)||"",xt=P,Re=So,Er=xt.process,Sr=xt.Deno,Tr=Er&&Er.versions||Sr&&Sr.version,Ir=Tr&&Tr.v8,R,pe;Ir&&(R=Ir.split("."),pe=R[0]>0&&R[0]<4?1:+(R[0]+R[1]));!pe&&Re&&(R=Re.match(/Edge\/(\d+)/),(!R||R[1]>=74)&&(R=Re.match(/Chrome\/(\d+)/),R&&(pe=+R[1])));var To=pe,Rr=To,Io=x,Ro=P,Po=Ro.String,Mt=!!Object.getOwnPropertySymbols&&!Io(function(){var e=Symbol();return!Po(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rr&&Rr<41}),_o=Mt,Nt=_o&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ao=jt,jo=_,Lo=Lt,xo=Nt,Mo=Object,Ct=xo?function(e){return typeof e=="symbol"}:function(e){var r=Ao("Symbol");return jo(r)&&Lo(r.prototype,Mo(e))},No=String,or=function(e){try{return No(e)}catch(r){return"Object"}},Co=_,Fo=or,Do=TypeError,ar=function(e){if(Co(e))return e;throw Do(Fo(e)+" is not a function")},Go=ar,ko=tr,ir=function(e,r){var t=e[r];return ko(t)?void 0:Go(t)},Pe=k,_e=_,Ae=Q,Uo=TypeError,Vo=function(e,r){var t,n;if(r==="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e))||_e(t=e.valueOf)&&!Ae(n=Pe(t,e))||r!=="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e)))return n;throw Uo("Can't convert object to primitive value")},Ft={exports:{}},Pr=P,Bo=Object.defineProperty,qo=function(e,r){try{Bo(Pr,e,{value:r,configurable:!0,writable:!0})}catch(t){Pr[e]=r}return r},Ko=P,Yo=qo,_r="__core-js_shared__",Wo=Ko[_r]||Yo(_r,{}),Dt=Wo,Ar=Dt;(Ft.exports=function(e,r){return Ar[e]||(Ar[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Gt=Ft.exports,Qo=St,zo=Object,kt=function(e){return zo(Qo(e))},Ho=D,Xo=kt,Jo=Ho({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return Jo(Xo(r),t)},Zo=D,ea=0,ra=Math.random(),ta=Zo(1 .toString),Ut=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ta(++ea+ra,36)},na=P,oa=Gt,jr=N,aa=Ut,ia=Mt,sa=Nt,q=na.Symbol,je=oa("wks"),ca=sa?q.for||q:q&&q.withoutSetter||aa,M=function(e){return jr(je,e)||(je[e]=ia&&jr(q,e)?q[e]:ca("Symbol."+e)),je[e]},la=k,Lr=Q,xr=Ct,ua=ir,fa=Vo,va=M,da=TypeError,ha=va("toPrimitive"),pa=function(e,r){if(!Lr(e)||xr(e))return e;var t=ua(e,ha),n;if(t){if(r===void 0&&(r="default"),n=la(t,e,r),!Lr(n)||xr(n))return n;throw da("Can't convert object to primitive value")}return r===void 0&&(r="number"),fa(e,r)},ba=pa,ya=Ct,sr=function(e){var r=ba(e,"string");return ya(r)?r:r+""},ga=G,ma=_t,Oa=At,ie=H,Mr=sr,wa=TypeError,Le=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,xe="enumerable",Me="configurable",Ne="writable";z.f=ga?Oa?function(r,t,n){if(ie(r),t=Mr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=$a(r,t);o&&o[Ne]&&(r[t]=n.value,n={configurable:Me in n?n[Me]:o[Me],enumerable:xe in n?n[xe]:o[xe],writable:!1})}return Le(r,t,n)}:Le:function(r,t,n){if(ie(r),t=Mr(t),ie(n),ma)try{return Le(r,t,n)}catch(o){}if("get"in n||"set"in n)throw wa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var Oe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ea=G,Sa=z,Ta=Oe,ee=Ea?function(e,r,t){return Sa.f(e,r,Ta(1,t))}:function(e,r,t){return e[r]=t,e},Ia=Gt,Ra=Ut,Nr=Ia("keys"),cr=function(e){return Nr[e]||(Nr[e]=Ra(e))},lr={},Pa=so,Vt=P,_a=Q,Aa=ee,Ce=N,Fe=Dt,ja=cr,La=lr,Cr="Object already initialized",Qe=Vt.TypeError,xa=Vt.WeakMap,be,J,ye,Ma=function(e){return ye(e)?J(e):be(e,{})},Na=function(e){return function(r){var t;if(!_a(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(Pa||Fe.state){var A=Fe.state||(Fe.state=new xa);A.get=A.get,A.has=A.has,A.set=A.set,be=function(e,r){if(A.has(e))throw Qe(Cr);return r.facade=e,A.set(e,r),r},J=function(e){return A.get(e)||{}},ye=function(e){return A.has(e)}}else{var U=ja("state");La[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Cr);return r.facade=e,Aa(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Ca={set:be,get:J,has:ye,enforce:Ma,getterFor:Na},Fa=me,Bt=Function.prototype,Fr=Bt.apply,Dr=Bt.call,Da=typeof Reflect=="object"&&Reflect.apply||(Fa?Dr.bind(Fr):function(){return Dr.apply(Fr,arguments)}),Ga=rr,ka=D,qt=function(e){if(Ga(e)==="Function")return ka(e)},Kt={},Yt={},Wt={}.propertyIsEnumerable,Qt=Object.getOwnPropertyDescriptor,Ua=Qt&&!Wt.call({1:2},1);Yt.f=Ua?function(r){var t=Qt(this,r);return!!t&&t.enumerable}:Wt;var Va=G,Ba=k,qa=Yt,Ka=Oe,Ya=Z,Wa=sr,Qa=N,za=_t,Gr=Object.getOwnPropertyDescriptor;Kt.f=Va?Gr:function(r,t){if(r=Ya(r),t=Wa(t),za)try{return Gr(r,t)}catch(n){}if(Qa(r,t))return Ka(!Ba(qa.f,r,t),r[t])};var Ha=x,Xa=_,Ja=/#|\.prototype\./,re=function(e,r){var t=ei[Za(e)];return t==ti?!0:t==ri?!1:Xa(r)?Ha(r):!!r},Za=re.normalize=function(e){return String(e).replace(Ja,".").toLowerCase()},ei=re.data={},ri=re.NATIVE="N",ti=re.POLYFILL="P",ni=re,kr=qt,oi=ar,ai=me,ii=kr(kr.bind),zt=function(e,r){return oi(e),r===void 0?e:ai?ii(e,r):function(){return e.apply(r,arguments)}},se=P,si=Da,ci=qt,li=_,ui=Kt.f,fi=ni,V=nr,vi=zt,B=ee,Ur=N,di=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return si(e,this,arguments)};return r.prototype=e.prototype,r},Ht=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?se:o?se[t]:(se[t]||{}).prototype,s=n?V:V[t]||B(V,t,{})[t],l=s.prototype,c,u,v,f,d,b,y,O,g;for(f in r)c=fi(n?f:t+(o?".":"#")+f,e.forced),u=!c&&i&&Ur(i,f),b=s[f],u&&(e.dontCallGetSet?(g=ui(i,f),y=g&&g.value):y=i[f]),d=u&&y?y:r[f],!(u&&typeof b==typeof d)&&(e.bind&&u?O=vi(d,se):e.wrap&&u?O=di(d):a&&li(d)?O=ci(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&B(O,"sham",!0),B(s,f,O),a&&(v=t+"Prototype",Ur(V,v)||B(V,v,{}),B(V[v],f,d),e.real&&l&&(c||!l[f])&&B(l,f,d)))},ze=G,hi=N,Xt=Function.prototype,pi=ze&&Object.getOwnPropertyDescriptor,ur=hi(Xt,"name"),bi=ur&&function(){}.name==="something",yi=ur&&(!ze||ze&&pi(Xt,"name").configurable),gi={EXISTS:ur,PROPER:bi,CONFIGURABLE:yi},Jt={},mi=Math.ceil,Oi=Math.floor,wi=Math.trunc||function(r){var t=+r;return(t>0?Oi:mi)(t)},$i=wi,Zt=function(e){var r=+e;return r!==r||r===0?0:$i(r)},Ei=Zt,Si=Math.max,Ti=Math.min,Ii=function(e,r){var t=Ei(e);return t<0?Si(t+r,0):Ti(t,r)},Ri=Zt,Pi=Math.min,_i=function(e){return e>0?Pi(Ri(e),9007199254740991):0},Ai=_i,en=function(e){return Ai(e.length)},ji=Z,Li=Ii,xi=en,Vr=function(e){return function(r,t,n){var o=ji(r),a=xi(o),i=Li(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Mi={includes:Vr(!0),indexOf:Vr(!1)},Ni=D,De=N,Ci=Z,Fi=Mi.indexOf,Di=lr,Br=Ni([].push),Gi=function(e,r){var t=Ci(e),n=0,o=[],a;for(a in t)!De(Di,a)&&De(t,a)&&Br(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Fi(o,a)||Br(o,a));return o},rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ki=Gi,Ui=rn,Vi=Object.keys||function(r){return ki(r,Ui)},Bi=G,qi=At,Ki=z,Yi=H,Wi=Z,Qi=Vi;Jt.f=Bi&&!qi?Object.defineProperties:function(r,t){Yi(r);for(var n=Wi(t),o=Qi(t),a=o.length,i=0,s;a>i;)Ki.f(r,s=o[i++],n[s]);return r};var zi=jt,Hi=zi("document","documentElement"),Xi=H,Ji=Jt,qr=rn,Zi=lr,es=Hi,rs=Pt,ts=cr,Kr=">",Yr="<",He="prototype",Xe="script",tn=ts("IE_PROTO"),Ge=function(){},nn=function(e){return Yr+Xe+Kr+e+Yr+"/"+Xe+Kr},Wr=function(e){e.write(nn("")),e.close();var r=e.parentWindow.Object;return e=null,r},ns=function(){var e=rs("iframe"),r="java"+Xe+":",t;return e.style.display="none",es.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(nn("document.F=Object")),t.close(),t.F},ce,ve=function(){try{ce=new ActiveXObject("htmlfile")}catch(r){}ve=typeof document!="undefined"?document.domain&&ce?Wr(ce):ns():Wr(ce);for(var e=qr.length;e--;)delete ve[He][qr[e]];return ve()};Zi[tn]=!0;var on=Object.create||function(r,t){var n;return r!==null?(Ge[He]=Xi(r),n=new Ge,Ge[He]=null,n[tn]=r):n=ve(),t===void 0?n:Ji.f(n,t)},os=x,as=!os(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),is=N,ss=_,cs=kt,ls=cr,us=as,Qr=ls("IE_PROTO"),Je=Object,fs=Je.prototype,an=us?Je.getPrototypeOf:function(e){var r=cs(e);if(is(r,Qr))return r[Qr];var t=r.constructor;return ss(t)&&r instanceof t?t.prototype:r instanceof Je?fs:null},vs=ee,sn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:vs(e,r,t),e},ds=x,hs=_,ps=Q,bs=on,zr=an,ys=sn,gs=M,Ze=gs("iterator"),cn=!1,L,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=zr(zr(Ue)),ke!==Object.prototype&&(L=ke)):cn=!0);var ms=!ps(L)||ds(function(){var e={};return L[Ze].call(e)!==e});ms?L={}:L=bs(L);hs(L[Ze])||ys(L,Ze,function(){return this});var ln={IteratorPrototype:L,BUGGY_SAFARI_ITERATORS:cn},Os=M,ws=Os("toStringTag"),un={};un[ws]="z";var fr=String(un)==="[object z]",$s=fr,Es=_,de=rr,Ss=M,Ts=Ss("toStringTag"),Is=Object,Rs=de(function(){return arguments}())=="Arguments",Ps=function(e,r){try{return e[r]}catch(t){}},vr=$s?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Ps(r=Is(e),Ts))=="string"?t:Rs?de(r):(n=de(r))=="Object"&&Es(r.callee)?"Arguments":n},_s=fr,As=vr,js=_s?{}.toString:function(){return"[object "+As(this)+"]"},Ls=fr,xs=z.f,Ms=ee,Ns=N,Cs=js,Fs=M,Hr=Fs("toStringTag"),fn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Ns(o,Hr)||xs(o,Hr,{configurable:!0,value:r}),n&&!Ls&&Ms(o,"toString",Cs)}},Ds=ln.IteratorPrototype,Gs=on,ks=Oe,Us=fn,Vs=W,Bs=function(){return this},qs=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Gs(Ds,{next:ks(+!n,t)}),Us(e,o,!1,!0),Vs[o]=Bs,e},Ks=Ht,Ys=k,vn=gi,Ws=qs,Qs=an,zs=fn,Xr=sn,Hs=M,Jr=W,dn=ln,Xs=vn.PROPER;vn.CONFIGURABLE;dn.IteratorPrototype;var le=dn.BUGGY_SAFARI_ITERATORS,Ve=Hs("iterator"),Zr="keys",ue="values",et="entries",Js=function(){return this},Zs=function(e,r,t,n,o,a,i){Ws(t,r,n);var s=function(g){if(g===o&&f)return f;if(!le&&g in u)return u[g];switch(g){case Zr:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case et:return function(){return new t(this,g)}}return function(){return new t(this)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[Ve]||u["@@iterator"]||o&&u[o],f=!le&&v||s(o),d=r=="Array"&&u.entries||v,b,y,O;if(d&&(b=Qs(d.call(new e)),b!==Object.prototype&&b.next&&(zs(b,l,!0,!0),Jr[l]=Js)),Xs&&o==ue&&v&&v.name!==ue&&(c=!0,f=function(){return Ys(v,this)}),o)if(y={values:s(ue),keys:a?f:s(Zr),entries:s(et)},i)for(O in y)(le||c||!(O in u))&&Xr(u,O,y[O]);else Ks({target:r,proto:!0,forced:le||c},y);return i&&u[Ve]!==f&&Xr(u,Ve,f,{name:o}),Jr[r]=f,y},ec=function(e,r){return{value:e,done:r}},rc=Z,rt=W,hn=Ca;z.f;var tc=Zs,fe=ec,pn="Array Iterator",nc=hn.set,oc=hn.getterFor(pn);tc(Array,"Array",function(e,r){nc(this,{type:pn,target:rc(e),index:0,kind:r})},function(){var e=oc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,fe(void 0,!0)):t=="keys"?fe(n,!1):t=="values"?fe(r[n],!1):fe([n,r[n]],!1)},"values");rt.Arguments=rt.Array;var ac=M,ic=W,sc=ac("iterator"),cc=Array.prototype,lc=function(e){return e!==void 0&&(ic.Array===e||cc[sc]===e)},uc=vr,tt=ir,fc=tr,vc=W,dc=M,hc=dc("iterator"),bn=function(e){if(!fc(e))return tt(e,hc)||tt(e,"@@iterator")||vc[uc(e)]},pc=k,bc=ar,yc=H,gc=or,mc=bn,Oc=TypeError,wc=function(e,r){var t=arguments.length<2?mc(e):r;if(bc(t))return yc(pc(t,e));throw Oc(gc(e)+" is not iterable")},$c=k,nt=H,Ec=ir,Sc=function(e,r,t){var n,o;nt(e);try{if(n=Ec(e,"return"),!n){if(r==="throw")throw t;return t}n=$c(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return nt(n),t},Tc=zt,Ic=k,Rc=H,Pc=or,_c=lc,Ac=en,ot=Lt,jc=wc,Lc=bn,at=Sc,xc=TypeError,he=function(e,r){this.stopped=e,this.result=r},it=he.prototype,Mc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),l=Tc(r,n),c,u,v,f,d,b,y,O=function(m){return c&&at(c,"normal",m),new he(!0,m)},g=function(m){return o?(Rc(m),s?l(m[0],m[1],O):l(m[0],m[1])):s?l(m,O):l(m)};if(a)c=e.iterator;else if(i)c=e;else{if(u=Lc(e),!u)throw xc(Pc(e)+" is not iterable");if(_c(u)){for(v=0,f=Ac(e);f>v;v++)if(d=g(e[v]),d&&ot(it,d))return d;return new he(!1)}c=jc(e,u)}for(b=a?e.next:c.next;!(y=Ic(b,c)).done;){try{d=g(y.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&ot(it,d))return d}return new he(!1)},Nc=sr,Cc=z,Fc=Oe,Dc=function(e,r,t){var n=Nc(r);n in e?Cc.f(e,n,Fc(0,t)):e[n]=t},Gc=Ht,kc=Mc,Uc=Dc;Gc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return kc(r,function(n,o){Uc(t,n,o)},{AS_ENTRIES:!0}),t}});var Vc=nr,Bc=Vc.Object.fromEntries,qc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Kc=qc,Yc=P,Wc=vr,Qc=ee,st=W,zc=M,ct=zc("toStringTag");for(var Be in Kc){var lt=Yc[Be],qe=lt&<.prototype;qe&&Wc(qe)!==ct&&Qc(qe,ct,Be),st[Be]=st.Array}var Hc=Bc,Xc=Hc,Jc=Xc,Zc=Jc,el=Bn(Zc),ut;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(ut||(ut={}));const rl="vk.com",zl=async(e,r,t)=>{const n=new URL(`https://${rl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Vn(n.toString())).json();return tl(a,t)},tl=(e,r)=>el(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),nl(n)])),nl=e=>Array.isArray(e)?e[0]:e;var ft;(function(e){e.RU="ru",e.EN="en"})(ft||(ft={}));export{j as CurrentClientBrowser,w as CurrentClientDevice,yr as ErrorCategory,ft as InterfaceLanguage,il as Logger,E as Observable,vt as Subject,ge as Subscription,ol as VERSION,ut as VKNumericLanguage,Ll as ValueSubject,S as VideoQuality,dl as abortable,fl as addScript,Rl as areQualitiesExact,ul as assertEmptyArray,K as assertNever,sl as assertNonNullable,ll as assertNotEmptyArray,cl as assertNullable,Pl as assertQualityIsExact,Gl as buffer,al as checkNever,jl as cloneDeep,yt as cloneDeepWith,xl as combine,kl as debounce,Al as debounceFn,ml as detectEmbed,Pn as fillWithDefault,Vl as filter,Bl as filterChanged,Dl as fromEvent,dt as getCurrentBrowser,yl as getExponentialDelay,El as getHighestQuality,pl as getIOSVersion,Cl as interval,Ol as isHigher,wl as isHigherOrEqual,hl as isIOS,bt as isInvariantQuality,ht as isLower,$l as isLowerOrEqual,bl as isMacLike,On as isNonNullable,wn as isNullable,zl as loadVKLangPack,Cn as map,Kl as mapTo,Ml as merge,X as noop,vl as now,Fl as observableFrom,Yl as once,Wl as pairwise,gl as safeStorage,Ql as tap,Ul as throttle,_l as timeCodeToString,Nl as timeout,Sl as videoHeightToQuality,Il as videoQualityToHeight,Tl as videoSizeToQuality};
|
|
6
|
+
const ol="1.0.32";class ge{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const K=e=>{throw new Error(`${e} is value of unexpected type`)},al=e=>{},X=()=>{};class E{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:X}:o={next:s=>t.next(s),error:s=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,s)}}:o={next:X,error:X};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(l){o.next(l)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new ge().add(()=>{switch(a.next=X,a.error=X,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return K(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class vt extends E{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new ge().add(()=>this.subscribers.delete(t))}}class il{constructor(){this.log$=new vt,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function sl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function cl(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function On(e){return typeof e!="undefined"&&e!==null}function wn(e){return e==null}function ll(e,r){if(!(e!=null&&e.length))throw new Error(r)}function ul(e,r){if(e!=null&&e.length)throw new Error(r)}const fl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{l&&clearTimeout(l),c.removeEventListener("load",i),c.removeEventListener("error",a)};let l;t&&(l=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var we;const vl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now(),dl=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){await o.throw(s)}return i};var j;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(j||(j={}));var w;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(w||(w={}));const dt=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?j.Yandex:void 0,t=/chrome|crios/i.test(e)?j.Chrome:void 0,n=/chromium/i.test(e)?j.Chromium:void 0,o=/firefox|fxios/i.test(e)?j.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?j.Safari:void 0,i=/opr\//i.test(e)?j.Opera:void 0,s=/edg/i.test(e)?j.Edge:void 0,l=/android/i.test(e)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,u=/ipad/i.test(e)?w.iPad:void 0,v=/ipod/i.test(e)?w.iPod:void 0,f=/mac/i.test(e)?w.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:l||c||u||v||d||f||w.Desktop}},hl=(e=!1)=>{const t=[w.iPhone,w.iPad,w.iPod].includes(dt().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},pl=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},bl=()=>[w.Mac,w.iPhone,w.iPad,w.iPod].includes(dt().device),yl=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let $,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&($=new Map),F},$n=()=>Y()===p.LOCAL_STORAGE,En=e=>{var r,t;const n=Y();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return $==null?void 0:$.get(e);default:K(n)}},Sn=(e,r)=>{const t=Y();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void($==null?void 0:$.set(e,r));default:K(t)}},Tn=e=>{var r;const t=Y();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=$==null?void 0:$.has(e))!==null&&r!==void 0?r:!1;default:return K(t),!1}},In=e=>{const r=Y();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void($==null?void 0:$.delete(e));default:K(r)}},Rn=()=>{const e=Y();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return $==null?void 0:$.clear();default:K(e)}};var gl=Object.freeze({__proto__:null,clear:Rn,get:En,has:Tn,isPersistent:$n,remove:In,set:Sn});const ml=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var S;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(S||(S={}));const T={[S.Q_144P]:{width:256,height:144},[S.Q_240P]:{width:428,height:240},[S.Q_360P]:{width:640,height:360},[S.Q_480P]:{width:856,height:480},[S.Q_720P]:{width:1280,height:720},[S.Q_1080P]:{width:1920,height:1080},[S.Q_1440P]:{width:2560,height:1440},[S.Q_2160P]:{width:3840,height:2160},[S.Q_4320P]:{width:7680,height:4320}},Ol=(e,r)=>T[e].height>T[r].height,wl=(e,r)=>T[e].height>=T[r].height,ht=(e,r)=>T[e].height<T[r].height,$l=(e,r)=>T[e].height<=T[r].height,El=e=>e.sort((r,t)=>r===t?0:r===S.INVARIANT?1:t===S.INVARIANT?-1:ht(r,t)?1:-1)[0],pt=Object.keys(T).sort((e,r)=>ht(e,r)?-1:1),Sl=(e,r=.02)=>[...pt].find(n=>T[n].height*(1+r)>=e),Tl=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return pt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Il=e=>T[e].height,bt=e=>e===S.INVARIANT,Rl=e=>e.every(r=>!bt(r));function Pl(e){if(bt(e))throw new Error("Expected exact quality")}const Pn=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=Pn(a,o):t[n]=n in e?a:o}return t},_l=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function Al(e,r=0,t){let n,o,a,i,s,l,c=0,u=!1,v=!1,f=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(u=!!t.leading,v="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function b(h){const I=n,C=o;return n=o=void 0,c=h,i=e.apply(C,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=y(te,r),u?b(h):i}function m(h){const I=h-l,C=h-c,pr=r-I;return v?Math.min(pr,a-C):pr}function dr(h){const I=h-l,C=h-c;return l===void 0||I>=r||I<0||v&&C>=a}function te(){const h=Date.now();if(dr(h))return hr(h);s=y(te,m(h))}function hr(h){return s=void 0,f&&n?b(h):(n=o=void 0,i)}function yn(){s!==void 0&&O(s),c=0,n=l=o=s=void 0}function gn(){return s===void 0?i:hr(Date.now())}function mn(){return s!==void 0}function ne(...h){const I=Date.now(),C=dr(I);if(n=h,o=this,l=I,C){if(s===void 0)return g(l);if(v)return s=y(te,r),b(l)}return s===void 0&&(s=y(te,r)),i}return ne.cancel=yn,ne.flush=gn,ne.pending=mn,ne}const yt=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=yt(e[n],r):t[n]=e[n]}return t},jl=e=>yt(e);class Ll extends vt{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function xl(e){return new E(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new ge)})}function Ml(...e){return new E(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Nl=e=>new E(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Cl=e=>new E(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Fl=e=>new E(r=>{e.forEach(t=>r.next(t))}),Dl=(e,r)=>new E(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Gl(e){return r=>new E(t=>r.subscribe(new _n(t,e)))}class _n{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const An={leading:!1,trailing:!0};function kl(e,r=An){return t=>new E(n=>t.subscribe(new jn(n,e,r)))}class jn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,On(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Ln={leading:!0,trailing:!1};function Ul(e,r=Ln){return t=>new E(n=>t.subscribe(new xn(n,e,r)))}class xn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,wn(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Vl(e){return r=>new E(t=>r.subscribe(new Mn(t,e)))}class Mn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Bl(e=(r,t)=>r===t){return r=>new E(t=>r.subscribe(new Nn(t,e)))}const br={};class Nn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=br}next(r){let t;try{t=this.lastValue===br||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Cn(e){return r=>new E(t=>r.subscribe(new Fn(t,e)))}let Fn=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Kl(e){return Cn(()=>e)}function Yl(){return e=>new E(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Wl(){return e=>new E(r=>e.subscribe(new Dn(r)))}class Dn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Ql(e){return r=>new E(t=>r.subscribe(new Gn(t,e)))}class Gn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var yr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(yr||(yr={}));class gr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class gt extends gr{constructor(){super(),this.listeners||gr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class kn{constructor(){Object.defineProperty(this,"signal",{value:new gt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(kn.prototype[Symbol.toStringTag]="AbortController",gt.prototype[Symbol.toStringTag]="AbortSignal");function mt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Un(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!mt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,u){let v;u&&u.signal&&(v=u.signal,delete u.signal);const f=new t(c,u);return v&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),f},a.prototype=t.prototype);const i=r;return{fetch:(l,c)=>{const u=a&&a.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(u){let v;try{v=new DOMException("Aborted","AbortError")}catch(d){v=new Error("Aborted"),v.name="AbortError"}if(u.aborted)return Promise.reject(v);const f=new Promise((d,b)=>{u.addEventListener("abort",()=>b(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(l,c)])}return i(l,c)},Request:a}}const er=mt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Ot=er?Un({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Vn=er?Ot.fetch:window.fetch;er?Ot.Request:window.Request;var Ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x=function(e){try{return!!e()}catch(r){return!0}},qn=x,me=!qn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),wt=me,$t=Function.prototype,Ke=$t.call,Kn=wt&&$t.bind.bind(Ke,Ke),D=wt?Kn:function(e){return function(){return Ke.apply(e,arguments)}},Et=D,Yn=Et({}.toString),Wn=Et("".slice),rr=function(e){return Wn(Yn(e),8,-1)},Qn=D,zn=x,Hn=rr,Se=Object,Xn=Qn("".split),Jn=zn(function(){return!Se("z").propertyIsEnumerable(0)})?function(e){return Hn(e)=="String"?Xn(e,""):Se(e)}:Se,tr=function(e){return e==null},Zn=tr,eo=TypeError,St=function(e){if(Zn(e))throw eo("Can't call method on "+e);return e},ro=Jn,to=St,Z=function(e){return ro(to(e))},W={},oe=function(e){return e&&e.Math==Math&&e},P=oe(typeof globalThis=="object"&&globalThis)||oe(typeof window=="object"&&window)||oe(typeof self=="object"&&self)||oe(typeof Ee=="object"&&Ee)||function(){return this}()||Ee||Function("return this")(),Ye=typeof document=="object"&&document.all,no=typeof Ye=="undefined"&&Ye!==void 0,Tt={all:Ye,IS_HTMLDDA:no},It=Tt,oo=It.all,_=It.IS_HTMLDDA?function(e){return typeof e=="function"||e===oo}:function(e){return typeof e=="function"},ao=P,io=_,mr=ao.WeakMap,so=io(mr)&&/native code/.test(String(mr)),Or=_,Rt=Tt,co=Rt.all,Q=Rt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===co}:function(e){return typeof e=="object"?e!==null:Or(e)},lo=x,G=!lo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},uo=P,wr=Q,We=uo.document,fo=wr(We)&&wr(We.createElement),Pt=function(e){return fo?We.createElement(e):{}},vo=G,ho=x,po=Pt,_t=!vo&&!ho(function(){return Object.defineProperty(po("div"),"a",{get:function(){return 7}}).a!=7}),bo=G,yo=x,At=bo&&yo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),go=Q,mo=String,Oo=TypeError,H=function(e){if(go(e))return e;throw Oo(mo(e)+" is not an object")},wo=me,ae=Function.prototype.call,k=wo?ae.bind(ae):function(){return ae.apply(ae,arguments)},nr={},Te=nr,Ie=P,$o=_,$r=function(e){return $o(e)?e:void 0},jt=function(e,r){return arguments.length<2?$r(Te[e])||$r(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},Eo=D,Lt=Eo({}.isPrototypeOf),So=typeof navigator!="undefined"&&String(navigator.userAgent)||"",xt=P,Re=So,Er=xt.process,Sr=xt.Deno,Tr=Er&&Er.versions||Sr&&Sr.version,Ir=Tr&&Tr.v8,R,pe;Ir&&(R=Ir.split("."),pe=R[0]>0&&R[0]<4?1:+(R[0]+R[1]));!pe&&Re&&(R=Re.match(/Edge\/(\d+)/),(!R||R[1]>=74)&&(R=Re.match(/Chrome\/(\d+)/),R&&(pe=+R[1])));var To=pe,Rr=To,Io=x,Ro=P,Po=Ro.String,Mt=!!Object.getOwnPropertySymbols&&!Io(function(){var e=Symbol();return!Po(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rr&&Rr<41}),_o=Mt,Nt=_o&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ao=jt,jo=_,Lo=Lt,xo=Nt,Mo=Object,Ct=xo?function(e){return typeof e=="symbol"}:function(e){var r=Ao("Symbol");return jo(r)&&Lo(r.prototype,Mo(e))},No=String,or=function(e){try{return No(e)}catch(r){return"Object"}},Co=_,Fo=or,Do=TypeError,ar=function(e){if(Co(e))return e;throw Do(Fo(e)+" is not a function")},Go=ar,ko=tr,ir=function(e,r){var t=e[r];return ko(t)?void 0:Go(t)},Pe=k,_e=_,Ae=Q,Uo=TypeError,Vo=function(e,r){var t,n;if(r==="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e))||_e(t=e.valueOf)&&!Ae(n=Pe(t,e))||r!=="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e)))return n;throw Uo("Can't convert object to primitive value")},Ft={exports:{}},Pr=P,Bo=Object.defineProperty,qo=function(e,r){try{Bo(Pr,e,{value:r,configurable:!0,writable:!0})}catch(t){Pr[e]=r}return r},Ko=P,Yo=qo,_r="__core-js_shared__",Wo=Ko[_r]||Yo(_r,{}),Dt=Wo,Ar=Dt;(Ft.exports=function(e,r){return Ar[e]||(Ar[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Gt=Ft.exports,Qo=St,zo=Object,kt=function(e){return zo(Qo(e))},Ho=D,Xo=kt,Jo=Ho({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return Jo(Xo(r),t)},Zo=D,ea=0,ra=Math.random(),ta=Zo(1 .toString),Ut=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ta(++ea+ra,36)},na=P,oa=Gt,jr=N,aa=Ut,ia=Mt,sa=Nt,q=na.Symbol,je=oa("wks"),ca=sa?q.for||q:q&&q.withoutSetter||aa,M=function(e){return jr(je,e)||(je[e]=ia&&jr(q,e)?q[e]:ca("Symbol."+e)),je[e]},la=k,Lr=Q,xr=Ct,ua=ir,fa=Vo,va=M,da=TypeError,ha=va("toPrimitive"),pa=function(e,r){if(!Lr(e)||xr(e))return e;var t=ua(e,ha),n;if(t){if(r===void 0&&(r="default"),n=la(t,e,r),!Lr(n)||xr(n))return n;throw da("Can't convert object to primitive value")}return r===void 0&&(r="number"),fa(e,r)},ba=pa,ya=Ct,sr=function(e){var r=ba(e,"string");return ya(r)?r:r+""},ga=G,ma=_t,Oa=At,ie=H,Mr=sr,wa=TypeError,Le=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,xe="enumerable",Me="configurable",Ne="writable";z.f=ga?Oa?function(r,t,n){if(ie(r),t=Mr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=$a(r,t);o&&o[Ne]&&(r[t]=n.value,n={configurable:Me in n?n[Me]:o[Me],enumerable:xe in n?n[xe]:o[xe],writable:!1})}return Le(r,t,n)}:Le:function(r,t,n){if(ie(r),t=Mr(t),ie(n),ma)try{return Le(r,t,n)}catch(o){}if("get"in n||"set"in n)throw wa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var Oe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ea=G,Sa=z,Ta=Oe,ee=Ea?function(e,r,t){return Sa.f(e,r,Ta(1,t))}:function(e,r,t){return e[r]=t,e},Ia=Gt,Ra=Ut,Nr=Ia("keys"),cr=function(e){return Nr[e]||(Nr[e]=Ra(e))},lr={},Pa=so,Vt=P,_a=Q,Aa=ee,Ce=N,Fe=Dt,ja=cr,La=lr,Cr="Object already initialized",Qe=Vt.TypeError,xa=Vt.WeakMap,be,J,ye,Ma=function(e){return ye(e)?J(e):be(e,{})},Na=function(e){return function(r){var t;if(!_a(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(Pa||Fe.state){var A=Fe.state||(Fe.state=new xa);A.get=A.get,A.has=A.has,A.set=A.set,be=function(e,r){if(A.has(e))throw Qe(Cr);return r.facade=e,A.set(e,r),r},J=function(e){return A.get(e)||{}},ye=function(e){return A.has(e)}}else{var U=ja("state");La[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Cr);return r.facade=e,Aa(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Ca={set:be,get:J,has:ye,enforce:Ma,getterFor:Na},Fa=me,Bt=Function.prototype,Fr=Bt.apply,Dr=Bt.call,Da=typeof Reflect=="object"&&Reflect.apply||(Fa?Dr.bind(Fr):function(){return Dr.apply(Fr,arguments)}),Ga=rr,ka=D,qt=function(e){if(Ga(e)==="Function")return ka(e)},Kt={},Yt={},Wt={}.propertyIsEnumerable,Qt=Object.getOwnPropertyDescriptor,Ua=Qt&&!Wt.call({1:2},1);Yt.f=Ua?function(r){var t=Qt(this,r);return!!t&&t.enumerable}:Wt;var Va=G,Ba=k,qa=Yt,Ka=Oe,Ya=Z,Wa=sr,Qa=N,za=_t,Gr=Object.getOwnPropertyDescriptor;Kt.f=Va?Gr:function(r,t){if(r=Ya(r),t=Wa(t),za)try{return Gr(r,t)}catch(n){}if(Qa(r,t))return Ka(!Ba(qa.f,r,t),r[t])};var Ha=x,Xa=_,Ja=/#|\.prototype\./,re=function(e,r){var t=ei[Za(e)];return t==ti?!0:t==ri?!1:Xa(r)?Ha(r):!!r},Za=re.normalize=function(e){return String(e).replace(Ja,".").toLowerCase()},ei=re.data={},ri=re.NATIVE="N",ti=re.POLYFILL="P",ni=re,kr=qt,oi=ar,ai=me,ii=kr(kr.bind),zt=function(e,r){return oi(e),r===void 0?e:ai?ii(e,r):function(){return e.apply(r,arguments)}},se=P,si=Da,ci=qt,li=_,ui=Kt.f,fi=ni,V=nr,vi=zt,B=ee,Ur=N,di=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return si(e,this,arguments)};return r.prototype=e.prototype,r},Ht=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?se:o?se[t]:(se[t]||{}).prototype,s=n?V:V[t]||B(V,t,{})[t],l=s.prototype,c,u,v,f,d,b,y,O,g;for(f in r)c=fi(n?f:t+(o?".":"#")+f,e.forced),u=!c&&i&&Ur(i,f),b=s[f],u&&(e.dontCallGetSet?(g=ui(i,f),y=g&&g.value):y=i[f]),d=u&&y?y:r[f],!(u&&typeof b==typeof d)&&(e.bind&&u?O=vi(d,se):e.wrap&&u?O=di(d):a&&li(d)?O=ci(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&B(O,"sham",!0),B(s,f,O),a&&(v=t+"Prototype",Ur(V,v)||B(V,v,{}),B(V[v],f,d),e.real&&l&&(c||!l[f])&&B(l,f,d)))},ze=G,hi=N,Xt=Function.prototype,pi=ze&&Object.getOwnPropertyDescriptor,ur=hi(Xt,"name"),bi=ur&&function(){}.name==="something",yi=ur&&(!ze||ze&&pi(Xt,"name").configurable),gi={EXISTS:ur,PROPER:bi,CONFIGURABLE:yi},Jt={},mi=Math.ceil,Oi=Math.floor,wi=Math.trunc||function(r){var t=+r;return(t>0?Oi:mi)(t)},$i=wi,Zt=function(e){var r=+e;return r!==r||r===0?0:$i(r)},Ei=Zt,Si=Math.max,Ti=Math.min,Ii=function(e,r){var t=Ei(e);return t<0?Si(t+r,0):Ti(t,r)},Ri=Zt,Pi=Math.min,_i=function(e){return e>0?Pi(Ri(e),9007199254740991):0},Ai=_i,en=function(e){return Ai(e.length)},ji=Z,Li=Ii,xi=en,Vr=function(e){return function(r,t,n){var o=ji(r),a=xi(o),i=Li(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Mi={includes:Vr(!0),indexOf:Vr(!1)},Ni=D,De=N,Ci=Z,Fi=Mi.indexOf,Di=lr,Br=Ni([].push),Gi=function(e,r){var t=Ci(e),n=0,o=[],a;for(a in t)!De(Di,a)&&De(t,a)&&Br(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Fi(o,a)||Br(o,a));return o},rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ki=Gi,Ui=rn,Vi=Object.keys||function(r){return ki(r,Ui)},Bi=G,qi=At,Ki=z,Yi=H,Wi=Z,Qi=Vi;Jt.f=Bi&&!qi?Object.defineProperties:function(r,t){Yi(r);for(var n=Wi(t),o=Qi(t),a=o.length,i=0,s;a>i;)Ki.f(r,s=o[i++],n[s]);return r};var zi=jt,Hi=zi("document","documentElement"),Xi=H,Ji=Jt,qr=rn,Zi=lr,es=Hi,rs=Pt,ts=cr,Kr=">",Yr="<",He="prototype",Xe="script",tn=ts("IE_PROTO"),Ge=function(){},nn=function(e){return Yr+Xe+Kr+e+Yr+"/"+Xe+Kr},Wr=function(e){e.write(nn("")),e.close();var r=e.parentWindow.Object;return e=null,r},ns=function(){var e=rs("iframe"),r="java"+Xe+":",t;return e.style.display="none",es.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(nn("document.F=Object")),t.close(),t.F},ce,ve=function(){try{ce=new ActiveXObject("htmlfile")}catch(r){}ve=typeof document!="undefined"?document.domain&&ce?Wr(ce):ns():Wr(ce);for(var e=qr.length;e--;)delete ve[He][qr[e]];return ve()};Zi[tn]=!0;var on=Object.create||function(r,t){var n;return r!==null?(Ge[He]=Xi(r),n=new Ge,Ge[He]=null,n[tn]=r):n=ve(),t===void 0?n:Ji.f(n,t)},os=x,as=!os(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),is=N,ss=_,cs=kt,ls=cr,us=as,Qr=ls("IE_PROTO"),Je=Object,fs=Je.prototype,an=us?Je.getPrototypeOf:function(e){var r=cs(e);if(is(r,Qr))return r[Qr];var t=r.constructor;return ss(t)&&r instanceof t?t.prototype:r instanceof Je?fs:null},vs=ee,sn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:vs(e,r,t),e},ds=x,hs=_,ps=Q,bs=on,zr=an,ys=sn,gs=M,Ze=gs("iterator"),cn=!1,L,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=zr(zr(Ue)),ke!==Object.prototype&&(L=ke)):cn=!0);var ms=!ps(L)||ds(function(){var e={};return L[Ze].call(e)!==e});ms?L={}:L=bs(L);hs(L[Ze])||ys(L,Ze,function(){return this});var ln={IteratorPrototype:L,BUGGY_SAFARI_ITERATORS:cn},Os=M,ws=Os("toStringTag"),un={};un[ws]="z";var fr=String(un)==="[object z]",$s=fr,Es=_,de=rr,Ss=M,Ts=Ss("toStringTag"),Is=Object,Rs=de(function(){return arguments}())=="Arguments",Ps=function(e,r){try{return e[r]}catch(t){}},vr=$s?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Ps(r=Is(e),Ts))=="string"?t:Rs?de(r):(n=de(r))=="Object"&&Es(r.callee)?"Arguments":n},_s=fr,As=vr,js=_s?{}.toString:function(){return"[object "+As(this)+"]"},Ls=fr,xs=z.f,Ms=ee,Ns=N,Cs=js,Fs=M,Hr=Fs("toStringTag"),fn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Ns(o,Hr)||xs(o,Hr,{configurable:!0,value:r}),n&&!Ls&&Ms(o,"toString",Cs)}},Ds=ln.IteratorPrototype,Gs=on,ks=Oe,Us=fn,Vs=W,Bs=function(){return this},qs=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Gs(Ds,{next:ks(+!n,t)}),Us(e,o,!1,!0),Vs[o]=Bs,e},Ks=Ht,Ys=k,vn=gi,Ws=qs,Qs=an,zs=fn,Xr=sn,Hs=M,Jr=W,dn=ln,Xs=vn.PROPER;vn.CONFIGURABLE;dn.IteratorPrototype;var le=dn.BUGGY_SAFARI_ITERATORS,Ve=Hs("iterator"),Zr="keys",ue="values",et="entries",Js=function(){return this},Zs=function(e,r,t,n,o,a,i){Ws(t,r,n);var s=function(g){if(g===o&&f)return f;if(!le&&g in u)return u[g];switch(g){case Zr:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case et:return function(){return new t(this,g)}}return function(){return new t(this)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[Ve]||u["@@iterator"]||o&&u[o],f=!le&&v||s(o),d=r=="Array"&&u.entries||v,b,y,O;if(d&&(b=Qs(d.call(new e)),b!==Object.prototype&&b.next&&(zs(b,l,!0,!0),Jr[l]=Js)),Xs&&o==ue&&v&&v.name!==ue&&(c=!0,f=function(){return Ys(v,this)}),o)if(y={values:s(ue),keys:a?f:s(Zr),entries:s(et)},i)for(O in y)(le||c||!(O in u))&&Xr(u,O,y[O]);else Ks({target:r,proto:!0,forced:le||c},y);return i&&u[Ve]!==f&&Xr(u,Ve,f,{name:o}),Jr[r]=f,y},ec=function(e,r){return{value:e,done:r}},rc=Z,rt=W,hn=Ca;z.f;var tc=Zs,fe=ec,pn="Array Iterator",nc=hn.set,oc=hn.getterFor(pn);tc(Array,"Array",function(e,r){nc(this,{type:pn,target:rc(e),index:0,kind:r})},function(){var e=oc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,fe(void 0,!0)):t=="keys"?fe(n,!1):t=="values"?fe(r[n],!1):fe([n,r[n]],!1)},"values");rt.Arguments=rt.Array;var ac=M,ic=W,sc=ac("iterator"),cc=Array.prototype,lc=function(e){return e!==void 0&&(ic.Array===e||cc[sc]===e)},uc=vr,tt=ir,fc=tr,vc=W,dc=M,hc=dc("iterator"),bn=function(e){if(!fc(e))return tt(e,hc)||tt(e,"@@iterator")||vc[uc(e)]},pc=k,bc=ar,yc=H,gc=or,mc=bn,Oc=TypeError,wc=function(e,r){var t=arguments.length<2?mc(e):r;if(bc(t))return yc(pc(t,e));throw Oc(gc(e)+" is not iterable")},$c=k,nt=H,Ec=ir,Sc=function(e,r,t){var n,o;nt(e);try{if(n=Ec(e,"return"),!n){if(r==="throw")throw t;return t}n=$c(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return nt(n),t},Tc=zt,Ic=k,Rc=H,Pc=or,_c=lc,Ac=en,ot=Lt,jc=wc,Lc=bn,at=Sc,xc=TypeError,he=function(e,r){this.stopped=e,this.result=r},it=he.prototype,Mc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),l=Tc(r,n),c,u,v,f,d,b,y,O=function(m){return c&&at(c,"normal",m),new he(!0,m)},g=function(m){return o?(Rc(m),s?l(m[0],m[1],O):l(m[0],m[1])):s?l(m,O):l(m)};if(a)c=e.iterator;else if(i)c=e;else{if(u=Lc(e),!u)throw xc(Pc(e)+" is not iterable");if(_c(u)){for(v=0,f=Ac(e);f>v;v++)if(d=g(e[v]),d&&ot(it,d))return d;return new he(!1)}c=jc(e,u)}for(b=a?e.next:c.next;!(y=Ic(b,c)).done;){try{d=g(y.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&ot(it,d))return d}return new he(!1)},Nc=sr,Cc=z,Fc=Oe,Dc=function(e,r,t){var n=Nc(r);n in e?Cc.f(e,n,Fc(0,t)):e[n]=t},Gc=Ht,kc=Mc,Uc=Dc;Gc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return kc(r,function(n,o){Uc(t,n,o)},{AS_ENTRIES:!0}),t}});var Vc=nr,Bc=Vc.Object.fromEntries,qc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Kc=qc,Yc=P,Wc=vr,Qc=ee,st=W,zc=M,ct=zc("toStringTag");for(var Be in Kc){var lt=Yc[Be],qe=lt&<.prototype;qe&&Wc(qe)!==ct&&Qc(qe,ct,Be),st[Be]=st.Array}var Hc=Bc,Xc=Hc,Jc=Xc,Zc=Jc,el=Bn(Zc),ut;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(ut||(ut={}));const rl="vk.com",zl=async(e,r,t)=>{const n=new URL(`https://${rl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Vn(n.toString())).json();return tl(a,t)},tl=(e,r)=>el(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),nl(n)])),nl=e=>Array.isArray(e)?e[0]:e;var ft;(function(e){e.RU="ru",e.EN="en"})(ft||(ft={}));export{j as CurrentClientBrowser,w as CurrentClientDevice,yr as ErrorCategory,ft as InterfaceLanguage,il as Logger,E as Observable,vt as Subject,ge as Subscription,ol as VERSION,ut as VKNumericLanguage,Ll as ValueSubject,S as VideoQuality,dl as abortable,fl as addScript,Rl as areQualitiesExact,ul as assertEmptyArray,K as assertNever,sl as assertNonNullable,ll as assertNotEmptyArray,cl as assertNullable,Pl as assertQualityIsExact,Gl as buffer,al as checkNever,jl as cloneDeep,yt as cloneDeepWith,xl as combine,kl as debounce,Al as debounceFn,ml as detectEmbed,Pn as fillWithDefault,Vl as filter,Bl as filterChanged,Dl as fromEvent,dt as getCurrentBrowser,yl as getExponentialDelay,El as getHighestQuality,pl as getIOSVersion,Cl as interval,Ol as isHigher,wl as isHigherOrEqual,hl as isIOS,bt as isInvariantQuality,ht as isLower,$l as isLowerOrEqual,bl as isMacLike,On as isNonNullable,wn as isNullable,zl as loadVKLangPack,Cn as map,Kl as mapTo,Ml as merge,X as noop,vl as now,Fl as observableFrom,Yl as once,Wl as pairwise,gl as safeStorage,Ql as tap,Ul as throttle,_l as timeCodeToString,Nl as timeout,Sl as videoHeightToQuality,Il as videoQualityToHeight,Tl as videoSizeToQuality};
|
package/esnext.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const ne="1.0.32-dev.935ac7b0.0";class C{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const y=e=>{throw new Error(`${e} is value of unexpected type`)},re=e=>{},S=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:S}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:S,error:S};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new C().add(()=>{switch(s.next=S,s.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return y(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class I extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new C().add(()=>this.subscribers.delete(n))}}class ie{log$=new I;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function se(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function oe(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function U(e){return typeof e<"u"&&e!==null}function G(e){return e==null}function ae(e,t){if(!e?.length)throw new Error(t)}function ce(e,t){if(e?.length)throw new Error(t)}const le=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{d&&clearTimeout(d),c.removeEventListener("load",o),c.removeEventListener("error",i)};let d;n&&(d=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),ue=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),de=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const P=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,n=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,r=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,a=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,d=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,b=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,h=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,g=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||exports.CurrentClientBrowser.Rest,device:d||c||b||h||v||g||exports.CurrentClientDevice.Desktop}},fe=(e=!1)=>{const n=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(P().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},he=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},be=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(P().device),we=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let O,E;const _=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(E!==void 0)return E;try{localStorage.setItem(_,"test"),localStorage.removeItem(_),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(_),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(O=new Map),E},me=()=>A()===u.LOCAL_STORAGE,ge=e=>{const t=A();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return O?.get(e);default:y(t)}},pe=(e,t)=>{const n=A();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.RUNTIME:return void O?.set(e,t);default:y(n)}},Ee=e=>{const t=A();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return O?.has(e)??!1;default:return y(t),!1}},ye=e=>{const t=A();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void O?.delete(e);default:y(t)}},ve=()=>{const e=A();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return O?.clear();default:y(e)}};var Se=Object.freeze({__proto__:null,clear:ve,get:ge,has:Ee,isPersistent:me,remove:ye,set:pe});const Oe=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const w={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Ae=(e,t)=>w[e].height>w[t].height,xe=(e,t)=>w[e].height>=w[t].height,N=(e,t)=>w[e].height<w[t].height,Ce=(e,t)=>w[e].height<=w[t].height,Le=e=>e.sort((t,n)=>t===n?0:t===exports.VideoQuality.INVARIANT?1:n===exports.VideoQuality.INVARIANT?-1:N(t,n)?1:-1)[0],B=Object.keys(w).sort((e,t)=>N(e,t)?-1:1),Re=(e,t=.02)=>[...B].find(r=>w[r].height*(1+t)>=e),Te=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=w[s];return i.width>=r&&i.height>=n})},_e=e=>w[e].height,M=e=>e===exports.VideoQuality.INVARIANT,Ie=e=>e.every(t=>!M(t));function Pe(e){if(M(e))throw new Error("Expected exact quality")}const W=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=W(i,s):n[r]=r in e?i:s}return n},Ne=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function Me(e,t=0,n){let r,s,i,o,a,d,c=0,b=!1,h=!1,g=!0;const v=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(b=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,g="trailing"in n?!!n.trailing:g);function x(l){const m=r,p=s;return r=s=void 0,c=l,o=e.apply(p,m),o}function L(l,m){return v?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(l)):setTimeout(l,m)}function K(l){if(v){window.cancelAnimationFrame(l);return}clearTimeout(l)}function X(l){return c=l,a=L(R,t),b?x(l):o}function J(l){const m=l-d,p=l-c,F=t-m;return h?Math.min(F,i-p):F}function V(l){const m=l-d,p=l-c;return d===void 0||m>=t||m<0||h&&p>=i}function R(){const l=Date.now();if(V(l))return k(l);a=L(R,J(l))}function k(l){return a=void 0,g&&r?x(l):(r=s=void 0,o)}function Z(){a!==void 0&&K(a),c=0,r=d=s=a=void 0}function ee(){return a===void 0?o:k(Date.now())}function te(){return a!==void 0}function T(...l){const m=Date.now(),p=V(m);if(r=l,s=this,d=m,p){if(a===void 0)return X(d);if(h)return a=L(R,t),x(d)}return a===void 0&&(a=L(R,t)),o}return T.cancel=Z,T.flush=ee,T.pending=te,T}const D=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=D(e[r],t):n[r]=e[r]}return n},De=e=>D(e);class Qe extends I{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Ve(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new C)})}function ke(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new C))}var Fe=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),qe=e=>new f(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),je=e=>new f(t=>{e.forEach(n=>t.next(n))}),Ue=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function Ge(e){return t=>new f(n=>t.subscribe(new Be(n,e)))}class Be{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const We={leading:!1,trailing:!0};function He(e,t=We){return n=>new f(r=>n.subscribe(new ze(r,e,t)))}class ze{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,U(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const $e={leading:!0,trailing:!1};function Ye(e,t=$e){return n=>new f(r=>n.subscribe(new Ke(r,e,t)))}class Ke{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,G(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function Xe(e){return t=>new f(n=>t.subscribe(new Je(n,e)))}class Je{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ze(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new et(n,e)))}const q={};class et{destination;predicate;lastValue=q;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===q||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function H(e){return t=>new f(n=>t.subscribe(new tt(n,e)))}let tt=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function nt(e){return H(()=>e)}function rt(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function it(){return e=>new f(t=>e.subscribe(new st(t)))}class st{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ot(e){return t=>new f(n=>t.subscribe(new at(n,e)))}class at{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class j{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class z extends j{constructor(){super(),this.listeners||j.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ct{constructor(){Object.defineProperty(this,"signal",{value:new z,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ct.prototype[Symbol.toStringTag]="AbortController",z.prototype[Symbol.toStringTag]="AbortSignal");function $(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function lt(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!$({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,b){let h;b&&b.signal&&(h=b.signal,delete b.signal);const g=new n(c,b);return h&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),g},i.prototype=n.prototype);const o=t;return{fetch:(d,c)=>{const b=i&&i.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(b){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(b.aborted)return Promise.reject(h);const g=new Promise((v,x)=>{b.addEventListener("abort",()=>x(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(d,c)])}return o(d,c)},Request:i}}const Q=$({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Y=Q?lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ut=Q?Y.fetch:window.fetch;Q?Y.Request:window.Request;exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const dt="vk.com",ft=async(e,t,n)=>{const r=new URL(`https://${dt}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await ut(r.toString())).json();return ht(i,n)},ht=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),bt(r)])),bt=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=ie;exports.Observable=f;exports.Subject=I;exports.Subscription=C;exports.VERSION=ne;exports.ValueSubject=Qe;exports.abortable=de;exports.addScript=le;exports.areQualitiesExact=Ie;exports.assertEmptyArray=ce;exports.assertNever=y;exports.assertNonNullable=se;exports.assertNotEmptyArray=ae;exports.assertNullable=oe;exports.assertQualityIsExact=Pe;exports.buffer=Ge;exports.checkNever=re;exports.cloneDeep=De;exports.cloneDeepWith=D;exports.combine=Ve;exports.debounce=He;exports.debounceFn=Me;exports.detectEmbed=Oe;exports.fillWithDefault=W;exports.filter=Xe;exports.filterChanged=Ze;exports.fromEvent=Ue;exports.getCurrentBrowser=P;exports.getExponentialDelay=we;exports.getHighestQuality=Le;exports.getIOSVersion=he;exports.interval=qe;exports.isHigher=Ae;exports.isHigherOrEqual=xe;exports.isIOS=fe;exports.isInvariantQuality=M;exports.isLower=N;exports.isLowerOrEqual=Ce;exports.isMacLike=be;exports.isNonNullable=U;exports.isNullable=G;exports.loadVKLangPack=ft;exports.map=H;exports.mapTo=nt;exports.merge=ke;exports.noop=S;exports.now=ue;exports.observableFrom=je;exports.once=rt;exports.pairwise=it;exports.safeStorage=Se;exports.tap=ot;exports.throttle=Ye;exports.timeCodeToString=Ne;exports.timeout=Fe;exports.videoHeightToQuality=Re;exports.videoQualityToHeight=_e;exports.videoSizeToQuality=Te;
|
|
6
|
+
"use strict";const ne="1.0.32";class C{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const y=e=>{throw new Error(`${e} is value of unexpected type`)},re=e=>{},S=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:S}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:S,error:S};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new C().add(()=>{switch(s.next=S,s.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return y(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class I extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new C().add(()=>this.subscribers.delete(n))}}class ie{log$=new I;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function se(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function oe(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function U(e){return typeof e<"u"&&e!==null}function G(e){return e==null}function ae(e,t){if(!e?.length)throw new Error(t)}function ce(e,t){if(e?.length)throw new Error(t)}const le=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{d&&clearTimeout(d),c.removeEventListener("load",o),c.removeEventListener("error",i)};let d;n&&(d=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),ue=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),de=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const P=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,n=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,r=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,a=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,d=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,b=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,h=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,g=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||exports.CurrentClientBrowser.Rest,device:d||c||b||h||v||g||exports.CurrentClientDevice.Desktop}},fe=(e=!1)=>{const n=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(P().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},he=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},be=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(P().device),we=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let O,E;const _=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(E!==void 0)return E;try{localStorage.setItem(_,"test"),localStorage.removeItem(_),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(_),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(O=new Map),E},me=()=>A()===u.LOCAL_STORAGE,ge=e=>{const t=A();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return O?.get(e);default:y(t)}},pe=(e,t)=>{const n=A();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.RUNTIME:return void O?.set(e,t);default:y(n)}},Ee=e=>{const t=A();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return O?.has(e)??!1;default:return y(t),!1}},ye=e=>{const t=A();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void O?.delete(e);default:y(t)}},ve=()=>{const e=A();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return O?.clear();default:y(e)}};var Se=Object.freeze({__proto__:null,clear:ve,get:ge,has:Ee,isPersistent:me,remove:ye,set:pe});const Oe=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const w={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Ae=(e,t)=>w[e].height>w[t].height,xe=(e,t)=>w[e].height>=w[t].height,N=(e,t)=>w[e].height<w[t].height,Ce=(e,t)=>w[e].height<=w[t].height,Le=e=>e.sort((t,n)=>t===n?0:t===exports.VideoQuality.INVARIANT?1:n===exports.VideoQuality.INVARIANT?-1:N(t,n)?1:-1)[0],B=Object.keys(w).sort((e,t)=>N(e,t)?-1:1),Re=(e,t=.02)=>[...B].find(r=>w[r].height*(1+t)>=e),Te=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=w[s];return i.width>=r&&i.height>=n})},_e=e=>w[e].height,M=e=>e===exports.VideoQuality.INVARIANT,Ie=e=>e.every(t=>!M(t));function Pe(e){if(M(e))throw new Error("Expected exact quality")}const W=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=W(i,s):n[r]=r in e?i:s}return n},Ne=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function Me(e,t=0,n){let r,s,i,o,a,d,c=0,b=!1,h=!1,g=!0;const v=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(b=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,g="trailing"in n?!!n.trailing:g);function x(l){const m=r,p=s;return r=s=void 0,c=l,o=e.apply(p,m),o}function L(l,m){return v?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(l)):setTimeout(l,m)}function K(l){if(v){window.cancelAnimationFrame(l);return}clearTimeout(l)}function X(l){return c=l,a=L(R,t),b?x(l):o}function J(l){const m=l-d,p=l-c,F=t-m;return h?Math.min(F,i-p):F}function V(l){const m=l-d,p=l-c;return d===void 0||m>=t||m<0||h&&p>=i}function R(){const l=Date.now();if(V(l))return k(l);a=L(R,J(l))}function k(l){return a=void 0,g&&r?x(l):(r=s=void 0,o)}function Z(){a!==void 0&&K(a),c=0,r=d=s=a=void 0}function ee(){return a===void 0?o:k(Date.now())}function te(){return a!==void 0}function T(...l){const m=Date.now(),p=V(m);if(r=l,s=this,d=m,p){if(a===void 0)return X(d);if(h)return a=L(R,t),x(d)}return a===void 0&&(a=L(R,t)),o}return T.cancel=Z,T.flush=ee,T.pending=te,T}const D=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=D(e[r],t):n[r]=e[r]}return n},De=e=>D(e);class Qe extends I{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Ve(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new C)})}function ke(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new C))}var Fe=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),qe=e=>new f(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),je=e=>new f(t=>{e.forEach(n=>t.next(n))}),Ue=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function Ge(e){return t=>new f(n=>t.subscribe(new Be(n,e)))}class Be{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const We={leading:!1,trailing:!0};function He(e,t=We){return n=>new f(r=>n.subscribe(new ze(r,e,t)))}class ze{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,U(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const $e={leading:!0,trailing:!1};function Ye(e,t=$e){return n=>new f(r=>n.subscribe(new Ke(r,e,t)))}class Ke{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,G(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function Xe(e){return t=>new f(n=>t.subscribe(new Je(n,e)))}class Je{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ze(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new et(n,e)))}const q={};class et{destination;predicate;lastValue=q;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===q||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function H(e){return t=>new f(n=>t.subscribe(new tt(n,e)))}let tt=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function nt(e){return H(()=>e)}function rt(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function it(){return e=>new f(t=>e.subscribe(new st(t)))}class st{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ot(e){return t=>new f(n=>t.subscribe(new at(n,e)))}class at{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class j{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class z extends j{constructor(){super(),this.listeners||j.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ct{constructor(){Object.defineProperty(this,"signal",{value:new z,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ct.prototype[Symbol.toStringTag]="AbortController",z.prototype[Symbol.toStringTag]="AbortSignal");function $(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function lt(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!$({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,b){let h;b&&b.signal&&(h=b.signal,delete b.signal);const g=new n(c,b);return h&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),g},i.prototype=n.prototype);const o=t;return{fetch:(d,c)=>{const b=i&&i.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(b){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(b.aborted)return Promise.reject(h);const g=new Promise((v,x)=>{b.addEventListener("abort",()=>x(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(d,c)])}return o(d,c)},Request:i}}const Q=$({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Y=Q?lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ut=Q?Y.fetch:window.fetch;Q?Y.Request:window.Request;exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const dt="vk.com",ft=async(e,t,n)=>{const r=new URL(`https://${dt}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await ut(r.toString())).json();return ht(i,n)},ht=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),bt(r)])),bt=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=ie;exports.Observable=f;exports.Subject=I;exports.Subscription=C;exports.VERSION=ne;exports.ValueSubject=Qe;exports.abortable=de;exports.addScript=le;exports.areQualitiesExact=Ie;exports.assertEmptyArray=ce;exports.assertNever=y;exports.assertNonNullable=se;exports.assertNotEmptyArray=ae;exports.assertNullable=oe;exports.assertQualityIsExact=Pe;exports.buffer=Ge;exports.checkNever=re;exports.cloneDeep=De;exports.cloneDeepWith=D;exports.combine=Ve;exports.debounce=He;exports.debounceFn=Me;exports.detectEmbed=Oe;exports.fillWithDefault=W;exports.filter=Xe;exports.filterChanged=Ze;exports.fromEvent=Ue;exports.getCurrentBrowser=P;exports.getExponentialDelay=we;exports.getHighestQuality=Le;exports.getIOSVersion=he;exports.interval=qe;exports.isHigher=Ae;exports.isHigherOrEqual=xe;exports.isIOS=fe;exports.isInvariantQuality=M;exports.isLower=N;exports.isLowerOrEqual=Ce;exports.isMacLike=be;exports.isNonNullable=U;exports.isNullable=G;exports.loadVKLangPack=ft;exports.map=H;exports.mapTo=nt;exports.merge=ke;exports.noop=S;exports.now=ue;exports.observableFrom=je;exports.once=rt;exports.pairwise=it;exports.safeStorage=Se;exports.tap=ot;exports.throttle=Ye;exports.timeCodeToString=Ne;exports.timeout=Fe;exports.videoHeightToQuality=Re;exports.videoQualityToHeight=_e;exports.videoSizeToQuality=Te;
|
package/esnext.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Pe="1.0.32-dev.935ac7b0.0";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},Ie=e=>{},L=()=>{};class b{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:L}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:L,error:L};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new M().add(()=>{switch(s.next=L,s.error=L,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return x(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class V extends b{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Me{log$=new V;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function Ne(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ke(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function ie(e){return typeof e<"u"&&e!==null}function se(e){return e==null}function Fe(e,t){if(!e?.length)throw new Error(t)}function qe(e,t){if(e?.length)throw new Error(t)}const Ce=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{d&&clearTimeout(d),c.removeEventListener("load",o),c.removeEventListener("error",i)};let d;n&&(d=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),je=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),De=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};var A;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(A||(A={}));var h;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(h||(h={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?A.Yandex:void 0,n=/chrome|crios/i.test(e)?A.Chrome:void 0,r=/chromium/i.test(e)?A.Chromium:void 0,s=/firefox|fxios/i.test(e)?A.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?A.Safari:void 0,o=/opr\//i.test(e)?A.Opera:void 0,a=/edg/i.test(e)?A.Edge:void 0,d=/android/i.test(e)?h.Android:void 0,c=/iphone/i.test(e)?h.iPhone:void 0,w=/ipad/i.test(e)?h.iPad:void 0,f=/ipod/i.test(e)?h.iPod:void 0,E=/mac/i.test(e)?h.Mac:void 0,O=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?h.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||A.Rest,device:d||c||w||f||O||E||h.Desktop}},Ue=(e=!1)=>{const n=[h.iPhone,h.iPad,h.iPod].includes(W().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},Qe=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},Ge=()=>[h.Mac,h.iPhone,h.iPad,h.iPod].includes(W().device),Ve=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let v,y;const N=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(y!==void 0)return y;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),y=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),y=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)y=u.RUNTIME;else throw t}else throw e}return y===u.RUNTIME&&(v=new Map),y},oe=()=>R()===u.LOCAL_STORAGE,ae=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return v?.get(e);default:x(t)}},ce=(e,t)=>{const n=R();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.RUNTIME:return void v?.set(e,t);default:x(n)}},le=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return v?.has(e)??!1;default:return x(t),!1}},ue=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void v?.delete(e);default:x(t)}},de=()=>{const e=R();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return v?.clear();default:x(e)}};var We=Object.freeze({__proto__:null,clear:de,get:ae,has:le,isPersistent:oe,remove:ue,set:ce});const ze=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const p={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},$e=(e,t)=>p[e].height>p[t].height,Ye=(e,t)=>p[e].height>=p[t].height,z=(e,t)=>p[e].height<p[t].height,He=(e,t)=>p[e].height<=p[t].height,Be=e=>e.sort((t,n)=>t===n?0:t===m.INVARIANT?1:n===m.INVARIANT?-1:z(t,n)?1:-1)[0],$=Object.keys(p).sort((e,t)=>z(e,t)?-1:1),Xe=(e,t=.02)=>[...$].find(r=>p[r].height*(1+t)>=e),Je=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return $.find(s=>{const i=p[s];return i.width>=r&&i.height>=n})},Ze=e=>p[e].height,Y=e=>e===m.INVARIANT,Ke=e=>e.every(t=>!Y(t));function et(e){if(Y(e))throw new Error("Expected exact quality")}const fe=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=fe(i,s):n[r]=r in e?i:s}return n},tt=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function nt(e,t=0,n){let r,s,i,o,a,d,c=0,w=!1,f=!1,E=!0;const O=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(w=!!n.leading,f="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,E="trailing"in n?!!n.trailing:E);function _(l){const g=r,S=s;return r=s=void 0,c=l,o=e.apply(S,g),o}function T(l,g){return O?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(l)):setTimeout(l,g)}function Z(l){if(O){window.cancelAnimationFrame(l);return}clearTimeout(l)}function K(l){return c=l,a=T(P,t),w?_(l):o}function ee(l){const g=l-d,S=l-c,C=t-g;return f?Math.min(C,i-S):C}function F(l){const g=l-d,S=l-c;return d===void 0||g>=t||g<0||f&&S>=i}function P(){const l=Date.now();if(F(l))return q(l);a=T(P,ee(l))}function q(l){return a=void 0,E&&r?_(l):(r=s=void 0,o)}function te(){a!==void 0&&Z(a),c=0,r=d=s=a=void 0}function ne(){return a===void 0?o:q(Date.now())}function re(){return a!==void 0}function I(...l){const g=Date.now(),S=F(g);if(r=l,s=this,d=g,S){if(a===void 0)return K(d);if(f)return a=T(P,t),_(d)}return a===void 0&&(a=T(P,t)),o}return I.cancel=te,I.flush=ne,I.pending=re,I}const H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=H(e[r],t):n[r]=e[r]}return n},rt=e=>H(e);class it extends V{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function st(e){return new b(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new M)})}function ot(...e){return new b(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new M))}var at=e=>new b(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),ct=e=>new b(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),lt=e=>new b(t=>{e.forEach(n=>t.next(n))}),ut=(e,t)=>new b(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function dt(e){return t=>new b(n=>t.subscribe(new he(n,e)))}class he{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const be={leading:!1,trailing:!0};function ft(e,t=be){return n=>new b(r=>n.subscribe(new we(r,e,t)))}class we{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,ie(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const me={leading:!0,trailing:!1};function ht(e,t=me){return n=>new b(r=>n.subscribe(new pe(r,e,t)))}class pe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,se(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function bt(e){return t=>new b(n=>t.subscribe(new ge(n,e)))}class ge{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function wt(e=(t,n)=>t===n){return t=>new b(n=>t.subscribe(new Ee(n,e)))}const j={};class Ee{destination;predicate;lastValue=j;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ae(e){return t=>new b(n=>t.subscribe(new Se(n,e)))}let Se=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function pt(e){return Ae(()=>e)}function gt(){return e=>new b(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function Et(){return e=>new b(t=>e.subscribe(new ye(t)))}class ye{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function At(e){return t=>new b(n=>t.subscribe(new Oe(n,e)))}class Oe{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var D;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(D||(D={}));class U{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class B extends U{constructor(){super(),this.listeners||U.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class xe{constructor(){Object.defineProperty(this,"signal",{value:new B,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(xe.prototype[Symbol.toStringTag]="AbortController",B.prototype[Symbol.toStringTag]="AbortSignal");function X(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function ve(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!X({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,w){let f;w&&w.signal&&(f=w.signal,delete w.signal);const E=new n(c,w);return f&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),E},i.prototype=n.prototype);const o=t;return{fetch:(d,c)=>{const w=i&&i.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(w){let f;try{f=new DOMException("Aborted","AbortError")}catch{f=new Error("Aborted"),f.name="AbortError"}if(w.aborted)return Promise.reject(f);const E=new Promise((O,_)=>{w.addEventListener("abort",()=>_(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(d,c)])}return o(d,c)},Request:i}}const k=X({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),J=k?ve({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Re=k?J.fetch:window.fetch;k?J.Request:window.Request;var Q;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(Q||(Q={}));const _e="vk.com",St=async(e,t,n)=>{const r=new URL(`https://${_e}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await Re(r.toString())).json();return Le(i,n)},Le=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),Te(r)])),Te=e=>Array.isArray(e)?e[0]:e;var G;(function(e){e.RU="ru",e.EN="en"})(G||(G={}));export{A as CurrentClientBrowser,h as CurrentClientDevice,D as ErrorCategory,G as InterfaceLanguage,Me as Logger,b as Observable,V as Subject,M as Subscription,Pe as VERSION,Q as VKNumericLanguage,it as ValueSubject,m as VideoQuality,De as abortable,Ce as addScript,Ke as areQualitiesExact,qe as assertEmptyArray,x as assertNever,Ne as assertNonNullable,Fe as assertNotEmptyArray,ke as assertNullable,et as assertQualityIsExact,dt as buffer,Ie as checkNever,rt as cloneDeep,H as cloneDeepWith,st as combine,ft as debounce,nt as debounceFn,ze as detectEmbed,fe as fillWithDefault,bt as filter,wt as filterChanged,ut as fromEvent,W as getCurrentBrowser,Ve as getExponentialDelay,Be as getHighestQuality,Qe as getIOSVersion,ct as interval,$e as isHigher,Ye as isHigherOrEqual,Ue as isIOS,Y as isInvariantQuality,z as isLower,He as isLowerOrEqual,Ge as isMacLike,ie as isNonNullable,se as isNullable,St as loadVKLangPack,Ae as map,pt as mapTo,ot as merge,L as noop,je as now,lt as observableFrom,gt as once,Et as pairwise,We as safeStorage,At as tap,ht as throttle,tt as timeCodeToString,at as timeout,Xe as videoHeightToQuality,Ze as videoQualityToHeight,Je as videoSizeToQuality};
|
|
6
|
+
const Pe="1.0.32";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},Ie=e=>{},L=()=>{};class b{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:L}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:L,error:L};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new M().add(()=>{switch(s.next=L,s.error=L,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return x(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class V extends b{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Me{log$=new V;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function Ne(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ke(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function ie(e){return typeof e<"u"&&e!==null}function se(e){return e==null}function Fe(e,t){if(!e?.length)throw new Error(t)}function qe(e,t){if(e?.length)throw new Error(t)}const Ce=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{d&&clearTimeout(d),c.removeEventListener("load",o),c.removeEventListener("error",i)};let d;n&&(d=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),je=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),De=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};var A;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(A||(A={}));var h;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(h||(h={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?A.Yandex:void 0,n=/chrome|crios/i.test(e)?A.Chrome:void 0,r=/chromium/i.test(e)?A.Chromium:void 0,s=/firefox|fxios/i.test(e)?A.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?A.Safari:void 0,o=/opr\//i.test(e)?A.Opera:void 0,a=/edg/i.test(e)?A.Edge:void 0,d=/android/i.test(e)?h.Android:void 0,c=/iphone/i.test(e)?h.iPhone:void 0,w=/ipad/i.test(e)?h.iPad:void 0,f=/ipod/i.test(e)?h.iPod:void 0,E=/mac/i.test(e)?h.Mac:void 0,O=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?h.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||A.Rest,device:d||c||w||f||O||E||h.Desktop}},Ue=(e=!1)=>{const n=[h.iPhone,h.iPad,h.iPod].includes(W().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},Qe=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},Ge=()=>[h.Mac,h.iPhone,h.iPad,h.iPod].includes(W().device),Ve=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let v,y;const N=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(y!==void 0)return y;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),y=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),y=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)y=u.RUNTIME;else throw t}else throw e}return y===u.RUNTIME&&(v=new Map),y},oe=()=>R()===u.LOCAL_STORAGE,ae=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return v?.get(e);default:x(t)}},ce=(e,t)=>{const n=R();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.RUNTIME:return void v?.set(e,t);default:x(n)}},le=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return v?.has(e)??!1;default:return x(t),!1}},ue=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void v?.delete(e);default:x(t)}},de=()=>{const e=R();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return v?.clear();default:x(e)}};var We=Object.freeze({__proto__:null,clear:de,get:ae,has:le,isPersistent:oe,remove:ue,set:ce});const ze=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const p={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},$e=(e,t)=>p[e].height>p[t].height,Ye=(e,t)=>p[e].height>=p[t].height,z=(e,t)=>p[e].height<p[t].height,He=(e,t)=>p[e].height<=p[t].height,Be=e=>e.sort((t,n)=>t===n?0:t===m.INVARIANT?1:n===m.INVARIANT?-1:z(t,n)?1:-1)[0],$=Object.keys(p).sort((e,t)=>z(e,t)?-1:1),Xe=(e,t=.02)=>[...$].find(r=>p[r].height*(1+t)>=e),Je=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return $.find(s=>{const i=p[s];return i.width>=r&&i.height>=n})},Ze=e=>p[e].height,Y=e=>e===m.INVARIANT,Ke=e=>e.every(t=>!Y(t));function et(e){if(Y(e))throw new Error("Expected exact quality")}const fe=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=fe(i,s):n[r]=r in e?i:s}return n},tt=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function nt(e,t=0,n){let r,s,i,o,a,d,c=0,w=!1,f=!1,E=!0;const O=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(w=!!n.leading,f="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,E="trailing"in n?!!n.trailing:E);function _(l){const g=r,S=s;return r=s=void 0,c=l,o=e.apply(S,g),o}function T(l,g){return O?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(l)):setTimeout(l,g)}function Z(l){if(O){window.cancelAnimationFrame(l);return}clearTimeout(l)}function K(l){return c=l,a=T(P,t),w?_(l):o}function ee(l){const g=l-d,S=l-c,C=t-g;return f?Math.min(C,i-S):C}function F(l){const g=l-d,S=l-c;return d===void 0||g>=t||g<0||f&&S>=i}function P(){const l=Date.now();if(F(l))return q(l);a=T(P,ee(l))}function q(l){return a=void 0,E&&r?_(l):(r=s=void 0,o)}function te(){a!==void 0&&Z(a),c=0,r=d=s=a=void 0}function ne(){return a===void 0?o:q(Date.now())}function re(){return a!==void 0}function I(...l){const g=Date.now(),S=F(g);if(r=l,s=this,d=g,S){if(a===void 0)return K(d);if(f)return a=T(P,t),_(d)}return a===void 0&&(a=T(P,t)),o}return I.cancel=te,I.flush=ne,I.pending=re,I}const H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=H(e[r],t):n[r]=e[r]}return n},rt=e=>H(e);class it extends V{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function st(e){return new b(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new M)})}function ot(...e){return new b(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new M))}var at=e=>new b(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),ct=e=>new b(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),lt=e=>new b(t=>{e.forEach(n=>t.next(n))}),ut=(e,t)=>new b(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function dt(e){return t=>new b(n=>t.subscribe(new he(n,e)))}class he{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const be={leading:!1,trailing:!0};function ft(e,t=be){return n=>new b(r=>n.subscribe(new we(r,e,t)))}class we{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,ie(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const me={leading:!0,trailing:!1};function ht(e,t=me){return n=>new b(r=>n.subscribe(new pe(r,e,t)))}class pe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,se(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function bt(e){return t=>new b(n=>t.subscribe(new ge(n,e)))}class ge{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function wt(e=(t,n)=>t===n){return t=>new b(n=>t.subscribe(new Ee(n,e)))}const j={};class Ee{destination;predicate;lastValue=j;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ae(e){return t=>new b(n=>t.subscribe(new Se(n,e)))}let Se=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function pt(e){return Ae(()=>e)}function gt(){return e=>new b(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function Et(){return e=>new b(t=>e.subscribe(new ye(t)))}class ye{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function At(e){return t=>new b(n=>t.subscribe(new Oe(n,e)))}class Oe{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var D;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(D||(D={}));class U{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class B extends U{constructor(){super(),this.listeners||U.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class xe{constructor(){Object.defineProperty(this,"signal",{value:new B,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(xe.prototype[Symbol.toStringTag]="AbortController",B.prototype[Symbol.toStringTag]="AbortSignal");function X(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function ve(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!X({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,w){let f;w&&w.signal&&(f=w.signal,delete w.signal);const E=new n(c,w);return f&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),E},i.prototype=n.prototype);const o=t;return{fetch:(d,c)=>{const w=i&&i.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(w){let f;try{f=new DOMException("Aborted","AbortError")}catch{f=new Error("Aborted"),f.name="AbortError"}if(w.aborted)return Promise.reject(f);const E=new Promise((O,_)=>{w.addEventListener("abort",()=>_(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(d,c)])}return o(d,c)},Request:i}}const k=X({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),J=k?ve({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Re=k?J.fetch:window.fetch;k?J.Request:window.Request;var Q;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(Q||(Q={}));const _e="vk.com",St=async(e,t,n)=>{const r=new URL(`https://${_e}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await Re(r.toString())).json();return Le(i,n)},Le=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),Te(r)])),Te=e=>Array.isArray(e)?e[0]:e;var G;(function(e){e.RU="ru",e.EN="en"})(G||(G={}));export{A as CurrentClientBrowser,h as CurrentClientDevice,D as ErrorCategory,G as InterfaceLanguage,Me as Logger,b as Observable,V as Subject,M as Subscription,Pe as VERSION,Q as VKNumericLanguage,it as ValueSubject,m as VideoQuality,De as abortable,Ce as addScript,Ke as areQualitiesExact,qe as assertEmptyArray,x as assertNever,Ne as assertNonNullable,Fe as assertNotEmptyArray,ke as assertNullable,et as assertQualityIsExact,dt as buffer,Ie as checkNever,rt as cloneDeep,H as cloneDeepWith,st as combine,ft as debounce,nt as debounceFn,ze as detectEmbed,fe as fillWithDefault,bt as filter,wt as filterChanged,ut as fromEvent,W as getCurrentBrowser,Ve as getExponentialDelay,Be as getHighestQuality,Qe as getIOSVersion,ct as interval,$e as isHigher,Ye as isHigherOrEqual,Ue as isIOS,Y as isInvariantQuality,z as isLower,He as isLowerOrEqual,Ge as isMacLike,ie as isNonNullable,se as isNullable,St as loadVKLangPack,Ae as map,pt as mapTo,ot as merge,L as noop,je as now,lt as observableFrom,gt as once,Et as pairwise,We as safeStorage,At as tap,ht as throttle,tt as timeCodeToString,at as timeout,Xe as videoHeightToQuality,Ze as videoQualityToHeight,Je as videoSizeToQuality};
|
package/evergreen.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.32
|
|
3
|
+
* Fri, 16 Feb 2024 12:41:15 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-32/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Ae="1.0.32-dev.935ac7b0.0";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},Oe=e=>{},y=()=>{};class d{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let i;n?typeof n=="function"?i={next:n,error:y}:i={next:s=>n.next(s),error:s=>n.error?.(s)}:i={next:y,error:y};const o=typeof t=="function"?{next:s=>{try{t(s)}catch(a){i.next(a)}},error:s=>i.next(s)}:{next:s=>t.next(s),error:s=>t.error?t.error(s):i.next(s)};let r;try{r=this._subscribe(o)}catch(s){o.error?.(s)}return new M().add(()=>{switch(o.next=y,o.error=y,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return x(r)}})}pipe(...t){return t.reduce((n,i)=>i(n),this)}_subscribe(t){}}class j extends d{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class ve{log$=new j;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let i;try{i=t(...n)}catch{i={message:"error in `createCustomLog`",component:"Logger"}}this.log(i)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ye(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function Te(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function K(e){return typeof e<"u"&&e!==null}function ee(e){return e==null}function Ie(e,t){if(!e?.length)throw new Error(t)}function _e(e,t){if(e?.length)throw new Error(t)}const Pe=(e,t,n)=>new Promise((i,o)=>{t.addEventListener("abort",()=>{a(),h.remove()});const r=()=>{a(),o()},s=()=>{a(),i()},a=()=>{m&&clearTimeout(m),h.removeEventListener("load",s),h.removeEventListener("error",r)};let m;n&&(m=window.setTimeout(r,n));const h=document.createElement("script");h.addEventListener("load",s),h.addEventListener("error",r),h.src=e,document.head.appendChild(h)}),Re=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Me=(e,t)=>async(...n)=>{const i=t(...n);let o=e.aborted,r;for(;!o&&!e.aborted;)try{const s=await i.next(r);o=s.done??!1,r=s.value}catch(s){await i.throw(s)}return r};var p;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(p||(p={}));var l;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(l||(l={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?p.Yandex:void 0,n=/chrome|crios/i.test(e)?p.Chrome:void 0,i=/chromium/i.test(e)?p.Chromium:void 0,o=/firefox|fxios/i.test(e)?p.Firefox:void 0,r=/webkit|safari|khtml/i.test(e)?p.Safari:void 0,s=/opr\//i.test(e)?p.Opera:void 0,a=/edg/i.test(e)?p.Edge:void 0,m=/android/i.test(e)?l.Android:void 0,h=/iphone/i.test(e)?l.iPhone:void 0,T=/ipad/i.test(e)?l.iPad:void 0,S=/ipod/i.test(e)?l.iPod:void 0,v=/mac/i.test(e)?l.Mac:void 0,I=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||o||s||a||n||i||r||p.Rest,device:m||h||T||S||I||v||l.Desktop}},Le=(e=!1)=>{const n=[l.iPhone,l.iPad,l.iPod].includes(W().device);if(!e)return n;const{userAgent:i,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(i)&&o>0)},Ne=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],i=parseFloat(n);return isNaN(i)?null:i},ke=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(W().device),Ue=(e,{start:t=0,factor:n=2,max:i=1/0,min:o=t,random:r=0}={})=>{let s=t;return s*=n**e,s*=1+(Math.random()*r*2-r),s=Math.round(s),s=Math.min(s,i),s=Math.max(s,o),s};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let A,E;const N=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(E!==void 0)return E;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(A=new Map),E},te=()=>O()===u.LOCAL_STORAGE,ne=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return A?.get(e);default:x(t)}},ie=(e,t)=>{const n=O();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.RUNTIME:return void A?.set(e,t);default:x(n)}},se=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return A?.has(e)??!1;default:return x(t),!1}},re=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void A?.delete(e);default:x(t)}},oe=()=>{const e=O();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return A?.clear();default:x(e)}};var Qe=Object.freeze({__proto__:null,clear:oe,get:ne,has:se,isPersistent:te,remove:re,set:ie});const De=()=>{let e,t;try{e=window.self!==window.top}catch(i){i instanceof DOMException&&i.name==="SecurityError"?e=!0:(e=!1,console.error(i))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(i){console.error(i)}try{!t&&document.referrer&&(t=document.referrer)}catch(i){console.error(i)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var f;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(f||(f={}));const w={[f.Q_144P]:{width:256,height:144},[f.Q_240P]:{width:428,height:240},[f.Q_360P]:{width:640,height:360},[f.Q_480P]:{width:856,height:480},[f.Q_720P]:{width:1280,height:720},[f.Q_1080P]:{width:1920,height:1080},[f.Q_1440P]:{width:2560,height:1440},[f.Q_2160P]:{width:3840,height:2160},[f.Q_4320P]:{width:7680,height:4320}},Fe=(e,t)=>w[e].height>w[t].height,Ge=(e,t)=>w[e].height>=w[t].height,q=(e,t)=>w[e].height<w[t].height,Ve=(e,t)=>w[e].height<=w[t].height,je=e=>e.sort((t,n)=>t===n?0:t===f.INVARIANT?1:n===f.INVARIANT?-1:q(t,n)?1:-1)[0],z=Object.keys(w).sort((e,t)=>q(e,t)?-1:1),We=(e,t=.02)=>[...z].find(i=>w[i].height*(1+t)>=e),qe=({width:e,height:t})=>{const n=Math.min(e,t),i=Math.max(e,t);return z.find(o=>{const r=w[o];return r.width>=i&&r.height>=n})},ze=e=>w[e].height,$=e=>e===f.INVARIANT,$e=e=>e.every(t=>!$(t));function He(e){if($(e))throw new Error("Expected exact quality")}const ae=(e,t)=>{const n={};for(const i of Object.keys(t)){const o=t[i],r=e[i];Array.isArray(o)&&Array.isArray(r)?n[i]=r:typeof o=="object"&&typeof r=="object"?n[i]=ae(r,o):n[i]=i in e?r:o}return n},Ce=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function Ye(e,t=0,n){let i,o,r,s,a,m,h=0,T=!1,S=!1,v=!0;const I=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(T=!!n.leading,S="maxWait"in n,r=n?.maxWait?Math.max(+n?.maxWait||0,t):r,v="trailing"in n?!!n.trailing:v);function L(c){const g=i,b=o;return i=o=void 0,h=c,s=e.apply(b,g),s}function _(c,g){return I?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(c)):setTimeout(c,g)}function C(c){if(I){window.cancelAnimationFrame(c);return}clearTimeout(c)}function Y(c){return h=c,a=_(P,t),T?L(c):s}function X(c){const g=c-m,b=c-h,Q=t-g;return S?Math.min(Q,r-b):Q}function k(c){const g=c-m,b=c-h;return m===void 0||g>=t||g<0||S&&b>=r}function P(){const c=Date.now();if(k(c))return U(c);a=_(P,X(c))}function U(c){return a=void 0,v&&i?L(c):(i=o=void 0,s)}function J(){a!==void 0&&C(a),h=0,i=m=o=a=void 0}function Z(){return a===void 0?s:U(Date.now())}function B(){return a!==void 0}function R(...c){const g=Date.now(),b=k(g);if(i=c,o=this,m=g,b){if(a===void 0)return Y(m);if(S)return a=_(P,t),L(m)}return a===void 0&&(a=_(P,t)),s}return R.cancel=J,R.flush=Z,R.pending=B,R}const H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const i in e){if(typeof t=="function"){const o=t(e[i],i,e,n);if(o!==void 0){n[i]=o;continue}}typeof e[i]=="object"?n[i]=H(e[i],t):n[i]=e[i]}return n},Xe=e=>H(e);class Je extends j{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Ze(e){return new d(t=>{const n={};let i=Object.keys(e).length;const o=r=>s=>{r in n||i--,n[r]=s,i===0&&t.next(n)};return Object.entries(e).reduce((r,[s,a])=>r.add(a.subscribe(o(s))),new M)})}function Be(...e){return new d(t=>e.reduce((n,i)=>n.add(i.subscribe(t)),new M))}var Ke=e=>new d(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(i){if(t.error)t.error(i);else throw i}},e);return()=>window.clearTimeout(n)}),et=e=>new d(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),tt=e=>new d(t=>{e.forEach(n=>t.next(n))}),nt=(e,t)=>new d(n=>{const i=o=>n.next(o);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)});function it(e){return t=>new d(n=>t.subscribe(new ce(n,e)))}class ce{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const ue={leading:!1,trailing:!0};function st(e,t=ue){return n=>new d(i=>n.subscribe(new le(i,e,t)))}class le{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,K(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const de={leading:!0,trailing:!1};function rt(e,t=de){return n=>new d(i=>n.subscribe(new he(i,e,t)))}class he{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,ee(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function ot(e){return t=>new d(n=>t.subscribe(new fe(n,e)))}class fe{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function at(e=(t,n)=>t===n){return t=>new d(n=>t.subscribe(new me(n,e)))}const D={};class me{destination;predicate;lastValue=D;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===D||!this.predicate(this.lastValue,t),this.lastValue=t}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function we(e){return t=>new d(n=>t.subscribe(new ge(n,e)))}let ge=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(i){throw this.error(i),i}this.destination.next(n)}error(t){this.destination.error?.(t)}};function ut(e){return we(()=>e)}function lt(){return e=>new d(t=>{let n=!1,i=!1;const o=e.subscribe(r=>{n||(n=!0,t.next(r)),i&&o.unsubscribe()},r=>{n=!0,t.error?.(r),i&&o.unsubscribe()});return i=!0,n&&o.unsubscribe(),o})}function dt(){return e=>new d(t=>e.subscribe(new pe(t)))}class pe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ht(e){return t=>new d(n=>t.subscribe(new be(n,e)))}class be{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var F;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(F||(F={}));var G;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(G||(G={}));const Ee="vk.com",ft=async(e,t,n)=>{const i=new URL(`https://${Ee}/js/lang-pack.js`);i.searchParams.set("format","json"),i.searchParams.set("name",t),e!==void 0&&i.searchParams.set("lang",e);const r=await(await fetch(i.toString())).json();return Se(r,n)},Se=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,i])=>[n.substring(`${t}_`.length),xe(i)])),xe=e=>Array.isArray(e)?e[0]:e;var V;(function(e){e.RU="ru",e.EN="en"})(V||(V={}));export{p as CurrentClientBrowser,l as CurrentClientDevice,F as ErrorCategory,V as InterfaceLanguage,ve as Logger,d as Observable,j as Subject,M as Subscription,Ae as VERSION,G as VKNumericLanguage,Je as ValueSubject,f as VideoQuality,Me as abortable,Pe as addScript,$e as areQualitiesExact,_e as assertEmptyArray,x as assertNever,ye as assertNonNullable,Ie as assertNotEmptyArray,Te as assertNullable,He as assertQualityIsExact,it as buffer,Oe as checkNever,Xe as cloneDeep,H as cloneDeepWith,Ze as combine,st as debounce,Ye as debounceFn,De as detectEmbed,ae as fillWithDefault,ot as filter,at as filterChanged,nt as fromEvent,W as getCurrentBrowser,Ue as getExponentialDelay,je as getHighestQuality,Ne as getIOSVersion,et as interval,Fe as isHigher,Ge as isHigherOrEqual,Le as isIOS,$ as isInvariantQuality,q as isLower,Ve as isLowerOrEqual,ke as isMacLike,K as isNonNullable,ee as isNullable,ft as loadVKLangPack,we as map,ut as mapTo,Be as merge,y as noop,Re as now,tt as observableFrom,lt as once,dt as pairwise,Qe as safeStorage,ht as tap,rt as throttle,Ce as timeCodeToString,Ke as timeout,We as videoHeightToQuality,ze as videoQualityToHeight,qe as videoSizeToQuality};
|
|
6
|
+
const Ae="1.0.32";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},Oe=e=>{},y=()=>{};class d{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let i;n?typeof n=="function"?i={next:n,error:y}:i={next:s=>n.next(s),error:s=>n.error?.(s)}:i={next:y,error:y};const o=typeof t=="function"?{next:s=>{try{t(s)}catch(a){i.next(a)}},error:s=>i.next(s)}:{next:s=>t.next(s),error:s=>t.error?t.error(s):i.next(s)};let r;try{r=this._subscribe(o)}catch(s){o.error?.(s)}return new M().add(()=>{switch(o.next=y,o.error=y,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return x(r)}})}pipe(...t){return t.reduce((n,i)=>i(n),this)}_subscribe(t){}}class j extends d{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class ve{log$=new j;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let i;try{i=t(...n)}catch{i={message:"error in `createCustomLog`",component:"Logger"}}this.log(i)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ye(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function Te(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function K(e){return typeof e<"u"&&e!==null}function ee(e){return e==null}function Ie(e,t){if(!e?.length)throw new Error(t)}function _e(e,t){if(e?.length)throw new Error(t)}const Pe=(e,t,n)=>new Promise((i,o)=>{t.addEventListener("abort",()=>{a(),h.remove()});const r=()=>{a(),o()},s=()=>{a(),i()},a=()=>{m&&clearTimeout(m),h.removeEventListener("load",s),h.removeEventListener("error",r)};let m;n&&(m=window.setTimeout(r,n));const h=document.createElement("script");h.addEventListener("load",s),h.addEventListener("error",r),h.src=e,document.head.appendChild(h)}),Re=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Me=(e,t)=>async(...n)=>{const i=t(...n);let o=e.aborted,r;for(;!o&&!e.aborted;)try{const s=await i.next(r);o=s.done??!1,r=s.value}catch(s){await i.throw(s)}return r};var p;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(p||(p={}));var l;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(l||(l={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?p.Yandex:void 0,n=/chrome|crios/i.test(e)?p.Chrome:void 0,i=/chromium/i.test(e)?p.Chromium:void 0,o=/firefox|fxios/i.test(e)?p.Firefox:void 0,r=/webkit|safari|khtml/i.test(e)?p.Safari:void 0,s=/opr\//i.test(e)?p.Opera:void 0,a=/edg/i.test(e)?p.Edge:void 0,m=/android/i.test(e)?l.Android:void 0,h=/iphone/i.test(e)?l.iPhone:void 0,T=/ipad/i.test(e)?l.iPad:void 0,S=/ipod/i.test(e)?l.iPod:void 0,v=/mac/i.test(e)?l.Mac:void 0,I=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||o||s||a||n||i||r||p.Rest,device:m||h||T||S||I||v||l.Desktop}},Le=(e=!1)=>{const n=[l.iPhone,l.iPad,l.iPod].includes(W().device);if(!e)return n;const{userAgent:i,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(i)&&o>0)},Ne=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],i=parseFloat(n);return isNaN(i)?null:i},ke=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(W().device),Ue=(e,{start:t=0,factor:n=2,max:i=1/0,min:o=t,random:r=0}={})=>{let s=t;return s*=n**e,s*=1+(Math.random()*r*2-r),s=Math.round(s),s=Math.min(s,i),s=Math.max(s,o),s};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let A,E;const N=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(E!==void 0)return E;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(A=new Map),E},te=()=>O()===u.LOCAL_STORAGE,ne=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return A?.get(e);default:x(t)}},ie=(e,t)=>{const n=O();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.RUNTIME:return void A?.set(e,t);default:x(n)}},se=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return A?.has(e)??!1;default:return x(t),!1}},re=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void A?.delete(e);default:x(t)}},oe=()=>{const e=O();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return A?.clear();default:x(e)}};var Qe=Object.freeze({__proto__:null,clear:oe,get:ne,has:se,isPersistent:te,remove:re,set:ie});const De=()=>{let e,t;try{e=window.self!==window.top}catch(i){i instanceof DOMException&&i.name==="SecurityError"?e=!0:(e=!1,console.error(i))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(i){console.error(i)}try{!t&&document.referrer&&(t=document.referrer)}catch(i){console.error(i)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var f;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(f||(f={}));const w={[f.Q_144P]:{width:256,height:144},[f.Q_240P]:{width:428,height:240},[f.Q_360P]:{width:640,height:360},[f.Q_480P]:{width:856,height:480},[f.Q_720P]:{width:1280,height:720},[f.Q_1080P]:{width:1920,height:1080},[f.Q_1440P]:{width:2560,height:1440},[f.Q_2160P]:{width:3840,height:2160},[f.Q_4320P]:{width:7680,height:4320}},Fe=(e,t)=>w[e].height>w[t].height,Ge=(e,t)=>w[e].height>=w[t].height,q=(e,t)=>w[e].height<w[t].height,Ve=(e,t)=>w[e].height<=w[t].height,je=e=>e.sort((t,n)=>t===n?0:t===f.INVARIANT?1:n===f.INVARIANT?-1:q(t,n)?1:-1)[0],z=Object.keys(w).sort((e,t)=>q(e,t)?-1:1),We=(e,t=.02)=>[...z].find(i=>w[i].height*(1+t)>=e),qe=({width:e,height:t})=>{const n=Math.min(e,t),i=Math.max(e,t);return z.find(o=>{const r=w[o];return r.width>=i&&r.height>=n})},ze=e=>w[e].height,$=e=>e===f.INVARIANT,$e=e=>e.every(t=>!$(t));function He(e){if($(e))throw new Error("Expected exact quality")}const ae=(e,t)=>{const n={};for(const i of Object.keys(t)){const o=t[i],r=e[i];Array.isArray(o)&&Array.isArray(r)?n[i]=r:typeof o=="object"&&typeof r=="object"?n[i]=ae(r,o):n[i]=i in e?r:o}return n},Ce=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function Ye(e,t=0,n){let i,o,r,s,a,m,h=0,T=!1,S=!1,v=!0;const I=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(T=!!n.leading,S="maxWait"in n,r=n?.maxWait?Math.max(+n?.maxWait||0,t):r,v="trailing"in n?!!n.trailing:v);function L(c){const g=i,b=o;return i=o=void 0,h=c,s=e.apply(b,g),s}function _(c,g){return I?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(c)):setTimeout(c,g)}function C(c){if(I){window.cancelAnimationFrame(c);return}clearTimeout(c)}function Y(c){return h=c,a=_(P,t),T?L(c):s}function X(c){const g=c-m,b=c-h,Q=t-g;return S?Math.min(Q,r-b):Q}function k(c){const g=c-m,b=c-h;return m===void 0||g>=t||g<0||S&&b>=r}function P(){const c=Date.now();if(k(c))return U(c);a=_(P,X(c))}function U(c){return a=void 0,v&&i?L(c):(i=o=void 0,s)}function J(){a!==void 0&&C(a),h=0,i=m=o=a=void 0}function Z(){return a===void 0?s:U(Date.now())}function B(){return a!==void 0}function R(...c){const g=Date.now(),b=k(g);if(i=c,o=this,m=g,b){if(a===void 0)return Y(m);if(S)return a=_(P,t),L(m)}return a===void 0&&(a=_(P,t)),s}return R.cancel=J,R.flush=Z,R.pending=B,R}const H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const i in e){if(typeof t=="function"){const o=t(e[i],i,e,n);if(o!==void 0){n[i]=o;continue}}typeof e[i]=="object"?n[i]=H(e[i],t):n[i]=e[i]}return n},Xe=e=>H(e);class Je extends j{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Ze(e){return new d(t=>{const n={};let i=Object.keys(e).length;const o=r=>s=>{r in n||i--,n[r]=s,i===0&&t.next(n)};return Object.entries(e).reduce((r,[s,a])=>r.add(a.subscribe(o(s))),new M)})}function Be(...e){return new d(t=>e.reduce((n,i)=>n.add(i.subscribe(t)),new M))}var Ke=e=>new d(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(i){if(t.error)t.error(i);else throw i}},e);return()=>window.clearTimeout(n)}),et=e=>new d(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),tt=e=>new d(t=>{e.forEach(n=>t.next(n))}),nt=(e,t)=>new d(n=>{const i=o=>n.next(o);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)});function it(e){return t=>new d(n=>t.subscribe(new ce(n,e)))}class ce{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const ue={leading:!1,trailing:!0};function st(e,t=ue){return n=>new d(i=>n.subscribe(new le(i,e,t)))}class le{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,K(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const de={leading:!0,trailing:!1};function rt(e,t=de){return n=>new d(i=>n.subscribe(new he(i,e,t)))}class he{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,ee(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function ot(e){return t=>new d(n=>t.subscribe(new fe(n,e)))}class fe{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function at(e=(t,n)=>t===n){return t=>new d(n=>t.subscribe(new me(n,e)))}const D={};class me{destination;predicate;lastValue=D;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===D||!this.predicate(this.lastValue,t),this.lastValue=t}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function we(e){return t=>new d(n=>t.subscribe(new ge(n,e)))}let ge=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(i){throw this.error(i),i}this.destination.next(n)}error(t){this.destination.error?.(t)}};function ut(e){return we(()=>e)}function lt(){return e=>new d(t=>{let n=!1,i=!1;const o=e.subscribe(r=>{n||(n=!0,t.next(r)),i&&o.unsubscribe()},r=>{n=!0,t.error?.(r),i&&o.unsubscribe()});return i=!0,n&&o.unsubscribe(),o})}function dt(){return e=>new d(t=>e.subscribe(new pe(t)))}class pe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ht(e){return t=>new d(n=>t.subscribe(new be(n,e)))}class be{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var F;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(F||(F={}));var G;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(G||(G={}));const Ee="vk.com",ft=async(e,t,n)=>{const i=new URL(`https://${Ee}/js/lang-pack.js`);i.searchParams.set("format","json"),i.searchParams.set("name",t),e!==void 0&&i.searchParams.set("lang",e);const r=await(await fetch(i.toString())).json();return Se(r,n)},Se=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,i])=>[n.substring(`${t}_`.length),xe(i)])),xe=e=>Array.isArray(e)?e[0]:e;var V;(function(e){e.RU="ru",e.EN="en"})(V||(V={}));export{p as CurrentClientBrowser,l as CurrentClientDevice,F as ErrorCategory,V as InterfaceLanguage,ve as Logger,d as Observable,j as Subject,M as Subscription,Ae as VERSION,G as VKNumericLanguage,Je as ValueSubject,f as VideoQuality,Me as abortable,Pe as addScript,$e as areQualitiesExact,_e as assertEmptyArray,x as assertNever,ye as assertNonNullable,Ie as assertNotEmptyArray,Te as assertNullable,He as assertQualityIsExact,it as buffer,Oe as checkNever,Xe as cloneDeep,H as cloneDeepWith,Ze as combine,st as debounce,Ye as debounceFn,De as detectEmbed,ae as fillWithDefault,ot as filter,at as filterChanged,nt as fromEvent,W as getCurrentBrowser,Ue as getExponentialDelay,je as getHighestQuality,Ne as getIOSVersion,et as interval,Fe as isHigher,Ge as isHigherOrEqual,Le as isIOS,$ as isInvariantQuality,q as isLower,Ve as isLowerOrEqual,ke as isMacLike,K as isNonNullable,ee as isNullable,ft as loadVKLangPack,we as map,ut as mapTo,Be as merge,y as noop,Re as now,tt as observableFrom,lt as once,dt as pairwise,Qe as safeStorage,ht as tap,rt as throttle,Ce as timeCodeToString,Ke as timeout,We as videoHeightToQuality,ze as videoQualityToHeight,qe as videoSizeToQuality};
|