You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
819 KiB

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository
*/
8 months ago
"use strict";var aO=Object.create;var cc=Object.defineProperty;var lO=Object.getOwnPropertyDescriptor;var cO=Object.getOwnPropertyNames;var uO=Object.getPrototypeOf,dO=Object.prototype.hasOwnProperty;var pO=(t,e,n)=>e in t?cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var at=(t,e)=>()=>(t&&(e=t(t=0)),e);var Lt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zt=(t,e)=>{for(var n in e)cc(t,n,{get:e[n],enumerable:!0})},lE=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cO(e))!dO.call(t,r)&&r!==n&&cc(t,r,{get:()=>e[r],enumerable:!(i=lO(e,r))||i.enumerable});return t};var A=(t,e,n)=>(n=t!=null?aO(uO(t)):{},lE(e||!t||!t.__esModule?cc(n,"default",{value:t,enumerable:!0}):n,t)),hO=t=>lE(cc({},"__esModule",{value:!0}),t);var E=(t,e,n)=>(pO(t,typeof e!="symbol"?e+"":e,n),n),kv=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var C=(t,e,n)=>(kv(t,e,"read from private field"),n?n.call(t):e.get(t)),Y=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Le=(t,e,n,i)=>(kv(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var F=(t,e,n)=>(kv(t,e,"access private method"),n);var Ap=Lt(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});function wE(t,e){if(e)return t;throw new Error("Unhandled discriminated union member: "+JSON.stringify(t))}Lp.assertNever=wE;Lp.default=wE});var MS=Lt(ge=>{"use strict";var xc=Symbol.for("react.element"),cF=Symbol.for("react.portal"),uF=Symbol.for("react.fragment"),dF=Symbol.for("react.strict_mode"),pF=Symbol.for("react.profiler"),hF=Symbol.for("react.provider"),fF=Symbol.for("react.context"),mF=Symbol.for("react.forward_ref"),gF=Symbol.for("react.suspense"),yF=Symbol.for("react.memo"),vF=Symbol.for("react.lazy"),wS=Symbol.iterator;function wF(t){return t===null||typeof t!="object"?null:(t=wS&&t[wS]||t["@@iterator"],typeof t=="function"?t:null)}var xS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kS=Object.assign,TS={};function wa(t,e,n){this.props=t,this.context=e,this.refs=TS,this.updater=n||xS}wa.prototype.isReactComponent={};wa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};wa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ES(){}ES.prototype=wa.prototype;function Fv(t,e,n){this.props=t,this.context=e,this.refs=TS,this.updater=n||xS}var Vv=Fv.prototype=new ES;Vv.constructor=Fv;kS(Vv,wa.prototype);Vv.isPureReactComponent=!0;var _S=Array.isArray,SS=Object.prototype.hasOwnProperty,zv={current:null},PS={key:!0,ref:!0,__self:!0,__source:!0};function CS(t,e,n){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)SS.call(e,i)&&!PS.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:xc,type:t,key:s,ref:o,props:r,_owner:zv.current}}function _F(t,e){return{$$typeof:xc,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Uv(t){return typeof t=="object"&&t!==null&&t.$$typeof===xc}function bF(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var bS=/\/+/g;function Ov(t,e){return typeof t=="object"&&t!==null&&t.key!=null?bF(""+t.key):e.toString(36)}function ih(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case xc:case cF:o=!0}}if(o)return o=t,r=r(o),t=i===""?"."+Ov(o,0):i,_S(r)?(n="",t!=null&&(n=t.replace(bS,"$&/")+"/"),ih(r,e,n,"",function(c){return c})):r!=null&&(Uv(r)&&(r=_F(r,n+(!r.key||o&&o
`+Xv+t}var Zv=!1;function Jv(t,e){if(!t||Zv)return"";Zv=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var i=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){i=c}t.call(e.prototype)}else{try{throw Error()}catch(c){i=c}t()}}catch(c){if(c&&i&&typeof c.stack=="string"){for(var r=c.stack.split(`
9 months ago
`),s=i.stack.split(`
8 months ago
`),o=r.length-1,a=s.length-1;1<=o&&0<=a&&r[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==s[a]){var l=`
`+r[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{Zv=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ac(t):""}function MF(t){switch(t.tag){case 5:return Ac(t.type);case 16:return Ac("Lazy");case 13:return Ac("Suspense");case 19:return Ac("SuspenseList");case 0:case 2:case 15:return t=Jv(t.type,!1),t;case 11:return t=Jv(t.type.render,!1),t;case 1:return t=Jv(t.type,!0),t;default:return""}}function kw(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ka:return"Fragment";case xa:return"Portal";case _w:return"Profiler";case f_:return"StrictMode";case bw:return"Suspense";case xw:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Z1:return(t.displayName||"Context")+".Consumer";case X1:return(t._context.displayName||"Context")+".Provider";case m_:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case g_:return e=t.displayName||null,e!==null?e:kw(t.type)||"Memo";case es:e=t._payload,t=t._init;try{return kw(t(e))}catch{}}return null}function $F(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return kw(e);case 8:return e===f_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function fs(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function eP(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function RF(t){var e=eP(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function dh(t){t._valueTracker||(t._valueTracker=RF(t))}function tP(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=eP(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Vh(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Tw(t,e){var n=e.checked;return Ye({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function WS(t,e){var n=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;n=fs(e.value!=null?e.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function nP(t,e){e=e.checked,e!=null&&h_(t,"checked",e,!1)}function Ew(t,e){nP(t,e);var n=fs(e.value),i=e.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Sw(t,e.type,n):e.hasOwnProperty("defaultValue")&&Sw(t,e.type,fs(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function KS(t,e,n){if(e.hasOwnProperty("val
`).replace(V3,"")}function kh(t,e,n){if(e=y1(e),y1(t)!==e&&n)throw Error(D(425))}function Kh(){}var zw=null,Uw=null;function jw(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Bw=typeof setTimeout=="function"?setTimeout:void 0,z3=typeof clearTimeout=="function"?clearTimeout:void 0,v1=typeof Promise=="function"?Promise:void 0,U3=typeof queueMicrotask=="function"?queueMicrotask:typeof v1<"u"?function(t){return v1.resolve(null).then(t).catch(j3)}:Bw;function j3(t){setTimeout(function(){throw t})}function cw(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(i===0){t.removeChild(r),Zc(e);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=r}while(n);Zc(e)}function cs(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function w1(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Ga=Math.random().toString(36).slice(2),Yi="__reactFiber$"+Ga,iu="__reactProps$"+Ga,Tr="__reactContainer$"+Ga,Hw="__reactEvents$"+Ga,B3="__reactListeners$"+Ga,H3="__reactHandles$"+Ga;function to(t){var e=t[Yi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Tr]||n[Yi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=w1(t);t!==null;){if(n=t[Yi])return n;t=w1(t)}return e}t=n,n=t.parentNode}return null}function pu(t){return t=t[Yi]||t[Tr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Pa(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(D(33))}function ff(t){return t[iu]||null}var qw=[],Ca=-1;function ys(t){return{current:t}}function Ue(t){0>Ca||(t.current=qw[Ca],qw[Ca]=null,Ca--)}function De(t,e){Ca++,qw[Ca]=t.current,t.current=e}var ms={},qt=ys(ms),wn=ys(!1),oo=ms;function Ua(t,e){var n=t.type.contextTypes;if(!n)return ms;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function _n(t){return t=t.childContextTypes,t!=null}function Gh(){Ue(wn),Ue(qt)}function _1(t,e,n){if(qt.current!==ms)throw Error(D(168));De(qt,e),De(wn,n)}function HP(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(D(108,$F(t)||"Unknown",r));return Ye({},n,i)}function Yh(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ms,oo=qt.current,De(qt,t),De(wn,wn.current),!0}function b1(t,e,n){var i=t.stateNode;if(!i)throw Error(D(169));n?(t=HP(t,e,oo),i.__reactInternalMemoizedMergedChildContext=t,Ue(wn),Ue(qt),De(qt,t)):Ue(wn),De(wn,n)}var wr=null,mf=!1,uw=!1;function qP(t){wr===null?wr=[t]:wr.push(t)}function q3(t){mf=!0,qP(t)}function vs(){if(!uw&&wr!==null){uw=!0;var t=0,e=Ce;try{var n=wr;for(Ce=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}wr=null,mf=!1}catch(r){throw wr!==null&&(wr=wr.slice(t+1)),gP(v_,vs),r}finally{Ce=e,uw=!1}}return null}var Ma=[],$a=0,Qh=null,Xh=0,ni=[],ii=0,ao=null,_r=1,br="";function Js(t,e){Ma[$a++]=Xh,Ma[$a++]=Qh,Qh=t,Xh=e}function WP(t,e,n){ni[ii++]=_r,ni[ii++]=br,ni[ii++]=ao,ao=t;var i=_r;t=br;var r=32-Mi(i)-1;i&=~(1<<r),n+=1;var s=32-Mi(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,_r=1<<32-Mi(e)+r|n<<r|i,br=s+t}else _r=1<<s|n<<r|i,br=t}function P_(t){t.return!==null&&(Js(t,1),WP(t,1,0))}function C_(t){for(;t===Qh;)Qh=Ma[--$a],Ma[$a]=null,Xh=Ma[--$a],Ma[$a]=null;for(;t===ao;)ao=ni[--ii],ni[ii]=null,br=ni[--ii],ni[ii]=null,_r=ni[--ii],ni[ii]=null}var An=null,Ln=null,qe=!1,Ci=null;function KP(t,e){var n=ri(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletio
9 months ago
Error generating stack: `+s.message+`
8 months ago
`+s.stack}return{value:t,source:e,stack:r,digest:null}}function mw(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Xw(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var eV=typeof WeakMap=="function"?WeakMap:Map;function bC(t,e,n){n=xr(-1,n),n.tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){of||(of=!0,a_=i),Xw(t,e)},n}function xC(t,e,n){n=xr(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){Xw(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Xw(t,e),typeof i!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function R1(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new eV;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=fV.bind(null,t,e,n),e.then(t,t))}function I1(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function L1(t,e,n,i,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=xr(-1,1),e.tag=2,us(n,e,1))),n.lanes|=1),t)}var tV=Pr.ReactCurrentOwner,vn=!1;function Jt(t,e,n,i){e.child=t===null?eC(e,null,n,i):Ba(e,t.child,n,i)}function A1(t,e,n,i,r){n=n.render;var s=e.ref;return Fa(e,r),i=V_(t,e,n,i,s,r),n=z_(),t!==null&&!vn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Sr(t,e,r)):(qe&&n&&P_(e),e.flags|=1,Jt(t,e,i,r),e.child)}function D1(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Q_(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,kC(t,e,s,i,r)):(t=Fh(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:eu,n(o,i)&&t.ref===e.ref)return Sr(t,e,r)}return e.flags|=1,t=hs(s,i),t.ref=e.ref,t.return=e,e.child=t}function kC(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(eu(s,i)&&t.ref===e.ref)if(vn=!1,e.pendingProps=i=s,(t.lanes&r)!==0)t.flags&131072&&(vn=!0);else return e.lanes=t.lanes,Sr(t,e,r)}return Zw(t,e,n,i,r)}function TC(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(La,In),In|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,De(La,In),In|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:n,De(La,In),In|=i}else s!==null?(i=s.baseLanes|n,e.memoizedState=null):i=n,De(La,In),In|=i;return Jt(t,e,r,n),e.child}function EC(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Zw(t,e,n,i,r){var s=_n(n)?oo:qt.current;return s=Ua(e,s),Fa(e,r),n=V_(t,e,n,i,s,r),i=z_(),t!==null&&!vn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Sr(t,e,r)):(qe&&i&&P_(e),e.flags|=1,Jt(t,e,n,r),e.child)}function N1(t,e,n,i,r){if(_n(n)){var s=!0;Yh(e)}else s=!1;if(Fa(e,r),e.stateNode===null)Dh(t,e),ZP(e,n,i),Qw(e,n,i,r),i=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=oi(c):(c=_n(n)?oo:qt.current,c=Ua(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==c)&&P1(e,o,i,c),ts=!1;var p=e.memoizedState;o.state=p,ef(e,i,o,r),l=e.memoizedState,a!==i||p!==l||wn.current||ts?(typeof u=="function"&&(Yw(e,n,u,i),l=e.memoizedState),(a=ts||S1(e,n,a,i,p,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.
`:"")+e;else if(e.includes(B5)){let i=this.o(e,n);i&&(this.a=new Rr(i[0],i[1],i[2].join(" ")),this.a.id=this.l,this.c=rl.Cue)}this.l=e}o(e,n){return super.o(e.replace(j5,"."),n)}}});var Ab={};zt(Ab,{ParseErrorBuilder:()=>q5});var q5,Db=at(()=>{"use strict";Cu();q5={p(){return new Tn({code:ui.BadSignature,reason:"missing WEBVTT file header",line:1})},q(t,e){return new Tn({code:ui.BadTimestamp,reason:`cue start timestamp \`${t}\` is invalid on line ${e}`,line:e})},r(t,e){return new Tn({code:ui.BadTimestamp,reason:`cue end timestamp \`${t}\` is invalid on line ${e}`,line:e})},s(t,e,n){return new Tn({code:ui.BadTimestamp,reason:`cue end timestamp \`${e}\` is greater than start \`${t}\` on line ${n}`,line:n})},w(t,e,n){return new Tn({code:ui.BadSettingValue,reason:`invalid value for cue setting \`${t}\` on line ${n} (value: ${e})`,line:n})},v(t,e,n){return new Tn({code:ui.UnknownSetting,reason:`unknown cue setting \`${t}\` on line ${n} (value: ${e})`,line:n})},u(t,e,n){return new Tn({code:ui.BadSettingValue,reason:`invalid value for region setting \`${t}\` on line ${n} (value: ${e})`,line:n})},t(t,e,n){return new Tn({code:ui.UnknownSetting,reason:`unknown region setting \`${t}\` on line ${n} (value: ${e})`,line:n})},T(t,e){return new Tn({code:ui.BadFormat,reason:`format missing for \`${t}\` block on line ${e}`,line:e})}}});var e$={};zt(e$,{SSAParser:()=>Kf,default:()=>W5});function Ob(t){let e=parseInt(t.replace("&H",""),16);if(e>=0){let i=(e>>24&255^255)/255,r=e>>16&255,s=e>>8&255;return"rgba("+[e&255,s,r,i].join(",")+")"}return null}function Fb(t,e,n){let i=Math.ceil(2*Math.PI*t),r="";for(let s=0;s<i;s++){let o=2*Math.PI*s/i;r+=t*Math.cos(o)+"px "+e*Math.sin(o)+"px 0 "+n+(s==i-1?"":",")}return r}function W5(){return new Kf}var qf,YM,QM,Wf,XM,ZM,JM,Nb,Kf,t$=at(()=>{"use strict";Cu();qf=/^Format:[\s\t]*/,YM=/^Style:[\s\t]*/,QM=/^Dialogue:[\s\t]*/,Wf=/[\s\t]*,[\s\t]*/,XM=/\{[^}]+\}/g,ZM=/\\N/g,JM=/^\[(.*)[\s\t]?Styles\]$/,Nb=/^\[(.*)[\s\t]?Events\]$/,Kf=class{constructor(){E(this,"f");E(this,"O",0);E(this,"a",null);E(this,"j",[]);E(this,"k",[]);E(this,"N",null);E(this,"d");E(this,"P",{})}async init(e){this.f=e,e.errors&&(this.d=(await Promise.resolve().then(()=>(Db(),Ab))).ParseErrorBuilder)}parse(e,n){if(this.O)switch(this.O){case 1:if(e==="")this.O=0;else if(YM.test(e))if(this.N){let i=e.replace(YM,"").split(Wf);this.S(i)}else this.e(this.d?.T("Style",n));else qf.test(e)?this.N=e.replace(qf,"").split(Wf):Nb.test(e)&&(this.N=null,this.O=2);break;case 2:if(e==="")this.Q();else if(QM.test(e))if(this.Q(),this.N){let i=e.replace(QM,"").split(Wf),r=this.U(i,n);r&&(this.a=r)}else this.e(this.d?.T("Dialogue",n));else this.a?this.a.text+=`
`+e.replace(XM,"").replace(ZM,`
`):qf.test(e)?this.N=e.replace(qf,"").split(Wf):JM.test(e)?(this.N=null,this.O=1):Nb.test(e)&&(this.N=null)}else e===""||(JM.test(e)?(this.N=null,this.O=1):Nb.test(e)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.j,regions:[],errors:this.k}}Q(){this.a&&(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null)}S(e){let n="Default",i={},r,s="center",o="bottom",a,l=1.2,c,u,d=3,p=[];for(let h=0;h<this.N.length;h++){let m=this.N[h],v=e[h];switch(m){case"Name":n=v;break;case"Fontname":i["font-family"]=v;break;case"Fontsize":i["font-size"]=`calc(${v} / var(--overlay-height))`;break;case"PrimaryColour":let w=Ob(v);w&&(i["--cue-color"]=w);break;case"BorderStyle":d=parseInt(v,10);break;case"BackColour":u=Ob(v);break;case"OutlineColour":let f=Ob(v);f&&(c=f);break;case"Bold":parseInt(v)&&(i["font-weight"]="bold");break;case"Italic":parseInt(v)&&(i["font-style"]="italic");break;case"Underline":parseInt(v)&&(i["text-decoration"]="underline");break;case"StrikeOut":parseInt(v)&&(i["text-decoration"]="line-through");break;case"Spacing":i["letter-spacing"]=v+"px";break;case"AlphaLevel":i.opacity=parseFloat(v);break;case"ScaleX":p.push(`scaleX(${parseFloat(v)/100})`);break;case"ScaleY":p.push(`scaleY(${parseFloat(v)/100})`);break;case"Angle":p.push(`rotate(${v}deg)`);break;case"Shadow":l=parseInt(v,10)*1.2;break;case"MarginL":i["--cue-width"]="auto",i["--cue-left"]=parseFloat(v)+"px";break;case"MarginR":i["--cue-width"]="auto",i["--cue-right"]=parseFloat(v)+"px";break;case"MarginV":a=parseFloat(v);break;case"Outline":r=parseInt(v,10);break;case"Alignment":let g=parseInt(v,10);switch(g>=4&&(o=g>=7?"top":"center"),g%3){case 1:s="start";break;case 2:s="center";break;case 3:s="end";break}}}if(i.R=o,i["--cue-white-space"]="normal",i["--cue-line-height"]="normal",i["--cue-text-align"]=s,o==="center"?(i["--cue-top"]="50%",p.push("translateY(-50%)")):i[`--cue-${o}`]=(a||0)+"px",d===1&&(i["--cue-padding-y"]="0"),(d===1||u)&&(i["--cue-bg-color"]=d===1?"none":u),d===3&&c&&(i["--cue-outline"]=`${r}px solid ${c}`),d===1&&typeof r=="number"){let h=u??"#000";i["--cue-text-shadow"]=[c&&Fb(r*1.2,l*1.2,c),c?Fb(r*(r/2),l*(r/2),h):Fb(r,l,h)].filter(Boolean).join(", ")}p.length&&(i["--cue-transform"]=p.join(" ")),this.P[n]=i}U(e,n){let i=this.V(e),r=this.o(i.Start,i.End,n);if(!r)return;let s=new Rr(r[0],r[1],""),o={...this.P[i.Style]||{}},a=i.Name?`<v ${i.Name}>`:"",l=o.R,c=i.MarginL&&parseFloat(i.MarginL),u=i.MarginR&&parseFloat(i.MarginR),d=i.MarginV&&parseFloat(i.MarginV);return c&&(o["--cue-width"]="auto",o["--cue-left"]=c+"px"),u&&(o["--cue-width"]="auto",o["--cue-right"]=u+"px"),d&&l!=="center"&&(o[`--cue-${l}`]=d+"px"),s.text=a+e.slice(this.N.length-1).join(", ").replace(XM,"").replace(ZM,`
`),delete o.R,Object.keys(o).length&&(s.style=o),s}V(e){let n={};for(let i=0;i<this.N.length;i++)n[this.N[i]]=e[i];return n}o(e,n,i){let r=Ir(e),s=Ir(n);if(r!==null&&s!==null&&s>r)return[r,s];r===null&&this.e(this.d?.q(e,i)),s===null&&this.e(this.d?.r(n,i)),r!=null&&s!==null&&s>r&&this.e(this.d?.s(r,s,i))}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}}});async function a$(t,e){let n=new ReadableStream({start(i){let r=t.split(o$);for(let s of r)i.enqueue(s);i.close()}});return Xf(n,e)}async function Xf(t,e){let n=e?.type??"vtt",i;if(typeof n=="string")switch(n){case"srt":i=(await Promise.resolve().then(()=>(GM(),KM))).default;break;case"ssa":case"ass":i=(await Promise.resolve().then(()=>(t$(),e$))).default;break;default:i=(await Promise.resolve().then(function(){return uz})).default}else i=n;let r,s=t.getReader(),o=i(),a=!!e?.strict||!!e?.errors;await o.init({strict:!1,...e,errors:a,type:n,cancel(){s.cancel(),r=o.done(!0)}});let l=1;for(;;){let{value:c,done:u}=await s.read();if(u){o.parse("",l),r=o.done(!1);break}o.parse(c,l),l++}return r}async function l$(t,e){let n=await t;if(!n.ok||!n.body)return{metadata:{},cues:[],regions:[],errors:[void 0]};let i=n.headers.get("content-type")||"",r=i.match(/text\/(.*?)(?:;|$)/)?.[1],s=i.match(/charset=(.*?)(?:;|$)/)?.[1];return jb(n.body,{type:r,encoding:s,...e})}async function jb(t,{encoding:e="utf-8",...n}={}){let i=t.pipeThrough(new zb(e));return Xf(i,n)}function Y5(t){let e=parseInt(t,10);return Number.isNaN(e)?null:e}function $u(t){let e=parseInt(t.replace(G5,""),10);return!Number.isNaN(e)&&e>=0&&e<=100?e:null}function i$(t){if(!t.includes(n$))return null;let[e,n]=t.split(n$).map($u);return e!==null&&n!==null?[e,n]:null}function Q5(t){let e=parseFloat(t);return Number.isNaN(e)?null:e}function Ir(t){let e=t.match(lz);if(!e)return null;let n=e[1]?parseInt(e[1],10):0,i=parseInt(e[2],10),r=parseInt(e[3],10),s=e[4]?parseInt(e[4].padEnd(3,"0"),10):0,o=n*3600+i*60+r+s/1e3;return n<0||i<0||r<0||s<0||i>59||r>59?null:o}function cz(){return new sl}function Hb(t){let e="",n=1,i=[],r=[],s;for(let c=0;c<t.text.length;c++){let u=t.text[c];switch(n){case 1:u==="<"?(l(),n=2):e+=u;break;case 2:switch(u){case`
`:case" ":case" ":o(),n=4;break;case".":o(),n=3;break;case"/":n=5;break;case">":o(),n=1;break;default:!e&&dz.test(u)&&(n=6),e+=u;break}break;case 3:switch(u){case" ":case" ":case`
`:a(),s&&s.class?.trim(),n=4;break;case".":a();break;case">":a(),s&&s.class?.trim(),n=1;break;default:e+=u}break;case 4:u===">"?(e=e.replace(pz," "),s?.type==="v"?s.voice=Vb(e):s?.type==="lang"&&(s.lang=Vb(e)),e="",n=1):e+=u;break;case 5:u===">"&&(e="",s=r.pop(),n=1);break;case 6:if(u===">"){let d=Ir(e);d!==null&&d>=t.startTime&&d<=t.endTime&&(e="timestamp",o(),s.time=d),e="",n=1}else e+=u;break}}function o(){if(gz.has(e)){let c=s;s=yz(e),c?(r[r.length-1]!==c&&r.push(c),c.children.push(s)):i.push(s)}e="",n=1}function a(){if(s&&e){let c=e.replace("bg_","");mz.has(c)?s[e.startsWith("bg_")?"bgColor":"color"]=c:s.class=s.class?s.class+" "+e:e}e=""}function l(){if(!e)return;let c={type:"text",data:Vb(e)};s?s.children.push(c):i.push(c),e=""}return n===1&&l(),i}function yz(t){return{tagName:c$[t],type:t,children:[]}}function Vb(t){return t.replace(fz,e=>hz[e]||"'")}function ln(t,e,n){t.style.setProperty(`--${e}`,n+"")}function xs(t,e,n=!0){t.setAttribute(`data-${e}`,n===!0?"":n+"")}function Gf(t,e){t.setAttribute("data-part",e)}function vz(t){return parseFloat(getComputedStyle(t).lineHeight)||0}function u$(t){if(Bb)throw Error("[media-captions] called `createVTTCueTemplate` on the server - use `renderVTTCueString`");let e=document.createElement("template");return e.innerHTML=Zf(t),{cue:t,content:e.content}}function Zf(t,e=0){return Jf(Hb(t),e)}function Jf(t,e=0){let n,i="";for(let r of t)if(r.type==="text")i+=r.data;else{let s=r.type==="timestamp";n={},n.class=r.class,n.title=r.type==="v"&&r.voice,n.lang=r.type==="lang"&&r.lang,n["data-part"]=r.type==="v"&&"voice",s&&(n["data-part"]="timed",n["data-time"]=r.time,n["data-future"]=r.time>e,n["data-past"]=r.time<e),n.style=`${r.color?`color: ${r.color};`:""}${r.bgColor?`background-color: ${r.bgColor};`:""}`;let o=Object.entries(n).filter(a=>a[1]).map(a=>`${a[0]}="${a[1]===!0?"":a[1]}"`).join(" ");i+=`<${r.tagName}${o?" "+o:""}>${Jf(r.children)}</${r.tagName}>`}return i}function qb(t,e){if(!Bb)for(let n of t.querySelectorAll('[data-part="timed"]')){let i=Number(n.getAttribute("data-time"));Number.isNaN(i)||(i>e?xs(n,"future"):n.removeAttribute("data-future"),i<e?xs(n,"past"):n.removeAttribute("data-past"))}}function wz(t,e){let n=null,i;function r(){s(),t(...i),i=void 0}function s(){clearTimeout(n),n=null}function o(){i=[].slice.call(arguments),s(),n=setTimeout(r,e)}return o}function Wb(t){return t instanceof HTMLElement?{top:t.offsetTop,width:t.clientWidth,height:t.clientHeight,left:t.offsetLeft,right:t.offsetLeft+t.clientWidth,bottom:t.offsetTop+t.clientHeight}:{...t}}function Yf(t,e,n){switch(e){case"+x":t.left+=n,t.right+=n;break;case"-x":t.left-=n,t.right-=n;break;case"+y":t.top+=n,t.bottom+=n;break;case"-y":t.top-=n,t.bottom-=n;break}}function _z(t,e){return t.left<=e.right&&t.right>=e.left&&t.top<=e.bottom&&t.bottom>=e.top}function bz(t,e){for(let n=0;n<e.length;n++)if(_z(t,e[n]))return e[n];return null}function s$(t,e){return e.top>=0&&e.bottom<=t.height&&e.left>=0&&e.right<=t.width}function xz(t,e,n){switch(n){case"+x":return e.left<0;case"-x":return e.right>t.width;case"+y":return e.top<0;case"-y":return e.bottom>t.height}}function kz(t,e){let n=Math.max(0,Math.min(t.width,e.right)-Math.max(0,e.left)),i=Math.max(0,Math.min(t.height,e.bottom)-Math.max(0,e.top));return n*i/(t.height*t.width)}function Kb(t,e){return{top:e.top/t.height,left:e.left/t.width,right:(t.width-e.right)/t.width,bottom:(t.height-e.bottom)/t.height}}function d$(t,e){return e.top=e.top*t.height,e.left=e.left*t.width,e.right=t.width-e.right*t.width,e.bottom=t.height-e.bottom*t.height,e}function h$(t,e,n,i){let r=Kb(e,n);for(let s of p$)ln(t,`${i}-${s}`,r[s]*100+"%")}function f$(t,e,n,i){let r=1,s,o={...e};for(let a=0;a<i.length;a++){for(;xz(t,e,i[a])||s$(t,e)&&bz(e,n);)Yf(e,i[a],1);if(s$(t,e))return e;let l=kz(t,e);r>l&&(s={...e},r=l),e={...o}}return s||o}function Tz(t,e,n,i){let r=n.firstElementChild,s=Pz(e),o,a=[];if(n[ks]||(n[ks]=Ez(t,n)),o=d$(t,{...n[ks]}),n[Ru])a=[n[Ru]==="top"?"+y":"-y","+x","-x"];else if(e.snapToLines){let l;switch(e.vertical){case"":a=["+y","-y"],l="height";break;case"rl":a=["+x
`:"")+e}break;case 3:this.n(e.split(Mu),n);break}else if(e.startsWith(ez))this.c=4;else if(e.startsWith(tz))this.c=3,this.b=new Lu,this.n(e.replace(nz,"").split(Mu),n);else if(e.includes(iz)){let i=this.o(e,n);i&&(this.a=new Rr(i[0],i[1],""),this.a.id=this.l,this.m(i[2],n)),this.c=2}else n===1&&this.i(e,n);this.l=e}done(){return{metadata:this.g,cues:this.j,regions:Object.values(this.h),errors:this.k}}i(e,n){if(n>1){if(ol.test(e)){let[i,r]=e.split(ol);i&&(this.g[i]=(r||"").replace(Mu,""))}}else e.startsWith(X5)?this.c=1:this.e(this.d?.p())}o(e,n){let[i,r=""]=e.split(rz),[s,...o]=r.split(Mu),a=Ir(i),l=Ir(s);if(a!==null&&l!==null&&l>a)return[a,l,o];a===null&&this.e(this.d?.q(i,n)),l===null&&this.e(this.d?.r(s,n)),a!=null&&l!==null&&l>a&&this.e(this.d?.s(a,l,n))}n(e,n){let i;for(let r=0;r<e.length;r++)if(ol.test(e[r])){i=!1;let[s,o]=e[r].split(ol);switch(s){case"id":this.b.id=o;break;case"width":let a=$u(o);a!==null?this.b.width=a:i=!0;break;case"lines":let l=Y5(o);l!==null?this.b.lines=l:i=!0;break;case"regionanchor":let c=i$(o);c!==null?(this.b.regionAnchorX=c[0],this.b.regionAnchorY=c[1]):i=!0;break;case"viewportanchor":let u=i$(o);u!==null?(this.b.viewportAnchorX=u[0],this.b.viewportAnchorY=u[1]):i=!0;break;case"scroll":o==="up"?this.b.scroll="up":i=!0;break;default:this.e(this.d?.t(s,o,n))}i&&this.e(this.d?.u(s,o,n))}}m(e,n){let i;for(let r=0;r<e.length;r++)if(i=!1,ol.test(e[r])){let[s,o]=e[r].split(ol);switch(s){case"region":let a=this.h[o];a&&(this.a.region=a);break;case"vertical":o==="lr"||o==="rl"?(this.a.vertical=o,this.a.region=null):i=!0;break;case"line":let[l,c]=o.split(r$);if(l.includes(Z5)){let m=$u(l);m!==null?(this.a.line=m,this.a.snapToLines=!1):i=!0}else{let m=Q5(l);m!==null?this.a.line=m:i=!0}oz.test(c)?this.a.lineAlign=c:c&&(i=!0),this.a.line!=="auto"&&(this.a.region=null);break;case"position":let[u,d]=o.split(r$),p=$u(u);p!==null?this.a.position=p:i=!0,d&&az.test(d)?this.a.positionAlign=d:d&&(i=!0);break;case"size":let h=$u(o);h!==null?(this.a.size=h,h<100&&(this.a.region=null)):i=!0;break;case"align":sz.test(o)?this.a.align=o:i=!0;break;default:this.e(this.d?.v(s,o,n))}i&&this.e(this.d?.w(s,o,n))}}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}};uz=Object.freeze({__proto__:null,VTTBlock:rl,VTTParser:sl,default:cz,parseVTTTimestamp:Ir}),dz=/[0-9]/,pz=/[\s\t]+/,c$={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},hz={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":"\xA0","&lrm;":"\u200E","&rlm;":"\u200F"},fz=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,mz=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),gz=new Set(Object.keys(c$));ks=Symbol(0);p$=["top","left","right","bottom"];Ru=Symbol(0);$z=["-y","+y","-x","+x"];Qf=class{constructor(e,n){E(this,"overlay");E(this,"z");E(this,"A",0);E(this,"C","ltr");E(this,"B",[]);E(this,"D",!1);E(this,"E");E(this,"h",new Map);E(this,"j",new Map);E(this,"K",wz(()=>{this.D=!1,this.G();for(let e of this.h.values())e[ks]=null;for(let e of this.j.values())e&&(e[ks]=null);this.H(!0)},50));this.overlay=e,this.dir=n?.dir??"ltr",e.setAttribute("translate","yes"),e.setAttribute("aria-live","off"),e.setAttribute("aria-atomic","true"),Gf(e,"captions"),this.G(),this.E=new ResizeObserver(this.I.bind(this)),this.E.observe(e)}get dir(){return this.C}set dir(e){this.C=e,xs(this.overlay,"dir",e)}get currentTime(){return this.A}set currentTime(e){this.A=e,this.update()}changeTrack({regions:e,cues:n}){this.reset(),this.J(e);for(let i of n)this.j.set(i,null);this.update()}addCue(e){this.j.set(e,null),this.update()}removeCue(e){this.j.delete(e),this.update()}update(e=!1){this.H(e)}reset(){this.j.clear(),this.h.clear(),this.B=[],this.overlay.textContent=""}destroy(){this.reset(),this.E.disconnect()}I(){this.D=!0,this.K()}G(){this.z=Wb(this.overlay),ln(this.overlay,"overlay-width",this.z.width+"px"),ln(this.overlay,"overlay-height",this.z.height+"px")}H(e=!1){if(!this.j.size||this.D)return;let n,i=[...this.j.keys()].filter(s=>this.A>=s.startTime&&this.A<=s.endTime).sort
`)[1].trim():null}function r6(t){let e=t.split(`
`);for(let n of e)if(n.startsWith("#EXT-X-TARGETDURATION")){let i=parseFloat(n.split(":")[1]);if(!isNaN(i))return i}return-1}function Q$(t){return(ut(t)?t:[!Z(t)&&"src"in t?t:{src:t}]).map(({src:e,type:n,...i})=>({src:e,type:n??(Z(e)?OR.get(e):null)??(!Z(e)||e.startsWith("blob:")?"video/object":e.includes("youtube")?"video/youtube":e.includes("vimeo")?"video/vimeo":"?"),...i})).sort(e=>e.type==="?"?1:-1)}function X$(t,e){return t?.src===e?.src&&t?.type===e?.type}function p6(t){return t?"true":"false"}function Pn(t){return()=>p6(t())}function Z$(t,e,n){let i=e-t,r=n-t;return i>0?r/i:0}function h6(t,e,n,i){return ok(t,cn(n,em(i)),e)}function f6(t,e,n,i){let r=ok(0,n,1),s=e-t,o=s*r,a=o/i,l=i*a;return t+l}function $x(t,e){let n=String(t),i=n.length;if(i<e){let s=e-i;return`${"0".repeat(s)}${t}`}return n}function FR(t){let e=Math.trunc(t/3600),n=Math.trunc(t%3600/60),i=Math.trunc(t%60),r=Number((t-Math.trunc(t)).toPrecision(3));return{hours:e,minutes:n,seconds:i,fraction:r}}function Ms(t,e=null,n=null,i=!1){let{hours:r,minutes:s,seconds:o}=FR(t),a=e?$x(r,2):r,l=n||Ji(n)&&t>=3600?$x(s,2):s,c=$x(o,2);return r>0||i?`${a}:${l}:${c}`:`${l}:${c}`}function Yu(t){let e=[],{hours:n,minutes:i,seconds:r}=FR(t);return n>0&&e.push(`${n} hour`),i>0&&e.push(`${i} min`),(r>0||e.length===0)&&e.push(`${r} sec`),e.join(" ")}function ak(t,{clamp:e,offset:n,orientation:i}){let r=getComputedStyle(t),s=parseFloat(r.width),o=parseFloat(r.height),a={top:null,right:null,bottom:null,left:null};if(a[i==="horizontal"?"bottom":"left"]=`calc(100% + var(--media-slider-preview-offset, ${n}px))`,i==="horizontal"){let l=s/2;if(!e)a.left=`calc(var(--slider-pointer) - ${l}px)`;else{let c=`max(0px, calc(var(--slider-pointer) - ${l}px))`,u=`calc(100% - ${s}px)`;a.left=`min(${c}, ${u})`}}else{let l=o/2;if(!e)a.bottom=`calc(var(--slider-pointer) - ${l}px)`;else{let c=`max(${l}px, calc(var(--slider-pointer) - ${l}px))`,u=`calc(100% - ${o}px)`;a.bottom=`min(${c}, ${u})`}}Object.assign(t.style,a)}function G6(t){return je.isValidElement(t)&&t.type===K6}function Y6(t,e){let n={...e};for(let i in e){let r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{s(...a),r(...a)}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function UR(t){return t?.$$PROVIDER_TYPE==="REMOTION"}function Oe(t,e){let n=ws($o);return Me((e?.current?.$state||n||X6)[t])}var je,Kz,Gz,Yz,Qz,Xz,Zz,Jz,e4,t4,n4,i4,le,L$,Bu,jn,A$,D$,N$,Sn,di,_o,vm,wm,B,r4,dm,F$,Fu,Xb,sR,Zx,Te,hm,c4,u4,d4,p4,h4,f4,m4,se,V$,z$,U$,zn,g4,$o,y4,Id,hl,Lx,ul,xm,fm,Ts,x4,T4,S4,N4,F4,U4,Nr,Tm,Ad,Em,Ax,Sm,ik,Pm,Uu,Cm,Mm,q4,W4,Un,$m,SR,W$,K4,K$,Dx,G4,Rm,PR,CR,MR,$R,RR,IR,Im,qu,LR,DR,Lm,Am,Cx,Q4,X4,Dm,Nx,Ox,Nm,Fx,Vx,Z4,zx,Ux,J4,Om,Hn,e6,t6,Be,Re,n6,OR,Bx,Hx,s6,o6,a6,ml,Fm,Vm,zm,pl,l6,Um,jm,Wu,Mt,c6,u6,d6,Ku,Bm,Hm,qm,Wm,Km,Gm,Ym,Qm,Xm,cg,J$,qx,Gu,ug,rr,Or,Ar,gm,Zm,gl,Jm,m6,g6,y6,xo,v6,w6,_6,yl,Qu,Xu,vl,b6,x6,dg,Fr,Ft,k6,eR,Wx,T6,E6,Dd,S6,Vr,P6,C6,M6,ko,eg,tg,ju,Zu,Kx,Ps,$6,R6,VR,wl,I6,L6,A6,_l,D6,N6,lk,To,O6,F6,ck,Eo,V6,z6,uk,So,U6,j6,dk,Po,B6,H6,pk,Co,ng,Gx,ig,Ju,ed,q6,W6,Yx,Mo,rg,td,nd,sg,id,rd,sd,od,ad,ld,cd,ud,dd,pd,hd,fd,md,gd,yd,vd,wd,_d,bd,xd,kd,Td,Ed,Sd,Pd,Cd,Md,$d,og,bl,Rd,zR,Qx,K6,Q6,te,tR,X6,En=at(()=>{"use strict";"use client";je=A(X(),1);an();Gz=Symbol(0);Kz=Gz;Yz=Symbol(0),Qz=Symbol(0),Xz=Symbol(0),Zz=Symbol(0),Jz=Symbol(0),e4=Symbol(0),t4=Symbol(0),n4=Symbol(0),i4=Symbol(0),le={_add:Yz,_remove:Qz,_reset:Xz,_select:Zz,_readonly:Jz,_setReadonly:e4,_onReset:t4,_onRemove:n4,_onUserSelect:i4},Bu=class extends Za{constructor(){super(...arguments),this._items=[],this[L$]=!1}get length(){return this._items.length}get readonly(){return this[le._readonly]}toArray(){return[...this._items]}[(L$=le._readonly,Symbol.iterator)](){return this._items.values()}[le._add](e,n){let i=this._items.length;""+i in this||Object.defineProperty(this,i,{get(){return this._items[i]}}),!this._items.includes(e)&&(this._items.push(e),this.dispatchEvent(new ne("add",{detail:e,trigger:n})))}[le._remove](e,n){let i=this._items.indexOf(e);i>=0&&(this[le._onRemove]?.(e,n),this._items.splice(
`],{type:"text/vtt"});n.src=URL.createObjectURL(o),n.addEventListener("load",s),n.addEventListener("error",s)}return n.label=e.label,n.kind=e.kind,n.default=i,e.language&&(n.srclang=e.language),i&&!r&&this._copyCues(e,n.track),n}_copyCues(e,n){if(!(e.src&&e.type==="vtt"||n.cues?.length))for(let i of e.cues)n.addCue(i)}_onChange(e){for(let n of this._tracks){let i=n[se._native]?.track;if(!i)continue;if(!this._display){i.mode="disabled";continue}let r=i.mode==="showing";r&&this._copyCues(n,i),n.setMode(r?"showing":"disabled",e)}}},Sm=class{constructor(e){this._media=e,this._video=null,this._renderers=[],this._nativeDisplay=!1,this._nativeRenderer=null,this._customRenderer=null;let n=e.textTracks;this._textTracks=n,S(this._watchControls.bind(this)),ae(this._detach.bind(this)),L(n,"add",this._onAddTrack.bind(this)),L(n,"remove",this._onRemoveTrack.bind(this)),L(n,"mode-change",this._update.bind(this))}_watchControls(){let{$state:e,$iosControls:n}=this._media;this._nativeDisplay=e.controls()||n(),this._update()}add(e){this._renderers.push(e),this._update()}remove(e){e.detach(),this._renderers.splice(this._renderers.indexOf(e),1),this._update()}_attachVideo(e){requestAnimationFrame(()=>{if(this._video=e,e){this._nativeRenderer=new Ax,this._nativeRenderer.attach(e);for(let n of this._textTracks)this._addNativeTrack(n)}this._update()})}_addNativeTrack(e){pt(e)&&this._nativeRenderer?.addTrack(e)}_removeNativeTrack(e){pt(e)&&this._nativeRenderer?.removeTrack(e)}_onAddTrack(e){this._addNativeTrack(e.detail)}_onRemoveTrack(e){this._removeNativeTrack(e.detail)}_update(){let e=this._textTracks.selected;if(this._video&&(this._nativeDisplay||e?.[se._nativeHLS])){this._customRenderer?.changeTrack(null),this._nativeRenderer?.setDisplay(!0),this._nativeRenderer?.changeTrack(e);return}if(this._nativeRenderer?.setDisplay(!1),this._nativeRenderer?.changeTrack(null),!e){this._customRenderer?.changeTrack(null);return}let n=this._renderers.sort((i,r)=>i.priority-r.priority).find(i=>i.canRender(e,this._video));this._customRenderer!==n&&(this._customRenderer?.detach(),n?.attach(this._video),this._customRenderer=n??null),n?.changeTrack(e)}_detach(){this._nativeRenderer?.detach(),this._nativeRenderer=null,this._customRenderer?.detach(),this._customRenderer=null}},ik=H4;Pm=class extends Bu{constructor(){super(),this._canLoad=!1,this._defaults={},this._storage=null,this._preferredLang=null,this._selectCaptions=ik(async()=>{if(!this._canLoad||this.selected||await this._storage?.getCaptions()===!1)return;!this._preferredLang&&this._storage&&(this._preferredLang=await this._storage.getLang());let e=this._preferredLang&&this._items.find(i=>pt(i)&&i.language===this._preferredLang),n=this._defaults.captions;e?e.mode="showing":n&&n&&(n.mode="showing"),this._storage?.setLang?.(this._preferredLang??n?.language??null)},300),this._onTrackModeChangeBind=this._onTrackModeChange.bind(this)}get selected(){return this._items.find(n=>n.mode==="showing"&&pt(n))??null}get preferredLang(){return this._preferredLang}set preferredLang(e){this._preferredLang=e}add(e,n){let i=e instanceof zn,r=i?e:new zn(e),s=e.kind==="captions"||e.kind==="subtitles"?"captions":e.kind;return this._defaults[s]&&e.default&&delete e.default,r.addEventListener("mode-change",this._onTrackModeChangeBind),this[le._add](r,n),r[se._crossOrigin]=this[se._crossOrigin],this._canLoad&&r[se._canLoad](),e.default&&(this._defaults[s]=r,s!=="captions"?r.mode="showing":this._selectCaptions()),this}remove(e,n){if(this._items.includes(e))return e===this._defaults[e.kind]&&delete this._defaults[e.kind],e.mode="disabled",e[se._onModeChange]=null,e.removeEventListener("mode-change",this._onTrackModeChangeBind),this[le._remove](e,n),this}clear(e){for(let n of[...this._items])this.remove(n,e);return this}getById(e){return this._items.find(n=>n.id===e)??null}getByKind(e){let n=Array.isArray(e)?e:[e];return this._items.filter(i=>n.includes(i.kind))}[se._canLoad](){if(!this._canLoad){for(let e of this._items)e[se._canLoad]();this._canLoad=!0,this._selectCaptions()}}_onTrackModeChange(e){let n=e.detail;if(this._storage
9 months ago
#bilibili-player .bpx-player-control-wrap {
opacity: 0 !important;
}
.mx-show-controls #bilibili-player .bpx-player-control-wrap {
opacity: 100 !important;
}
\`,o=class extends h{findMedia(){return l("#bilibili-player video")}getStyle(){return w}async onload(){this.controller.handle("bili_getManifest",()=>({value:window.player.getManifest()})),localStorage.setItem("recommend_auto_play","close"),localStorage.setItem("bpx_player_profile",JSON.stringify({media:{autoplay:!1}})),await super.onload(),this.revertAutoSeek(),Promise.all([this.toggleDanmaku(!1)]),await this.untilWebFullscreen()}get player(){return this.media.closest("#bilibili-player")}async toggleDanmaku(e){if(window.player){e===void 0&&(e=!window.player.danmaku.isOpen()),e?window.player.danmaku.open():window.player.danmaku.close();return}let t=await l(".bui-danmaku-switch",this.player);if(!t)return;let i=t.querySelector("input.bui-danmaku-switch-input");if(i){if(e===void 0){i.click();return}e!==this.isDanmakuOn(t)&&i.click()}}isDanmakuOn(e){return e.querySelector(".bui-danmaku-switch-off")?.offsetHeight===0}isWebFullscreen(){return this.player.classList.contains("mode-webscreen")}enterWebFullscreen(){this.isWebFullscreen()||l(".bpx-player-ctrl-web",this.player).then(e=>{e.click()})}revertAutoSeek(){let t=this.player.querySelector(".bpx-player-toast-auto");if(!t)return;let i=()=>{this.stateRef.prevSeek&&this.stateRef.prevSeek.time>Date.now()-5e3?this.media.currentTime=this.stateRef.prevSeek.value:this.media.currentTime=0},n=new MutationObserver(u=>{u.find(a=>a.type==="childList"&&a.addedNodes.length>0)?.addedNodes.forEach(a=>{a.textContent?.includes("\\u5DF2\\u4E3A\\u60A8\\u5B9A\\u4F4D\\u81F3")&&(a.style.opacity="0",i())})});n.observe(t,{childList:!0,subtree:!0}),this.register(()=>n.disconnect())}async untilWebFullscreen(){let e=this.player;this.isWebFullscreen()||await new Promise(t=>{let i=new MutationObserver(n=>{n.find(a=>a.type==="attributes"&&a.attributeName==="class"&&e?.classList.contains("mode-webscreen"))&&(i.disconnect(),t(void 0))});i.observe(e,{attributes:!0}),setTimeout(()=>{i.disconnect(),t(void 0)},6e3)})}};
8 months ago
`;var CI=`"use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var o in e)a(r,o,{get:e[o],enumerable:!0})},m=(r,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!d.call(r,t)&&t!==o&&a(r,t,{get:()=>e[t],enumerable:!(s=l(e,t))||s.enumerable});return r};var c=r=>m(a({},"__esModule",{value:!0}),r);var b={};u(b,{default:()=>i});module.exports=c(b);var n=()=>require("media-extended");var y=\`
9 months ago
body:not(.mx-show-controls) .vp-player-ui-overlays {
opacity: 0 !important;
}
\`,{waitForSelector:x,MediaPlugin:M}=n(),i=class extends M{findMedia(){return x("#main [data-player] .vp-video video")}getStyle(){return super.getStyle()+\`
\`+y}};
8 months ago
`;var MI=`"use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var y=(o,t)=>{for(var e in t)d(o,e,{get:t[e],enumerable:!0})},b=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!h.call(o,i)&&i!==e&&d(o,i,{get:()=>t[i],enumerable:!(n=p(t,i))||n.enumerable});return o};var g=o=>b(d({},"__esModule",{value:!0}),o);var x={};y(x,{default:()=>l});module.exports=g(x);var a=()=>require("media-extended");var v=\`
9 months ago
body:not(.mx-player-ready) #movie_player,
ytd-watch-flexy[theater] #movie_player {
position: fixed !important;
top: 0 !important;
left: 0 !important;
width: 100vw !important;
height: 100vh !important;
max-width: none !important;
max-height: none !important;
min-width: 0 !important;
min-height: 0 !important;
margin: 0 !important;
padding: 0 !important;
z-index: 2147483647 !important; /* Ensure it's on top of other elements */
background-color: #000 !important;
transform: none !important;
}
.mx-parent {
overflow: visible !important;
z-index: auto !important;
transform: none !important;
-webkit-transform-style: flat !important;
transition: none !important;
contain: none !important;
}
.mx-absolute {
position: absolute !important;
}
html, body {
overflow: hidden !important;
zoom: 100% !important;
}
.mx-parent video {
object-fit: contain !important;
}
ytd-app .html5-endscreen {
opacity: 0 !important;
}
body:not(.mx-show-controls) ytd-app .ytp-chrome-bottom {
opacity: 0 !important;
}
8 months ago
\`.trim(),w=\`
9 months ago
/* \\u9996\\u9875\\u9876\\u90E8\\u6A2A\\u5E45\\u5E7F\\u544A */
#masthead-ad,
/* \\u9996\\u9875\\u89C6\\u9891\\u6392\\u7248\\u5E7F\\u544A */
ytd-rich-item-renderer.style-scope.ytd-rich-grid-row #content:has(.ytd-display-ad-renderer),
/* \\u64AD\\u653E\\u5668\\u5E95\\u90E8\\u5E7F\\u544A */
.video-ads.ytp-ad-module,
/* \\u64AD\\u653E\\u9875\\u4F1A\\u5458\\u4FC3\\u9500\\u5E7F\\u544A */
tp-yt-paper-dialog:has(yt-mealbar-promo-renderer),
/* \\u64AD\\u653E\\u9875\\u53F3\\u4E0A\\u65B9\\u63A8\\u8350\\u5E7F\\u544A */
ytd-engagement-panel-section-list-renderer[target-id="engagement-panel-ads"],
/* \\u64AD\\u653E\\u9875\\u8BC4\\u8BBA\\u533A\\u53F3\\u4FA7\\u63A8\\u5E7F\\u5E7F\\u544A */
#related #player-ads,
/* \\u64AD\\u653E\\u9875\\u8BC4\\u8BBA\\u533A\\u53F3\\u4FA7\\u89C6\\u9891\\u6392\\u7248\\u5E7F\\u544A */
#related ytd-ad-slot-renderer,
/* \\u641C\\u7D22\\u9875\\u5E7F\\u544A */
ytd-ad-slot-renderer,
/* \\u64AD\\u653E\\u9875\\u4F1A\\u5458\\u63A8\\u8350\\u5E7F\\u544A */
yt-mealbar-promo-renderer,
/* M\\u64AD\\u653E\\u9875\\u7B2C\\u4E09\\u65B9\\u63A8\\u8350\\u5E7F */
ad-slot-renderer,
/* M\\u53EF\\u8DF3\\u8FC7\\u7684\\u89C6\\u9891\\u5E7F\\u544A\\u94FE\\u63A5 */
ytm-companion-ad-renderer {
opacity: 0 !important;
}
8 months ago
\`.trim(),{waitForSelector:s,MediaPlugin:f}=a(),r=class extends f{async findMedia(){let t=await s("ytd-app #movie_player video");if(this.app=t.closest("ytd-app"),this.moviePlayer=t.closest("#movie_player"),!this.app||!this.moviePlayer)throw new Error("Failed to find media");return this.watchIfDetached(),t}watchIfDetached(){let t=this.moviePlayer,e=new MutationObserver(async()=>{if(this.media.isConnected)return;let n=await this.findMedia();n&&this.rehookMediaEl(n)});e.observe(t,{childList:!0,subtree:!0}),this.register(()=>e.disconnect())}getStyle(){return v+\`
\`+w}async onload(){await super.onload(),this.disableAutoPlay(),s("ytd-consent-bump-v2-lightbox",this.app).then(()=>{this.controller.send("mx-open-browser",{message:"Seems like YouTube is showing a consent popup that block playback. To continue playback, you should handle it in dedicated login browser. ",url:"https://youtube.com"})})}app;moviePlayer;async disableAutoPlay(){let e=await s('button.ytp-button[data-tooltip-target-id="ytp-autonav-toggle-button"]',this.app);if(!e)throw new Error("Autoplay button not found");let n=e.querySelector(".ytp-autonav-toggle-button");if(!n)throw new Error("Autoplay button label not found");let i=()=>n.getAttribute("aria-checked")==="true";i()&&(e.click(),await new Promise(m=>{let c=new MutationObserver(()=>{i()||(c.disconnect(),m())});c.observe(n,{attributes:!0})}))}enterWebFullscreen(){this.assignParentClass(this.moviePlayer),(async()=>{let t=await s("#movie_player .ytp-size-button"),e=()=>!!this.app.querySelector("ytd-watch-flexy[theater]");if(!e())do t.click(),await E(200);while(!e());window.dispatchEvent(new Event("resize"))})()}};function E(o){return new Promise(t=>setTimeout(t,o))}var{waitForSelector:M}=a(),l=class extends r{async onload(){await super.onload(),M(".video-ads.ytp-ad-module",this.app).then(t=>this.removePlayerAD(t))}removePlayerAD(t){let e=new MutationObserver(()=>this.skipAd());this.registerInterval(()=>this.skipAd(),500),e.observe(t,{childList:!0,subtree:!0})}skipAd(){let t=this.media,e=this.moviePlayer.querySelector(".ytp-ad-skip-button")||this.moviePlayer.querySelector(".ytp-ad-skip-button-modern"),n=this.moviePlayer.querySelector(".video-ads.ytp-ad-module .ytp-ad-player-overlay");if(t)if(e){if(window.location.href.indexOf("https://m.youtube.com/")===-1&&(t.muted=!0),t.currentTime>.5){t.currentTime=t.duration;return}e.click(),T.call(e)}else n&&(t.currentTime=t.duration)}};function T(){let o=new Touch({identifier:Date.now(),target:this,clientX:12,clientY:34,radiusX:56,radiusY:78,rotationAngle:0,force:1}),t=new TouchEvent("touchstart",{bubbles:!0,cancelable:!0,view:window,touches:[o],targetTouches:[o],changedTouches:[o]});this.dispatchEvent(t);let e=new TouchEvent("touchend",{bubbles:!0,cancelable:!0,view:window,touches:[],targetTouches:[],changedTouches:[o]});this.dispatchEvent(e)}
`;var $I={bilibili:PI,youtube:MI,vimeo:CI,coursera:void 0,generic:void 0};var RI={generic:t=>t,bilibili:t=>t.replaceAll(/[-_]哔哩哔哩.+$|[-_]bilibili.+$|-(?:番剧|电影|纪录片|国创|电视剧|综艺)-.+/g,""),youtube:t=>t.replace(/^\(\d+\) /,"").replace(/ - YouTube$/,""),vimeo:t=>t.replace(/ on Vimeo$/,""),coursera:t=>t.replace(/ \| Coursera$/,"")};function II(t){return`webpage::${btoa(t)}`}function LI(t){return atob(t.replace(/^webpage::/,""))}function AI(t){return typeof t=="string"&&t.startsWith("webpage::")}function DI(t){return t.type==="TimeRanges"}var Sg=class{constructor(e){this.ranges=e}get length(){return this.ranges.length}start(e){return this.ranges[e][0]}end(e){return this.ranges[e][1]}};function Di(t){return DI(t)?new Sg(t.value):t}var{onDispose:Sk,peek:Rj}=bs,Pg=class{constructor(e,n){this._provider=e;this._ctx=n;E(this,"_disposal",SI());E(this,"_waiting",!1);E(this,"_attachedLoadStart",!1);E(this,"_attachedCanPlay",!1);E(this,"_handlers");E(this,"_handleDevEvent");this._attachInitialListeners(),Sk(this._media.on("timeupdate",this._onTimeUpdate.bind(this))),Sk(this._onDispose.bind(this))}get _webview(){return this._provider.webview}get _media(){return this._provider.media}get _notify(){return this._ctx.delegate._notify}_onDispose(){this._attachedLoadStart=!1,this._attachedCanPlay=!1,this._disposal.empty()}_attachInitialListeners(){this._attachEventListener("loadstart",this._onLoadStart),this._attachEventListener("abort",this._onAbort),this._attachEventListener("emptied",this._onEmptied),this._attachEventListener("error",this._onError),this._attachEventListener("volumechange",this._onVolumeChange)}_attachLoadStartListeners(){this._attachedLoadStart||(this._disposal.add(this._attachEventListener("loadeddata",this._onLoadedData),this._attachEventListener("loadedmetadata",this._onLoadedMetadata),this._attachEventListener("canplay",this._onCanPlay),this._attachEventListener("canplaythrough",this._onCanPlayThrough),this._attachEventListener("durationchange",this._onDurationChange),this._attachEventListener("play",this._onPlay),this._attachEventListener("progress",this._onProgress),this._attachEventListener("stalled",this._onStalled),this._attachEventListener("suspend",this._onSuspend)),this._attachedLoadStart=!0)}_attachCanPlayListeners(){this._attachedCanPlay||(this._disposal.add(this._attachEventListener("pause",this._onPause),this._attachEventListener("playing",this._onPlaying),this._attachEventListener("ratechange",this._onRateChange),this._attachEventListener("seeked",this._onSeeked),this._attachEventListener("seeking",this._onSeeking),this._attachEventListener("ended",this._onEnded),this._attachEventListener("waiting",this._onWaiting)),this._attachedCanPlay=!0)}_attachEventListener(e,n){let i=n.bind(this),r=this._media.on(e,i);return Sk(r)}_onDevEvent(e){}_updateCurrentTime(e,n,i){let r={currentTime:Math.min(e,this._ctx.$state.seekableEnd()),played:n};this._notify("time-update",r,i&&new Event(i.type))}_onLoadStart(e){if(e.payload.networkState===3){this._onAbort(e);return}this._attachLoadStartListeners(),this._notify("load-start",void 0,new Event(e.type))}_onAbort(e){this._notify("abort",void 0,new Event(e.type))}_onEmptied({type:e}){this._notify("emptied",void 0,new Event(e))}_onLoadedData(e){this._notify("loaded-data",void 0,new Event(e.type))}_onLoadedMetadata(e){this._attachCanPlayListeners(),this._notify("loaded-metadata",void 0,new Event(e.type))}_getCanPlayDetail({duration:e,buffered:n,seekable:i}){return{provider:Rj(this._ctx.$provider),duration:e,buffered:n,seekable:i}}_onPlay(e){this._ctx.$state.canPlay()&&this._notify("play",void 0,new Event(e.type))}_onPause({type:e,payload:n}){n.readyState===1&&!this._waiting||(this._waiting=!1,this._notify("pause",void 0,new Event(e)))}_onCanPlay({type:e,payload:n}){let i=Di(n.buffered),r=Di(n.seekable);this._ctx.delegate._ready(this._getCanPlayDetail({duration:n.duration,buffered:i,seekable:r}),new Event(e))}_onCanPlayThrough({type:e,payload:n}){if(this._ctx.$state.started())return;let i=Di(n.buffered),r=Di(n.seekable);this._notify("can-play-throug
9 months ago
---
8 months ago
`);return await s.processFrontMatter(a,l=>{Object.assign(l,i(a.path))}),a};function JA(t){let e=[];return t.iterateAllLeaves(n=>{Lv(n.view.getViewType())&&e.push(n)}),e.sort($y),e}function PB(t,e,n){let i=n.getLeavesOfType(e).filter(r=>ke(t)?XA(r,t):ZA(r,t));return i.sort($y),i}function r0(t){return!!t&&Lv(t.view.getViewType())}function $y(t,e){return e.activeTime-t.activeTime}function CB(t,e){e.setEphemeralState({subpath:t})}function MB(t,e,n){return i=>{let r=n.workspace.activeEditor;if(!r)return t?t(i):void 0;if(e&&r.getMode()!=="preview")return r instanceof Ry.MarkdownView&&r.inlineTitleEl.isActiveElement()?void 0:e(i,r.editor,r)}}function Vs({playerCheckCallback:t,noteCheckCallback:e,...n},i){let{app:r}=i,s=i.addCommand({...n,checkCallback:MB(t&&(o=>!t||!r0(r.workspace.activeLeaf)?!1:o?!0:t(o,r.workspace.activeLeaf.view)),e&&((o,a,l)=>{if(!l.file)return!1;let c=i.mediaNote.findMedia(l.file),u=i.leafOpener.detectActiveMediaLeaf(r.workspace.activeLeaf);return e(o,u?.view,{isMediaNote:c,file:l.file,editor:a})}),r)});return!e||!n.menu||i.registerEvent(i.app.workspace.on("editor-menu",(o,a,l)=>{if(!l.file)return!1;let c=i.mediaNote.findMedia(l.file),u=i.leafOpener.detectActiveMediaLeaf(r.workspace.activeLeaf);if(!e(!0,u?.view,{isMediaNote:c,file:l.file,editor:a}))return;let d=l.file;o.addItem(p=>{n.icon&&p.setIcon(n.icon),n.name&&p.setTitle(n.name),n.section&&p.setSection(n.section),p.onClick(()=>{e(!1,u?.view,{isMediaNote:c,file:d,editor:a})})})})),s}function i2(t,{onKeyDown:e,onTrigger:n,onKeyUp:i}){let r=null,s=new Set;return t.register(()=>{s.forEach(o=>{window.removeEventListener("keyup",o,{capture:!0})})}),t.registerDomEvent(window,"keydown",o=>{if(!r)return;let a=o.target;if(a.instanceOf(HTMLElement)&&a.matches("input.prompt-input"))return;let l=o;if(e(o,...r),i){let c=r,u=d=>{let p=$B(l);(d.code===l.code&&p.every(h=>Ry.Keymap.isModifier(d,h))||p.some(h=>d.key===h))&&(i(d,...c),window.removeEventListener("keyup",u,{capture:!0}),s.delete(u))};s.add(u),window.addEventListener("keyup",u,{passive:!0,capture:!0})}r=null},!0),{callback:(...o)=>{r=o,setTimeout(()=>{r===null||(n?.(...o),r=null)},0)}}}function $B(t){let e=[];return t.ctrlKey&&e.push("Ctrl"),t.altKey&&e.push("Alt"),t.shiftKey&&e.push("Shift"),t.metaKey&&e.push("Meta"),e}var RB=t=>[{id:"toggle-play",label:"Play/pause",icon:"play",action:e=>{e.paused=!e.paused}},...[.5,1,2,5,10,30,60].flatMap(e=>[{id:`forward-${e}s`,label:`Forward ${e}s`,icon:"forward",action:n=>{n.currentTime+=e},repeat:!0},{id:`rewind-${e}s`,label:`Rewind ${e}s`,icon:"rewind",action:n=>{n.currentTime-=e},repeat:!0}]),{id:"toggle-mute",label:"Mute/unmute",icon:"volume-x",action:e=>{e.muted=!e.muted}},{id:"toggle-fullscreen",label:"Enter/exit fullscreen",icon:"expand",check:e=>e.state.canFullscreen,action:e=>{e.state.fullscreen?e.exitFullscreen():e.enterFullscreen()}},...IB(t)];function IB(t){let e=null,n=(0,Hl.debounce)(()=>e?.hide(),2e3,!0);function i(o){!e||e.noticeEl.isConnected===!1?e=new Hl.Notice(o,0):e.setMessage(o),n()}function r(o){!e||e.noticeEl.isConnected===!1?e=new Hl.Notice(o,0):e.setMessage(o)}function s(o){new Hl.Notice(o,2e3)}return[...ei.filter(o=>o>1).map(o=>{let a=!1,{callback:l}=i2(t,{onKeyDown(c,u){c.repeat&&(a=!0,u.playbackRate=o,r(`Fast forwarding at ${o}x`))},onKeyUp(c,u){a&&(u.playbackRate=1,e?.hide())}});return{id:`fast-forward-${o}x`,label:`Fast forward at ${o}x by holding hotkey`,icon:"forward",action:l,repeat:!0}}),...ei.map(o=>({id:`set-speed-${o}x`,label:`Set playback speed to ${o}x`,icon:"gauge",action:async a=>{a.playbackRate=o,i(`Speed set to ${o}x`)}})),{id:"reset-speed",label:"Reset playback speed",icon:"reset",check:o=>o.state.playbackRate!==1,action:o=>{o.playbackRate=1,s("Speed reset to 1x")}},{id:"increase-speed",label:"Increase playback speed",icon:"arrow-up",action:o=>{let a=o.playbackRate;if(a>=ei.last()){s("Cannot increase speed further");return}let l=ei.find(c=>c>a);o.playbackRate=l,i(`Speed increased to ${l}x`)}},{id:"decrease-speed",label:"Decrease playback speed",icon:"arrow-down",action:o=>{let a=o.playbackRate;if(a<=ei.first()){s("Cannot de
`,i=[],r=!1;for(let s of t.list)if(s.media instanceof Rn)n+=`#EXTINF:-1,${s.title}
${s.media.href}
`;else if(ke(s.media))if(e.adapter instanceof Kl.FileSystemAdapter){let o=e.adapter.getFullPath(s.media.file.path);try{let a=(0,m2.pathToFileURL)(o).href;n+=`#EXTINF:-1,${s.title}
${a}
`}catch(a){new Kl.Notice(`Failed to convert file path to URL: ${a}`),i.push(s.title||un(s.media))}}else r=!0,i.push(s.title||un(s.media));i.length>0&&(r?new Kl.Notice(createFragment(s=>{s.createDiv({text:"File URI is not supported in this environment. "}),s.createDiv({text:`Skipped items: ${i.join(", ")}`})})):new Kl.Notice(`Skipped items: ${i.join(", ")}`)),DB(n,t.title)}function DB(t,e){let n=new Blob([t],{type:"application/vnd.apple.mpegurl"}),i=document.createElement("a");i.href=URL.createObjectURL(n),i.download=`${e}.m3u8`,document.body.appendChild(i),i.click(),document.body.removeChild(i)}var YD=require("obsidian");function u0(t,e){let n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}var xt=zs(/[A-Za-z]/),kt=zs(/[\dA-Za-z]/),g2=zs(/[#-'*+\--9=?A-Z^-~]/);function Uo(t){return t!==null&&(t<32||t===127)}var hp=zs(/\d/),y2=zs(/[\dA-Fa-f]/),v2=zs(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function me(t){return t!==null&&(t<0||t===32)}function J(t){return t===-2||t===-1||t===32}var jo=zs(/\p{P}|\p{S}/u),ur=zs(/\s/);function zs(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function d0(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Us=function(t){if(t==null)return VB;if(typeof t=="function")return Oy(t);if(typeof t=="object")return Array.isArray(t)?NB(t):OB(t);if(typeof t=="string")return FB(t);throw new Error("Expected function, string, or object as test")};function NB(t){let e=[],n=-1;for(;++n<t.length;)e[n]=Us(t[n]);return Oy(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function OB(t){let e=t;return Oy(n);function n(i){let r=i,s;for(s in t)if(r[s]!==e[s])return!1;return!0}}function FB(t){return Oy(e);function e(n){return n&&n.type===t}}function Oy(t){return e;function e(n,i,r){return!!(zB(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function VB(){return!0}function zB(t){return t!==null&&typeof t=="object"&&"type"in t}var w2=[],Fy=!0,dr=!1,Vy="skip";function fp(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;let s=Us(r),o=i?-1:1;a(t,void 0,[])();function a(l,c,u){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=w2,m,v,w;if((!e||s(l,c,u[u.length-1]||void 0))&&(h=UB(n(l,u)),h[0]===dr))return h;if("children"in l&&l.children){let f=l;if(f.children&&h[0]!==Vy)for(v=(i?f.children.length:-1)+o,w=u.concat(f);v>-1&&v<f.children.length;){let g=f.children[v];if(m=a(g,v,w)(),m[0]===dr)return m;v=typeof m[1]=="number"?m[1]:v+o}}return h}}}function UB(t){return Array.isArray(t)?t:typeof t=="number"?[Fy,t]:t==null?w2:[t]}function p0(t,e,n){let r=Us((n||{}).ignore||[]),s=jB(e),o=-1;for(;++o<s.length;)fp(t,"text",a);function a(c,u){let d=-1,p;for(;++d<u.length;){let h=u[d],m=p?p.children:void 0;if(r(h,m?m.indexOf(h):void 0,p))return;p=h}if(p)return l(c,u)}function l(c,u){let d=u[u.length-1],p=s[o][0],h=s[o][1],m=0,w=d.children.indexOf(c),f=!1,g=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){let T=y.index,P={index:y.index,input:y.input,stack:[...u,c]},k=h(...y,P);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=T+1:(m!==T&&g.push({type:"text",value:c.value.slice(m,T)}),Array.isArray(k)?g.push(...k):k&&g.push(k),m=T+y[0].length,f=!0),!p.global)break;y=p.exec(c.value)}return f?(m<c.value.length&&g.push({type:"text",value:c.value.slice(m)}),d.children.splice(w,1,...g)):g=[c],w+g.length}}function jB(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!t[0]||Array.isArray(t[0])?t:[t],i=-1;for(;++i<n.length;){let r=n[i];e.push([BB(r[0]),HB(r[1])])}return e}function BB(t){return typeof t=="string"?new RegExp(d0(t),"g"):t}function HB(t){
`)}function gH(t){return t==null?"":String(t)}function yH(t){return t.length}function k2(t){let e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function E2(t,e,n,i){let r=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);let o=n.indentLines(n.containerFlow(t,s.current()),vH);return r(),o}function vH(t,e,n){return">"+(n?"":" ")+t}function P2(t,e){return S2(t,e.inConstruct,!0)&&!S2(t,e.notInConstruct,!1)}function S2(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function x0(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
`&&P2(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
`}function C2(t,e){let n=String(t),i=n.indexOf(e),r=i,s=0,o=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++s>o&&(o=s):s=1,r=i+e.length,i=n.indexOf(e,r);return o}function M2(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function $2(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function R2(t,e,n,i){let r=$2(n),s=t.value||"",o=r==="`"?"GraveAccent":"Tilde";if(M2(t,n)){let d=n.enter("codeIndented"),p=n.indentLines(s,wH);return d(),p}let a=n.createTracker(i),l=r.repeat(Math.max(C2(s,r)+1,3)),c=n.enter("codeFenced"),u=a.move(l);if(t.lang){let d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(t.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(t.lang&&t.meta){let d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(t.meta,{before:u,after:`
`,encode:["`"],...a.current()})),d()}return u+=a.move(`
`),s&&(u+=a.move(s+`
`)),u+=a.move(l),c(),u}function wH(t,e,n){return(n?"":" ")+t}function Gl(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function I2(t,e,n,i){let r=Gl(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("definition"),a=n.enter("label"),l=n.createTracker(i),c=l.move("[");return c+=l.move(n.safe(n.associationId(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":`
`,...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),c+=l.move(" "+r),c+=l.move(n.safe(t.title,{before:c,after:r,...l.current()})),c+=l.move(r),a()),o(),c}function L2(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}k0.peek=_H;function k0(t,e,n,i){let r=L2(n),s=n.enter("emphasis"),o=n.createTracker(i),a=o.move(r);return a+=o.move(n.containerPhrasing(t,{before:a,after:r,...o.current()})),a+=o.move(r),s(),a}function _H(t,e,n){return n.options.emphasis||"*"}function Yl(t,e,n,i){let r,s,o;typeof e=="function"&&typeof n!="function"?(s=void 0,o=e,r=n):(s=e,o=n,r=i),fp(t,s,a,r);function a(l,c){let u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}var bH={};function Bo(t,e){let n=e||bH,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return D2(t,i,r)}function D2(t,e,n){if(xH(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return A2(t.children,e,n)}return Array.isArray(t)?A2(t,e,n):""}function A2(t,e,n){let i=[],r=-1;for(;++r<t.length;)i[r]=D2(t[r],e,n);return i.join("")}function xH(t){return!!(t&&typeof t=="object")}function N2(t,e){let n=!1;return Yl(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,dr}),!!((!t.depth||t.depth<3)&&Bo(t)&&(e.options.setext||n))}function O2(t,e,n,i){let r=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(i);if(N2(t,n)){let u=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(t,{...s.current(),before:`
`,after:`
`});return d(),u(),p+`
`+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
`))+1))}let o="#".repeat(r),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}T0.peek=kH;function T0(t){return t.value||""}function kH(){return"<"}E0.peek=TH;function E0(t,e,n,i){let r=Gl(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image"),a=n.enter("label"),l=n.createTracker(i),c=l.move("![");return c+=l.move(n.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),c+=l.move(" "+r),c+=l.move(n.safe(t.title,{before:c,after:r,...l.current()})),c+=l.move(r),a()),c+=l.move(")"),o(),c}function TH(){return"!"}S0.peek=EH;function S0(t,e,n,i){let r=t.referenceType,s=n.enter("imageReference"),o=n.enter("label"),a=n.createTracker(i),l=a.move("!["),c=n.safe(t.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();let u=n.stack;n.stack=[],o=n.enter("reference");let d=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),r==="full"||!c||c!==d?l+=a.move(d+"]"):r==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function EH(){return"!"}P0.peek=SH;function P0(t,e,n){let i=t.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){let o=n.unsafe[s],a=n.compilePattern(o),l;if(o.atBreak)for(;l=a.exec(i);){let c=l.index;i.charCodeAt(c)===10&&i.charCodeAt(c-1)===13&&c--,i=i.slice(0,c)+" "+i.slice(l.index+1)}}return r+i+r}function SH(){return"`"}function C0(t,e){let n=Bo(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}M0.peek=PH;function M0(t,e,n,i){let r=Gl(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i),a,l;if(C0(t,n)){let u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(t,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(t,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(t.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(t.url,{before:c,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=n.enter(`title${s}`),c+=o.move(" "+r),c+=o.move(n.safe(t.title,{before:c,after:r,...o.current()})),c+=o.move(r),l()),c+=o.move(")"),a(),c}function PH(t,e,n){return C0(t,n)?"<":"["}$0.peek=CH;function $0(t,e,n,i){let r=t.referenceType,s=n.enter("linkReference"),o=n.enter("label"),a=n.createTracker(i),l=a.move("["),c=n.containerPhrasing(t,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();let u=n.stack;n.stack=[],o=n.enter("reference");let d=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),r==="full"||!c||c!==d?l+=a.move(d+"]"):r==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function CH(){return"["}function Ql(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function F2(t){let e=Ql(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function V2(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `opt
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:l,tableRow:a}};function o(h,m,v,w){return c(u(h,v,w),h.align)}function a(h,m,v,w){let f=d(h,v,w),g=c([f]);return g.slice(0,g.indexOf(`
`))}function l(h,m,v,w){let f=v.enter("tableCell"),g=v.enter("phrasing"),y=v.containerPhrasing(h,{...w,before:s,after:s});return g(),f(),y}function c(h,m){return T2(h,{align:m,alignDelimiters:i,padding:n,stringLength:r})}function u(h,m,v){let w=h.children,f=-1,g=[],y=m.enter("table");for(;++f<w.length;)g[f]=d(w[f],m,v);return y(),g}function d(h,m,v){let w=h.children,f=-1,g=[],y=m.enter("tableRow");for(;++f<w.length;)g[f]=l(w[f],h,m,v);return y(),g}function p(h,m,v){let w=mp.inlineCode(h,m,v);return v.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function N0(){return{exit:{taskListCheckValueChecked:Z2,taskListCheckValueUnchecked:Z2,paragraph:OH}}}function O0(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:FH}}}function Z2(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function OH(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let i=n.children[0];if(i&&i.type==="text"){let r=e.children,s=-1,o;for(;++s<r.length;){let a=r[s];if(a.type==="paragraph"){o=a;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function FH(t,e,n,i){let r=t.children[0],s=typeof t.checked=="boolean"&&r&&r.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",a=n.createTracker(i);s&&a.move(o);let l=mp.listItem(t,e,n,{...i,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function F0(){return[g0(),v0(),_0(),A0(),N0()]}function V0(t){return{extensions:[y0(),w0(),b0(),D0(t),O0()]}}function st(t,e,n,i){let r=t.length,s=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s<i.length;)o=i.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function pn(t,e){return t.length>0?(st(t,t.length,0,e),t):e}var J2={}.hasOwnProperty;function jy(t){let e={},n=-1;for(;++n<t.length;)VH(e,t[n]);return e}function VH(t,e){let n;for(n in e){let r=(J2.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n],o;if(s)for(o in s){J2.call(r,o)||(r[o]=[]);let a=s[o];zH(r[o],Array.isArray(a)?a:a?[a]:[])}}}function zH(t,e){let n=-1,i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);st(t,0,0,i)}var UH={tokenize:WH,partial:!0},eD={tokenize:KH,partial:!0},tD={tokenize:GH,partial:!0},nD={tokenize:YH,partial:!0},jH={tokenize:QH,partial:!0},iD={tokenize:HH,previous:sD},rD={tokenize:qH,previous:oD},qr={tokenize:BH,previous:aD},pr={};function U0(){return{text:pr}}var Ho=48;for(;Ho<123;)pr[Ho]=qr,Ho++,Ho===58?Ho=65:Ho===91&&(Ho=97);pr[43]=qr;pr[45]=qr;pr[46]=qr;pr[95]=qr;pr[72]=[qr,rD];pr[104]=[qr,rD];pr[87]=[qr,iD];pr[119]=[qr,iD];function BH(t,e,n){let i=this,r,s;return o;function o(d){return!z0(d)||!aD.call(i,i.previous)||j0(i.events)?n(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(d))}function a(d){return z0(d)?(t.consume(d),a):d===64?(t.consume(d),l):n(d)}function l(d){return d===46?t.check(jH,u,c)(d):d===45||d===95||kt(d)?(s=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),r=!0,l}function u(d){return s&&r&&xt(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):n(d)}}function HH(t,e,n){let i=this;return r;function r(o){return o!==87&&o!==119||!sD.call(i,i.previous)||j0(i.events)?n(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(UH,t.attempt(eD,t.attempt(tD,s),n),n)(o))}function s(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function qH(t,e,n){let i=this,r="",s=!1;return o;function o(d){return(d===72||d===104)&&oD.call(i,i.previous)&&!j0(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(d),t.consume(d),a):n(d)}function a(d){if(xt(d)&&r.length<5)return r+=String.fromCodePoint(d),t.consume(d),a;if(d===58){let p=r.toLowerCase();if(p
`;break}case-3:{o=`\r
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(s)}r=s===-2,i.push(o)}return i.join("")}var rT={};zt(rT,{attentionMarkers:()=>M8,contentInitial:()=>k8,disable:()=>$8,document:()=>x8,flow:()=>E8,flowInitial:()=>T8,insideSpan:()=>C8,string:()=>S8,text:()=>P8});var x8={42:Gt,43:Gt,45:Gt,48:Gt,49:Gt,50:Gt,51:Gt,52:Gt,53:Gt,54:Gt,55:Gt,56:Gt,57:Gt,62:By},k8={91:W0},T8={[-2]:yp,[-1]:yp,32:yp},E8={35:G0,42:Ko,45:[Xy,Ko],60:Q0,61:Xy,95:Ko,96:Wy,126:Wy},S8={38:qy,92:Hy},P8={[-5]:vp,[-4]:vp,[-3]:vp,33:Z0,38:qy,42:gp,60:[B0,X0],91:J0,92:[K0,Hy],93:Wo,95:gp,96:H0},C8={null:[gp,vD]},M8={null:[42,95]},$8={null:[]};function sT(t){let n=jy([rT,...(t||{}).extensions||[]]),i={defined:[],lazy:{},constructs:n,content:r(fD),document:r(gD),flow:r(yD),string:r(wD),text:r(_D)};return i;function r(s){return o;function o(a){return kD(i,s,a)}}}function oT(t){for(;!Ky(t););return t}var TD=/[\0\t\n\r]/g;function aT(){let t=1,e="",n=!0,i;return r;function r(s,o,a){let l=[],c,u,d,p,h;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,e="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(TD.lastIndex=d,c=TD.exec(s),p=c&&c.index!==void 0?c.index:s.length,h=s.charCodeAt(p),!c){e=s.slice(d);break}if(h===10&&d===p&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),d<p&&(l.push(s.slice(d,p)),t+=p-d),h){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:i=!0,t=1}d=p+1}return a&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}function Bs(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ED(t.position):"start"in t||"end"in t?ED(t):"line"in t||"column"in t?lT(t):""}function lT(t){return SD(t&&t.line)+":"+SD(t&&t.column)}function ED(t){return lT(t&&t.start)+"-"+lT(t&&t.end)}function SD(t){return t&&typeof t=="number"?t:1}var CD={}.hasOwnProperty;function cT(t,e,n){return typeof e!="string"&&(n=e,e=void 0),R8(n)(oT(sT(n).document().write(aT()(t,e,!0))))}function R8(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(oE),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(iE),blockQuote:s(oc),characterEscape:O,characterReference:O,codeFenced:s(zi),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(zi,o),codeText:s(Xo,o),codeTextData:O,data:O,codeFlowValue:O,definition:s(Zo),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(xv),hardBreakEscape:s(rE),hardBreakTrailing:s(rE),htmlFlow:s(sE,o),htmlFlowData:O,htmlText:s(sE,o),htmlTextData:O,image:s(tO),label:o,link:s(oE),listItem:s(nO),listItemValue:p,listOrdered:s(aE,d),listUnordered:s(aE),paragraph:s(iO),reference:x,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(iE),strong:s(rO),thematicBreak:s(oO)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:It,autolinkProtocol:Pp,blockQuote:l(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:qs,characterReferenceMarkerNumeric:qs,characterReferenceValue:bv,codeFenced:l(w),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:b,codeIndented:l(f),codeText:l(W),codeTextData:b,data:b,definition:l(),definitionDestinationString:T,definitionLabelString:g,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(H),htmlFlowData:b,htmlText:l(q),htmlTextData:b,image:l(Fe),label:tt,labelText:yt,lineEnding:ee,link:l(xe),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Cn,resourceDestinationString:_,resourceTitleString:Ie,resource:Rt,setextHeading:l(I),setextHeadingLineSequence:M,setextHeadingText:k,strong:l(),thematicBreak:l()}};MD(e,(t||{}).mdastExtensions||[]);let n={};return i;function i(R){let V={type:"root",children:[]},oe={stack:[V],tokenStack:[],config:e,enter:a,exit:c,buffer:o,resume:u,data:n},ve=[],$e=-1;for(;++$e<R.length;)if(R[$e][1].type==="listOrdered"||R[$e][1].type==="listUnordered")if(R[$e][0]==="enter")ve.push($e);else{let wi=v
9 months ago
- {{TIMESTAMP}} `,screenshotEmbedTemplate:"{{TITLE}}{{DURATION}}|50",screenshotTemplate:`
8 months ago
- !{{SCREENSHOT}} {{TIMESTAMP}} `,insertBefore:!1,timestampOffset:0,biliDefaultQuality:80,screenshotFormat:"image/webp",speedStep:.1};function PN(){return gt.Platform.isDesktopApp?require("os").hostname()||(gt.Platform.isMacOS?"Mac":gt.Platform.isWin?"Windows":gt.Platform.isLinux?"Linux":"Desktop"):gt.Platform.isIosApp?gt.Platform.isPhone?"iPhone":gt.Platform.isTablet?"iPad":"iOS Device":gt.Platform.isAndroidApp?gt.Platform.isPhone?"Android Phone":gt.Platform.isTablet?"Android Tablet":"Android Device":"Unknown Device"}function CN(t){return new Map(t.map(e=>[`${e.appId}%${e.protocol}`,e.replace]))}function hq(t){return Array.from(t.entries()).map(([e,n])=>{let[i,r]=e.split("%");return{appId:i,protocol:r,replace:n}}).filter(e=>e.appId&&e.protocol&&e.replace)}function $N(t){let e=(0,gt.debounce)(n=>{let i=Tv(n,EN);t.saveData({...i,urlMappingData:n.getUrlMappingData()})},1e3);return Ef((n,i)=>({...Cp(SN,["urlMappingData"]),setSpeedStep(r){r=Math.abs(r),r!==0&&(n({speedStep:r}),e(i()))},setScreenshotFormat(r){n({screenshotFormat:r}),e(i())},setScreenshotQuality(r){n({screenshotQuality:r??void 0}),e(i())},setDefaultLanguage(r){n({defaultLanguage:r?.format()}),e(i())},getDefaultLang(){let r=i().defaultLanguage,s=gt.moment.locale();return r&&!Mk(r)?(new gt.Notice(`Invalid language code detected in preferences: ${r}, reverting to ${s}.`),n({defaultLanguage:void 0}),e(i()),s):r??gt.moment.locale()},getUrlMappingData(){return hq(i().urlMapping)},setBiliDefaultQuality(r){n({biliDefaultQuality:r}),e(i())},setInsertPosition(r){n({insertBefore:r==="before"}),e(i())},setLinkHandler(r,s){n(o=>{let a={...o.linkHandler};for(let l of Object.keys(a)){let c=l;a[c]=a[c].filter(u=>typeof u=="string"?u!==r:typeof r=="string"||!fq(u,r)),c===s&&(a[c]=[...a[c],r])}return{linkHandler:a}}),e(i())},setTimestampOffset(r){n({timestampOffset:r}),e(i())},setDefaultMxLinkBehavior:r=>{let s;r==="split"||r==="split-horizontal"?s="window":r==="window"?s="tab":r==="tab"?s="split":s=null,n({defaultMxLinkClick:{click:r,alt:s}}),e(i())},setTemplate(r,s){switch(r){case"screenshot":n({screenshotTemplate:s});break;case"screenshotEmbed":n({screenshotEmbedTemplate:s});break;case"timestamp":n({timestampTemplate:s});break;default:(0,MN.assertNever)(r)}e(i())},setMxLinkAltBehavior:r=>{n(({defaultMxLinkClick:s})=>({defaultMxLinkClick:{...s,alt:r}})),e(i())},urlMapping:CN(SN.urlMappingData),setDefaultVolume:r=>{n({defaultVolume:r}),e(i())},getUrlMapping:r=>i().urlMapping.get(`${t.app.appId}%${r}`),setUrlMapping:(r,s)=>{if(r.includes("%"))throw new Error("Protocol cannot contain %");let o=`${t.app.appId}%${r}`;n(a=>({urlMapping:new Map(a.urlMapping).set(o,s),devices:a.getDeviceName()?a.devices:[...a.devices,{appId:t.app.appId,name:PN()}]})),e(i())},removeUrlMapping:r=>{if(r.includes("%"))throw new Error("Protocol cannot contain %");n(s=>{let o=`${t.app.appId}%${r}`,a=new Map(s.urlMapping);return a.delete(o),{urlMapping:a}}),e(i())},getDeviceName(r=t.app.appId){return i().devices.find(s=>s.appId===r)?.name},getDeviceNameWithDefault(r=t.app.appId){let s=i().devices.find(o=>o.appId===r);return s?s.name:r===t.app.appId?PN():"Unknown Device"},setDeviceName(r,s=t.app.appId){n({devices:[...i().devices.filter(o=>o.appId!==s),{appId:s,name:r}]}),e(i())},setLoadStrategy:r=>{n({loadStrategy:r}),e(i())},setScreenshotFolder(r){r!==null?(r=(0,gt.normalizePath)(r),r==="."?r="/":r.startsWith("./")&&(r=r.slice(2)),n({screenshotFolderPath:r})):n({screenshotFolderPath:void 0})},load:async()=>{let r=await t.loadData();if(!r)return;let{urlMappingData:s,...o}=Tv(r,EN);n({...o,urlMapping:CN(s??[])})},save:()=>{e(i())}}))}function fq(t,e){let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let i of n)if(t[i]!==e[i])return!1;return!0}var IN=require("url"),WT=A(Pk()),ue=require("obsidian");var hv=class extends ue.PluginSettingTab{constructor(n){super(n.app,n);E(this,"plugin");this.plugin=n}get state(){return this.plugin.settings.getState()}get sub(){return this.plugin.settings.subscribe.bind(this.plugin.settings)}protocol(){new ue.Setting(this.containerEl).setHeading().setName("Protocols").set
9 months ago
const { session, webContents, net } = require("electron");
8 months ago
const webviewSession = session.fromPartition(${n});
9 months ago
const webContent = webContents.fromId(${t});
webviewSession.webRequest.onSendHeaders(
{
8 months ago
urls: ${nE.filter}, type: ${nE.types}
9 months ago
}, ({url, method, requestHeaders, webContentsId}) => {
if (method !== "GET" || webContentsId===undefined) return;
8 months ago
webContent.send(${Tp}, {type:${nE.type} ,url, method, requestHeaders, webContentsId});
9 months ago
})
8 months ago
`.trim():(console.log("partition disabled, cannot watch requests"),"")}async function XN(t,e){return Rq(t.pipeThrough(new DecompressionStream("gzip")),e)}function ZN(t){return new ReadableStream({start(e){e.enqueue(new Uint8Array(t)),e.close()}})}async function Rq(t,e){let n=t.getReader(),i=[];for(;;){let{done:r,value:s}=await n.read();if(r)break;i.push(s)}return new Blob(i,{type:e})}function Iq(t){return`${t.aid}-${t.bvid}-${t.cid}`}var Ep,Sp,sc,yv=class extends vv.Component{constructor(n){super();this.plugin=n;Y(this,Ep,Cf());Y(this,Sp,new Map);Y(this,sc,new Map);E(this,"app");E(this,"db");this.app=n.app,this.db=GN(`mx-cache-${this.app.appId}`,1,{upgrade(i){i.createObjectStore("bili-subtitle")}}),this.app=n.app}async getPlayerApiResp(n,i=1e4){let{aid:r,bvid:s,cid:o}=await n.methods.bili_getManifest(),a=Iq({aid:r,bvid:s,cid:o}),l=C(this,Sp).get(a);if(l)return l;let c=C(this,sc).get(`${s}-${o}`)??C(this,sc).get(`${r}-${o}`);c||(c=await new Promise((p,h)=>{let m=C(this,Ep).on("player_v2",w=>{o===w.cid&&(r===w.aid||s===w.bvid)&&(p(w.url),window.clearTimeout(v))}),v=window.setTimeout(()=>{m(),h(new Error("player_v2 timeout: "+a))},i)}));let u=await n.methods.fetch(c,{gzip:!1,credentials:"include"});if(u.type!=="application/json")throw new Error(`Unexpected response type ${u.type} for player_v2 api`);let d=JSON.parse(new TextDecoder().decode(u.ab));if(d.code!==0)throw new Error(`player_v2 api error: (${d.code}) ${d.message}`);return C(this,Sp).set(a,d.data),d.data}async cacheSubtitle(n,i){(await this.db).put("bili-subtitle",i,n.toString())}async getCachedSubtitle(n){let r=await(await this.db).get("bili-subtitle",n.toString());if(!r)return null;let{ab:s,gzip:o}=r,a="application/json",c=await(o?await XN(ZN(s),a):new Blob([s],{type:a})).text();return JSON.parse(c)}async hasSubtitle(n){return await(await this.db).count("bili-subtitle",n.toString())>0}async onload(){if(!vv.Platform.isDesktopApp)throw new Error("Cannot register ipc events, not in desktop app");let n=require("path"),i=require("fs/promises"),{ipcRenderer:r}=require("electron"),s=require("@electron/remote"),o=(a,l)=>{if(l.type!=="player_v2")return;let c=new URL(l.url),u=c.searchParams.get("aid"),d=c.searchParams.get("bvid"),p=c.searchParams.get("cid");if(!u&&!d||!p)return;C(this,Ep).emit("player_v2",{url:l.url,aid:+u,bvid:d,cid:+p});let h=d?`${d}-${p}`:`${u}-${p}`;C(this,sc).set(h,l.url)};r.on(Tp,o);try{let a=s.getCurrentWebContents().id,l=QN(a,this.app),c=n.join(this.app.vault.adapter.getBasePath(),...this.app.vault.configDir.split("/"),`mx-player-hack.${Date.now()}.js`);await i.writeFile(c,l,"utf-8");try{await s.require(c),console.log("mx-player-hack loaded")}finally{await i.rm(c,{force:!0,maxRetries:5})}this.register(()=>{r.off(Tp,o)})}catch(a){throw r.off(Tp,o),a}}};Ep=new WeakMap,Sp=new WeakMap,sc=new WeakMap;var JN=require("obsidian");async function eO(){if(!JN.Platform.isDesktopApp)return;let t=bc(this.app.appId);t&&(this.settings.subscribe((e,n)=>{e.biliDefaultQuality!==n.biliDefaultQuality&&HT(t,e.biliDefaultQuality)}),await HT(t,this.settings.getState().biliDefaultQuality))}var wv=class extends _v.Plugin{constructor(){super(...arguments);E(this,"settings",$N(this));E(this,"api",{openUrl:async(n,i,r)=>{let s=this.resolveUrl(n);if(!s){new _v.Notice("Protocol not yet supported");return}await this.leafOpener.openMedia(s,i,{direction:r})}});E(this,"urlViewType",this.addChild(new Yp(this)));E(this,"mediaNote",this.addChild(new Ny(this)));E(this,"playlist",this.addChild(new sv(this)));E(this,"biliReq",this.addChild(new yv(this)));E(this,"leafOpener",this.addChild(new Sy(this)));E(this,"recorderNote",this.addChild(new Ip(this)));E(this,"handleMediaNote",a2);E(this,"injectMediaEmbed",OT);E(this,"injectMediaView",BT);E(this,"registerMediaMenu",xT);E(this,"fixLinkLabel",UT);E(this,"patchEditorClick",FT);E(this,"patchPreviewClick",jT);E(this,"patchInlineUrl",VT);E(this,"patchLinktextOpen",zT);E(this,"modifySession",eO);E(this,"initLogin",mS)}resolveUrl(n){let i=bN(n);return i?lS(ki(i),this.settings.getState(),this.app):null}async onload(){this.addSettingTab(new hv(thi
9 months ago
/*! Bundled license information:
react/cjs/react.production.min.js:
(**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.min.js:
(**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom.production.min.js:
(**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js:
(**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js:
(**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react/cjs/react-jsx-runtime.production.min.js:
(**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/