1const la=Symbol("Comlink.proxy"),Vs=Symbol("Comlink.endpoint"),Cs=Symbol("Comlink.releaseProxy"),Xt=Symbol("Comlink.finalizer"),Et=Symbol("Comlink.thrown"),ua=t=>typeof t=="object"&&t!==null||typeof t=="function",Ts={canHandle:t=>ua(t)&&t[la],serialize(t){const{port1:e,port2:r}=new MessageChannel;return _r(t,e),[r,[r]]},deserialize(t){return t.start(),gs(t)}},Ss={canHandle:t=>ua(t)&&Et in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},da=new Map([["proxy",Ts],["throw",Ss]]);function Rs(t,e){for(const r of t)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function _r(t,e=globalThis,r=["*"]){e.addEventListener("message",function s(a){if(!a||!a.data)return;if(!Rs(r,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}const{id:i,type:o,path:c}=Object.assign({path:[]},a.data),u=(a.data.argumentList||[]).map(Ce);let m;try{const h=c.slice(0,-1).reduce((l,T)=>l[T],t),A=c.reduce((l,T)=>l[T],t);switch(o){case"GET":m=A;break;case"SET":h[c.slice(-1)[0]]=Ce(a.data.value),m=!0;break;case"APPLY":m=A.apply(h,u);break;case"CONSTRUCT":{const l=new A(...u);m=bs(l)}break;case"ENDPOINT":{const{port1:l,port2:T}=new MessageChannel;_r(t,T),m=ha(l,[l])}break;case"RELEASE":m=void 0;break;default:return}}catch(h){m={value:h,[Et]:0}}Promise.resolve(m).catch(h=>({value:h,[Et]:0})).then(h=>{const[A,l]=St(h);e.postMessage(Object.assign(Object.assign({},A),{id:i}),l),o==="RELEASE"&&(e.removeEventListener("message",s),fa(e),Xt in t&&typeof t[Xt]=="function"&&t[Xt]())}).catch(h=>{const[A,l]=St({value:new TypeError("Unserializable return value"),[Et]:0});e.postMessage(Object.assign(Object.assign({},A),{id:i}),l)})}),e.start&&e.start()}function Is(t){return t.constructor.name==="MessagePort"}function fa(t){Is(t)&&t.close()}function gs(t,e){const r=new Map;return t.addEventListener("message",function(a){const{data:i}=a;if(!i||!i.id)return;const o=r.get(i.id);if(o)try{o(i)}finally{r.delete(i.id)}}),rr(t,r,[],e)}function lt(t){if(t)throw new Error("Proxy has been released and is not useable")}function ma(t){return ye(t,new Map,{type:"RELEASE"}).then(()=>{fa(t)})}const Ct=new WeakMap,Tt="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(Ct.get(t)||0)-1;Ct.set(t,e),e===0&&ma(t)});function Ps(t,e){const r=(Ct.get(e)||0)+1;Ct.set(e,r),Tt&&Tt.register(t,e,t)}function Os(t){Tt&&Tt.unregister(t)}function rr(t,e,r=[],s=function(){}){let a=!1;const i=new Proxy(s,{get(o,c){if(lt(a),c===Cs)return()=>{Os(i),ma(t),e.clear(),a=!0};if(c==="then"){if(r.length===0)return{then:()=>i};const u=ye(t,e,{type:"GET",path:r.map(m=>m.toString())}).then(Ce);return u.then.bind(u)}return rr(t,e,[...r,c])},set(o,c,u){lt(a);const[m,h]=St(u);return ye(t,e,{type:"SET",path:[...r,c].map(A=>A.toString()),value:m},h).then(Ce)},apply(o,c,u){lt(a);const m=r[r.length-1];if(m===Vs)return ye(t,e,{type:"ENDPOINT"}).then(Ce);if(m==="bind")return rr(t,e,r.slice(0,-1));const[h,A]=xr(u);return ye(t,e,{type:"APPLY",path:r.map(l=>l.toString()),argumentList:h},A).then(Ce)},construct(o,c){lt(a);const[u,m]=xr(c);return ye(t,e,{type:"CONSTRUCT",path:r.map(h=>h.toString()),argumentList:u},m).then(Ce)}});return Ps(i,t),i}function Ls(t){return Array.prototype.concat.apply([],t)}function xr(t){const e=t.map(St);return[e.map(r=>r[0]),Ls(e.map(r=>r[1]))]}const Aa=new WeakMap;function ha(t,e){return Aa.set(t,e),t}function bs(t){return Object.assign(t,{[la]:!0})}function St(t){for(const[e,r]of da)if(r.canHandle(t)){const[s,a]=r.serialize(t);return[{type:"HANDLER",name:e,value:s},a]}return[{type:"RAW",value:t},Aa.get(t)||[]]}function Ce(t){switch(t.type){case"HANDLER":return da.get(t.name).deserialize(t.value);case"RAW":return t.value}}function ye(t,e,r,s){return new Promise(a=>{const i=ws();e.set(i,a),t.start&&t.start(),t.postMessage(Object.assign({id:i},r),s)})}function ws(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const C=(t=V.UNKNOWN_ERR,e,r,s)=>{const a=Yt(e)?e.type:Ds(e)?V.NETWORK_FAILED_ERR:t,i=pa(e)||Yt(e)?e.message:"",o=i?`${i} 2 ${r??""}: ${xe(e)}`:`${r??""}: ${xe(e)}`,c=Yt(e)&&e.errorArgs!==void 0?e.errorArgs:s;return{__internal:"MediaProcessingError",type:a,message:o,errorArgs:c}},Yt=t=>typeof t=="object"&&t!==null&&"__internal"in t,pa=t=>t instanceof Error,ys=t=>t instanceof DOMException,Ds=t=>pa(t)&&t.name==="TypeError"&&t.message==="Network request failed",Fs=t=>{if(ys(t))return`DOMException ${t.name}(${t.code}): ${t.message}`;const e=Object.getOwnPropertyNames(t);try{return JSON.stringify(t,e)}catch(r){return`{${e.map(a=>`${a}: ${t[a]}`).join(", ")}} (stringify failed: ${r})`}},xe=t=>{switch(typeof t){case"string":return t;case"undefined":return"undefined";case"function":return`function ${t.name}`;case"number":case"bigint":case"symbol":case"boolean":return t.toString();case"object":return t!==null?Fs(t):"null"}};
2class Ms extends Error{}class fe extends Ms{constructor(){super("Zone is an abstract class")}}function Ke(t){return typeof t>"u"}function vs(){try{return typeof Intl<"u"&&Intl.DateTimeFormat}catch{return!1}}function xs(){return!Ke(Intl.DateTimeFormat.prototype.formatToParts)}function ut(t,e=2){return t.toString().length<e?("0".repeat(e)+t).slice(-e):t.toString()}function Ea(t){if(!(Ke(t)||t===null||t===""))return parseInt(t,10)}function Ns(t){if(!(Ke(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function ks(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function Us(t,e,r,s=null){const a=new Date(t),i={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const o=Object.assign({timeZoneName:e},i),c=vs();if(c&&xs()){const u=new Intl.DateTimeFormat(r,o).formatToParts(a).find(m=>m.type.toLowerCase()==="timezonename");return u?u.value:null}else if(c){const u=new Intl.DateTimeFormat(r,i).format(a);return new Intl.DateTimeFormat(r,o).format(a).substring(u.length).replace(/^[, \u200e]+/,"")}else return null}function Va(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);const s=parseInt(e,10)||0,a=r<0||Object.is(r,-0)?-s:s;return r*60+a}function ar(t,e){const r=Math.trunc(t/60),s=Math.abs(t%60),a=r>=0&&!Object.is(r,-0)?"+":"-",i=`${a}${Math.abs(r)}`;switch(e){case"short":return`${a}${ut(Math.abs(r),2)}:${ut(s,2)}`;case"narrow":return s>0?`${i}:${s}`:i;case"techie":return`${a}${ut(Math.abs(r),2)}${ut(s,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}const Ca=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;class Ta{get type(){throw new fe}get name(){throw new fe}get universal(){throw new fe}offsetName(e,r){throw new fe}formatOffset(e,r){throw new fe}offset(e){throw new fe}equals(e){throw new fe}get isValid(){throw new fe}}const Gs=RegExp(`^${Ca.source}$`);let Vt={};function Bs(t){return Vt[t]||(Vt[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Vt[t]}const Ws={year:0,month:1,day:2,hour:3,minute:4,second:5};function Xs(t,e){const r=t.format(e).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r),[,a,i,o,c,u,m]=s;return[o,a,i,c,u,m]}function Ys(t,e){const r=t.formatToParts(e),s=[];for(let a=0;a<r.length;a++){const{type:i,value:o}=r[a],c=Ws[i];Ke(c)||(s[c]=parseInt(o,10))}return s}let dt={};class Rt extends Ta{static create(e){return dt[e]||(dt[e]=new Rt(e)),dt[e]}static resetCache(){dt={},Vt={}}static isValidSpecifier(e){return!!(e&&e.match(Gs))}static isValidZone(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}static parseGMTOffset(e){if(e){const r=e.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(r)return-60*parseInt(r[1])}return null}constructor(e){super(),this.zoneName=e,this.valid=Rt.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:r,locale:s}){return Us(e,r,s,this.name)}formatOffset(e,r){return ar(this.offset(e),r)}offset(e){const r=new Date(e),s=Bs(this.name),[a,i,o,c,u,m]=s.formatToParts?Ys(s,r):Xs(s,r),A=ks({year:a,month:i,day:o,hour:c===24?0:c,minute:u,second:m,millisecond:0});let l=+r;const T=l%1e3;return l-=T>=0?T:1e3+T,(A-l)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let zt=null;class Fe extends Ta{static get utcInstance(){return zt===null&&(zt=new Fe(0)),zt}static instance(e){return e===0?Fe.utcInstance:new Fe(e)}static parseSpecifier(e){if(e){const r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new Fe(Va(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ar(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return ar(this.fixed,r)}get universal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}function Ne(...t){const e=t.reduce((r,s)=>r+s.source,"");return RegExp(`^${e}$`)}function ke(...t){return e=>t.reduce(([r,s,a],i)=>{const[o,c,u]=i(e,a);return[Object.assign(r,o),s||c,u]},[{},null,1]).slice(0,2)}function Sa(...t){return(e,r)=>{const s={};let a;for(a=0;a<t.length;a++)s[t[a]]=Ea(e[r+a]);return[s,null,r+a]}}const Ra=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ia=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,ga=RegExp(`${Ia.source}${Ra.source}?`),cr=RegExp(`(?:T${ga.source})?`),zs=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Hs=/(\d{4})-?W(\d\d)(?:-?(\d))?/,$s=/(\d{4})-?(\d{3})/,js=Sa("weekYear","weekNumber","weekDay"),qs=Sa("year","ordinal"),Ks=/(\d{4})-(\d\d)-(\d\d)/,Pa=RegExp(`${Ia.source} ?(?:${Ra.source}|(${Ca.source}))?`),Qs=RegExp(`(?: ${Pa.source})?`);function Me(t,e,r){const s=t[e];return Ke(s)?r:Ea(s)}function Oa(t,e){return[{year:Me(t,e),month:Me(t,e+1,1),day:Me(t,e+2,1)},null,e+3]}function Ue(t,e){return[{hour:Me(t,e,0),minute:Me(t,e+1,0),second:Me(t,e+2,0),millisecond:Ns(t[e+3])},null,e+4]}function Qe(t,e){const r=!t[e]&&!t[e+1],s=Va(t[e+1],t[e+2]),a=r?null:Fe.instance(s);return[{},a,e+3]}function La(t,e){const r=t[e]?Rt.create(t[e]):null;return[{},r,e+1]}Ne(zs,cr);Ne(Hs,cr);Ne($s,cr);Ne(ga);ke(Oa,Ue,Qe);ke(js,Ue,Qe);ke(qs,Ue);ke(Ue,Qe);Ne(Ks,Qs);Ne(Pa);ke(Oa,Ue,Qe,La);ke(Ue,Qe,La);const ba={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}};Object.assign({years:{months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3}},ba);const Z=146097/400,Le=146097/4800;Object.assign({years:{months:12,weeks:Z/7,days:Z,hours:Z*24,minutes:Z*24*60,seconds:Z*24*60*60,milliseconds:Z*24*60*60*1e3},quarters:{months:3,weeks:Z/28,days:Z/4,hours:Z*24/4,minutes:Z*24*60/4,seconds:Z*24*60*60/4,milliseconds:Z*24*60*60*1e3/4}
2,months:{weeks:Le/7,days:Le,hours:Le*24,minutes:Le*24*60,seconds:Le*24*60*60,milliseconds:Le*24*60*60*1e3}},ba);class U{static _zero=new U(0);_micros;constructor(e){this._micros=e}static fromUS(e){return new U(Math.round(e))}static fromMS(e){return new U(Math.round(e*1e3))}static fromSec(e){return new U(Math.round(e*1e6))}static zero(){return U._zero}static doOverlap(e,r,s,a){return e.lt(a)&&s.lt(r)}get as(){return{us:(e="raw",r)=>U._round(this._micros,e,r),ms:(e="raw",r)=>U._round(this._micros/1e3,e,r),sec:(e="raw",r)=>U._round(this._micros/1e6,e,r)}}lt(e){return this._micros<e._micros}lte(e){return this._micros<=e._micros}gt(e){return this._micros>e._micros}gte(e){return this._micros>=e._micros}eq(e,r=0){return Math.abs(this._micros-e._micros)<=r}add(e){return new U(this._micros+e._micros)}sub(e){return new U(this._micros-e._micros)}mul(e){return new U(Math.round(this._micros*e))}div(e){if(e===0)throw new Error("Division by zero at Time.div");return new U(Math.round(this._micros/e))}mod(e){if(e._micros===0)throw new Error("Division by zero at Time.mod");const r=this._micros%e._micros;return new U(r)}roundTo(e=0){return U.fromUS(this.as.us("round",e))}static compare(e,r){return e._micros-r._micros}static min(...e){if(e.length===0)throw new Error("Time.min requires at least one Time argument");let r=e[0];for(const s of e)s._micros<r._micros&&(r=s);return r}static max(...e){if(e.length===0)throw new Error("Time.max requires at least one Time argument");let r=e[0];for(const s of e)s._micros>r._micros&&(r=s);return r}static _round(e,r,s){if(r==="raw")return e;const a=10**(s??0);switch(r){case"round":return Math.round(e/a)*a;case"floor":return Math.floor(e/a)*a;case"ceil":return Math.ceil(e/a)*a}}}const Js=(t,e)=>Math.round(t.as.sec()*e),Ht=(t,e)=>U.fromSec(t/e),wa=t=>new Promise(e=>setTimeout(e,t)),It=(t,e,r)=>{const s=setTimeout(()=>r(),e);return t.then(()=>clearTimeout(s),()=>clearTimeout(s)),t},Zs=(t,e)=>{let r;return new Promise((s,a)=>{r=setTimeout(()=>a(new Error("Timeout")),e),t.then(s,a).finally(()=>clearTimeout(r))})},ya=async(t,e,r,s)=>{let a;for(let i=0;i<=e;i++)try{if(i>0&&a)try{s?.(a,i),await wa(r(i))}catch{}return await t()}catch(o){a=o}throw a};function Nr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,s=Array(e);r<e;r++)s[r]=t[r];return s}function en(t){if(Array.isArray(t))return t}function tn(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,a,i,o,c=[],u=!0,m=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(s=i.call(r)).done)&&(c.push(s.value),c.length!==e);u=!0);}catch(h){m=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(m)throw a}}return c}}function rn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function an(t,e){return en(t)||tn(t,e)||sn(t,e)||rn()}function sn(t,e){if(t){if(typeof t=="string")return Nr(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Nr(t,e):void 0}}const Da=Object.entries,kr=Object.setPrototypeOf,nn=Object.isFrozen,on=Object.getPrototypeOf,_n=Object.getOwnPropertyDescriptor;let z=Object.freeze,H=Object.seal,De=Object.create,Fa=typeof Reflect<"u"&&Reflect,sr=Fa.apply,nr=Fa.construct;z||(z=function(e){return e});H||(H=function(e){return e});sr||(sr=function(e,r){for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i];return e.apply(r,a)});nr||(nr=function(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return new e(...s)});const be=W(Array.prototype.forEach),cn=W(Array.prototype.lastIndexOf),Ur=W(Array.prototype.pop),we=W(Array.prototype.push),ln=W(Array.prototype.splice),he=Array.isArray,He=W(String.prototype.toLowerCase),$t=W(String.prototype.toString),Gr=W(String.prototype.match),Ye=W(String.prototype.replace),Br=W(String.prototype.indexOf),un=W(String.prototype.trim),dn=W(Number.prototype.toString),fn=W(B
vendor: 5,083 bytes, line 3
3oolean.prototype.toString),Wr=typeof BigInt>"u"?null:W(BigInt.prototype.toString),Xr=typeof Symbol>"u"?null:W(Symbol.prototype.toString),Y=W(Object.prototype.hasOwnProperty),ze=W(Object.prototype.toString),X=W(RegExp.prototype.test),Ve=mn(TypeError);function W(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return sr(t,e,s)}}function mn(t){return function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return nr(t,r)}}function D(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He;if(kr&&kr(t,null),!he(e))return t;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const i=r(a);i!==a&&(nn(e)||(e[s]=i),a=i)}t[a]=!0}return t}function An(t){for(let e=0;e<t.length;e++)Y(t,e)||(t[e]=null);return t}function j(t){const e=De(null);for(const s of Da(t)){var r=an(s,2);const a=r[0],i=r[1];Y(t,a)&&(he(i)?e[a]=An(i):i&&typeof i=="object"&&i.constructor===Object?e[a]=j(i):e[a]=i)}return e}function hn(t){switch(typeof t){case"string":return t;case"number":return dn(t);case"boolean":return fn(t);case"bigint":return Wr?Wr(t):"0";case"symbol":return Xr?Xr(t):"Symbol()";case"undefined":return ze(t);case"function":case"object":{if(t===null)return ze(t);const e=t,r=re(e,"toString");if(typeof r=="function"){const s=r(e);return typeof s=="string"?s:ze(s)}return ze(t)}default:return ze(t)}}function re(t,e){for(;t!==null;){const s=_n(t,e);if(s){if(s.get)return W(s.get);if(typeof s.value=="function")return W(s.value)}t=on(t)}function r(){return null}return r}function pn(t){try{return X(t,""),!0}catch{return!1}}const Yr=z(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),jt=z(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qt=z(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),En=z(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kt=z(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Vn=z(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zr=z(["#text"]),Hr=z(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
3spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Qt=z(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$r=z(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ft=z(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Cn=H(/{{[\w\W]*|^[\w\W]*}}/g),Tn=H(/<%[\w\W]*|^[\w\W]*%>/g),Sn=H(/\${[\w\W]*/g),Rn=H(/^data-[\-\w.\u00B7-\uFFFF]+$/),In=H(/^aria-[\-\w]+$/),jr=H(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gn=H(/^(?:\w+script|data):/i),Pn=H(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),On=H(/^html$/i),Ln=H(/^[a-z][.\w]*(-[.\w]+)+$/i),qr=H(/<[/\w!]/g),Kr=H(/<[/\w]/g),bn=H(/<\/no(script|embed|frames)/i),wn=H(/\/>/i),J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},yn=function(){return typeof window>"u"?null:window},Dn=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(s=r.getAttribute(a));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Qr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},me=function(e,r,s,a){return Y(e,r)&&he(e[r])?D(a.base?j(a.base):{},e[r],a.transform):s};function Ma(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yn();const e=f=>Ma(f);if(e.version="3.4.13",e.removed=[],!t||!t.document||t.document.nodeType!==J.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const s=r,a=s.currentScript;t.DocumentFragment;const i=t.HTMLTemplateElement,o=t.Node,c=t.Element,u=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,A=t.trustedTypes,l=c.prototype,T=re(l,"cloneNode"),g=re(l,"remove"),b=re(l,"nextSibling"),w=re(l,"childNodes"),y=re(l,"parentNode"),S=re(l,"shadowRoot"),P=re(l,"attributes"),R=o&&o.prototype?re(o.prototype,"nodeType"):null,$=o&&o.prototype?re(o.prototype,"nodeName"):null,ee=o&&o.prototype?re(o.prototype,"ownerDocument"):null;if(typeof i=="function"){const f=r.createElement("template");f.content&&f.content.ownerDocument&&(r=f.content.ownerDocument)}let O,B="",te,_e=!1,oe=0;const lr=function(){if(oe>0)throw Ve('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Se=function(n){lr(),oe++;try{return O.createHTML(n)}finally{oe--}},za=function(n){lr(),oe++;try{return O.createScriptURL(n)}finally{oe--}},Ha=function(){return _e||(te=Dn(A,a),_e=!0),te},Je=r,Pt=Je.implementation,ur=Je.createNodeIterator,$a=Je.createDocumentFragment,ja=Je.getElementsByTagName,qa=s.importNode;let M=Qr();e.isSupported=typeof Da=="function"&&typeof y=="function"&&Pt&&Pt.createHTMLDocument!==void 0;const Ka=Cn,Qa=Tn,Ja=Sn,Za=Rn,es=In,ts=gn,dr=Pn,rs=Ln;let fr=jr,v=null;const Ot=D({},[...Yr,...jt,...qt,...Kt,...zr]);let x=null;const Lt=D({},[...Hr,...Qt,...$r,...ft]);let G=Object.seal(De(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ge=null,mr=null;const ce=Object.seal(De(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ar=!0,bt=!0,hr=!1,pr=!0,le=!1,ue=!0,pe=!1,wt=!1,Ze=null,et=null,yt=!1,Re=!1,tt=!1,rt=!1,Er=!0,Vr=!1;const Cr="user-content-";let Dt=!0,at=!1,Ie={},se=null;const Ft=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Tr=null;const Sr=D({},["audio","video","img","source","image","track"]);let Mt=null;const Rr=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),st="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",ne="http://www.w3.org/1999/xhtml";let ge=ne,vt=!1,xt=null;const as=D({},[st,nt,ne],$t),Ir=z(["mi","mo","mn","ms","mtext"]);let Nt=D({},Ir);const gr=z(["annotation-xml"]);let kt=D({},gr);const ss=D({}
vendor: 2,859 bytes, line 3
3,["title","style","font","a","script"]);let Be=null;const ns=["application/xhtml+xml","text/html"],is="text/html";let N=null,Pe=null;const os=r.createElement("form"),Pr=function(n){return n instanceof RegExp||n instanceof Function},Ut=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Pe&&Pe===n)return;(!n||typeof n!="object")&&(n={}),n=j(n),Be=ns.indexOf(n.PARSER_MEDIA_TYPE)===-1?is:n.PARSER_MEDIA_TYPE,N=Be==="application/xhtml+xml"?$t:He,v=me(n,"ALLOWED_TAGS",Ot,{transform:N}),x=me(n,"ALLOWED_ATTR",Lt,{transform:N}),xt=me(n,"ALLOWED_NAMESPACES",as,{transform:$t}),Mt=me(n,"ADD_URI_SAFE_ATTR",Rr,{transform:N,base:Rr}),Tr=me(n,"ADD_DATA_URI_TAGS",Sr,{transform:N,base:Sr}),se=me(n,"FORBID_CONTENTS",Ft,{transform:N}),Ge=me(n,"FORBID_TAGS",j({}),{transform:N}),mr=me(n,"FORBID_ATTR",j({}),{transform:N}),Ie=Y(n,"USE_PROFILES")?n.USE_PROFILES&&typeof n.USE_PROFILES=="object"?j(n.USE_PROFILES):n.USE_PROFILES:!1,Ar=n.ALLOW_ARIA_ATTR!==!1,bt=n.ALLOW_DATA_ATTR!==!1,hr=n.ALLOW_UNKNOWN_PROTOCOLS||!1,pr=n.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=n.SAFE_FOR_TEMPLATES||!1,ue=n.SAFE_FOR_XML!==!1,pe=n.WHOLE_DOCUMENT||!1,Re=n.RETURN_DOM||!1,tt=n.RETURN_DOM_FRAGMENT||!1,rt=n.RETURN_TRUSTED_TYPE||!1,yt=n.FORCE_BODY||!1,Er=n.SANITIZE_DOM!==!1,Vr=n.SANITIZE_NAMED_PROPS||!1,Dt=n.KEEP_CONTENT!==!1,at=n.IN_PLACE||!1,fr=pn(n.ALLOWED_URI_REGEXP)?n.ALLOWED_URI_REGEXP:jr,ge=typeof n.NAMESPACE=="string"?n.NAMESPACE:ne,Nt=Y(n,"MATHML_TEXT_INTEGRATION_POINTS")&&n.MATHML_TEXT_INTEGRATION_POINTS&&typeof n.MATHML_TEXT_INTEGRATION_POINTS=="object"?j(n.MATHML_TEXT_INTEGRATION_POINTS):D({},Ir),kt=Y(n,"HTML_INTEGRATION_POINTS")&&n.HTML_INTEGRATION_POINTS&&typeof n.HTML_INTEGRATION_POINTS=="object"?j(n.HTML_INTEGRATION_POINTS):D({},gr);const _=Y(n,"CUSTOM_ELEMENT_HANDLING")&&n.CUSTOM_ELEMENT_HANDLING&&typeof n.CUSTOM_ELEMENT_HANDLING=="object"?j(n.CUSTOM_ELEMENT_HANDLING):De(null);if(G=De(null),Y(_,"tagNameCheck")&&Pr(_.tagNameCheck)&&(G.tagNameCheck=_.tagNameCheck),Y(_,"attributeNameCheck")&&Pr(_.attributeNameCheck)&&(G.attributeNameCheck=_.attributeNameCheck),Y(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),H(G),le&&(bt=!1),tt&&(Re=!0),Ie&&(v=D({},zr),x=De(null),Ie.html===!0&&(D(v,Yr),D(x,Hr)),Ie.svg===!0&&(D(v,jt),D(x,Qt),D(x,ft)),Ie.svgFilters===!0&&(D(v,qt),D(x,Qt),D(x,ft)),Ie.mathMl===!0&&(D(v,Kt),D(x,$r),D(x,ft))),ce.tagCheck=null,ce.attributeCheck=null,Y(n,"ADD_TAGS")&&(typeof n.ADD_TAGS=="function"?ce.tagCheck=n.ADD_TAGS:he(n.ADD_TAGS)&&(v===Ot&&(v=j(v)),D(v,n.ADD_TAGS,N))),Y(n,"ADD_ATTR")&&(typeof n.ADD_ATTR=="function"?ce.attributeCheck=n.ADD_ATTR:he(n.ADD_ATTR)&&(x===Lt&&(x=j(x)),D(x,n.ADD_ATTR,N))),Y(n,"ADD_URI_SAFE_ATTR")&&he(n.ADD_URI_SAFE_ATTR)&&D(Mt,n.ADD_URI_SAFE_ATTR,N),Y(n,"FORBID_CONTENTS")&&he(n.FORB
3ID_CONTENTS)&&(se===Ft&&(se=j(se)),D(se,n.FORBID_CONTENTS,N)),Y(n,"ADD_FORBID_CONTENTS")&&he(n.ADD_FORBID_CONTENTS)&&(se===Ft&&(se=j(se)),D(se,n.ADD_FORBID_CONTENTS,N)),Dt&&(v["#text"]=!0),pe&&D(v,["html","head","body"]),v.table&&(D(v,["tbody"]),delete Ge.tbody),n.TRUSTED_TYPES_POLICY){if(typeof n.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof n.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const d=O;O=n.TRUSTED_TYPES_POLICY;try{B=Se("")}catch(p){throw O=d,p}}else n.TRUSTED_TYPES_POLICY===null?(O=void 0,B=""):(O===void 0&&(O=Ha()),O&&typeof B=="string"&&(B=Se("")));z&&z(n),Pe=n},Or=D({},[...jt,...qt,...En]),Lr=D({},[...Kt,...Vn]),_s=function(n,_,d){return _.namespaceURI===ne?n==="svg":_.namespaceURI===st?n==="svg"&&(d==="annotation-xml"||Nt[d]):!!Or[n]},cs=function(n,_,d){return _.namespaceURI===ne?n==="math":_.namespaceURI===nt?n==="math"&&kt[d]:!!Lr[n]},ls=function(n,_,d){return _.namespaceURI===nt&&!kt[d]||_.namespaceURI===st&&!Nt[d]?!1:!Lr[n]&&(ss[n]||!Or[n])},us=function(n){let _=y(n);(!_||!_.tagName)&&(_={namespaceURI:ge,tagName:"template"});const d=He(n.tagName),p=He(_.tagName);return xt[n.namespaceURI]?n.namespaceURI===nt?_s(d,_,p):n.namespaceURI===st?cs(d,_,p):n.namespaceURI===ne?ls(d,_,p):!!(Be==="application/xhtml+xml"&&xt[n.namespaceURI]):!1},de=function(n){we(e.removed,{element:n});try{y(n).removeChild(n)}catch{if(g(n),!y(n))throw Ve("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},it=function(n){We(n);const _=w(n);if(_){const p=[];be(_,E=>{we(p,E)}),be(p,E=>{try{g(E)}catch{}})}const d=P(n);if(d)for(let p=d.length-1;p>=0;--p){const E=d[p],I=E&&E.name;if(typeof I=="string")try{n.removeAttribute(I)}catch{}}},Ee=function(n,_){try{we(e.removed,{attribute:_.getAttributeNode(n),from:_})}catch{we(e.removed,{attribute:null,from:_})}if(_.removeAttribute(n),n==="is")if(Re||tt)try{de(_)}catch{}else try{_.setAttribute(n,"")}catch{}},ds=function(n){const _=P(n);if(_)for(let d=_.length-1;d>=0;--d){const p=_[d],E=p&&p.name;if(!(typeof E!="string"||x[N(E)]))try{n.removeAttribute(E)}catch{}}},We=function(n){const _=[n];for(;_.length>0;){const d=_.pop();(R?R(d):d.nodeType)===J.element&&ds(d);const E=w(d);if(E)for(let I=E.length-1;I>=0;--I)_.push(E[I])}},fs=function(n){if(!ue)return;const _=[n];for(;_.length>0;){const d=_.pop(),p=R?R(d):d.nodeType;if(p===J.processingInstruction||p===J.comment&&X(Kr,d.data)){try{g(d)}catch{}continue}if(p===J.element){const I=d,F=N($?$(d):d.nodeName);try{I.hasAttribute&&I.hasAttribute("patchsrc")&&I.removeAttribute("patchsrc"),I.hasAttribute&&I.hasAttribute("for")&&F!=="label"&&F!=="output"&&I.removeAttribute("for")}catch{}}const E=w(d);if(E)for(let I=E.length-1;I>=0;--I)_.push(E[I])}},br=function(n){let _=null,d=null;if(yt)n="<remove></remove>"+n;else{const I=Gr(n,/^[\r\n\t ]+/);d=I&&I[0]}Be==="application/xhtml+xml"&&ge===ne&&(n='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+n+"</body></html>");const p=O?Se(n):n;if(ge===ne)try{_=new h().parseFromString(p,Be)}catch{}if(!_||!_.documentElement){_=Pt.createDocument(ge,"template",null);try{_.documentElement.innerHTML=vt?B:p}catch{}}const E=_.body||_.documentElement;return n&&d&&E.insertBefore(r.createTextNode(d),E.childNodes[0]||null),ge===ne?ja.call(_,pe?"html":"body")[0]:pe?_.documentElement:E},wr=function(n){const _=ee?ee(n):n.ownerDocument;return ur.call(_||n,n,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ot=function(n){return n=Ye(n,Ka," "),n=Ye(n,Qa," "),n=Ye(n,Ja," "),n},Gt=function(n){var _;n.normalize();const d=ee?ee(n):n.ownerDocument,p=ur.call(d||n,n,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let E=p.nextNode();for(;E;)E.data=ot(E.data),E=p.nextNode();const I=(_=n.querySelectorAll)===null||_===void 0?void 0:_.call(n,"template");I&&be(I,F=>{Oe(F.content)&&Gt(F.content)})},_t=function(n){const _=$?$(n):null;return typeof _!="string"||N(_)!=="form"?!1:typeof n.nodeName!="string"||typeof n.textContent!="string"||typeof n.removeChild!="function"||n.attributes!==P(n)||typeof n.removeAttribute!="function"||typeof n.setAttribute!="function"||typeof n.namespaceURI!="string"||typeof n.insertBefore!="function"||typeof n.hasChildNodes!="function"||n.nodeType!==R(n)||n.childNodes!==w(n)},Oe=function(n){if(!R||typeof n!="object"||n===null)return!1;try{return R(n)===J.documentFragment}catch{return!1}},Xe=function(n){if(!R||typeof n!="object"||n===null)return!1;try{return typeof R(n)=="number"}catch{return!1}};function ie(f,n,_){f.length!==0&&be(f,d=>{d.call(e,n,_,Pe)})}const ms=function(n,_){return!!(ue&&n.hasChildNodes()&&!Xe(n.firstElementChild)&&X(qr,n.textContent)&&X(qr,n.innerHTML)||ue&&n.namespaceURI===ne&&_==="style"&&Xe(n.firstElementChild)||n.nodeType===J.processingInstruction||ue&&n.nodeType===J.comment&&X(Kr,n.data))},As=function(n,_,d){if(!Ge[_]&&Mr(_)&&(G.tagNameCheck instanceof RegExp&&X(G.tagNameCheck,_)||G.tagNameCheck instanceof Function&&G.tagNameCheck(_)))return!1;if(Dt&&!se[_]){const p=y(n),E=w(n);if(E&&p){const I=E.length;for(let F=I-1;F>=0;--F){const k=n===d?T(E[F],!0):E[F];p.insertBefore(k,b(n))}}}return de(n),!0},yr=function(n,_,d,p){return n.length===0?_:_===d||_===p?j(_):_},Dr=function(n,_){if(ie(M.beforeSanitizeElements,n,null),n!==_&&y(n)===null)return at&&We(n),!0;if(_t(n))return de(n),!0;const d=N($?$(n):n.nodeName);if(v=yr(M.uponSanitizeElement,v,Ot,Ze),ie(M.uponSanitizeElement,n,{tagName:d,allowedTags:v}),n!==_&&y(n)===null)return at&&We(n),!0;if(ms(n,d))return de(n),!0;if(Ge[d]||!(ce.tagCheck instanceof Function&&ce.tagCheck(d))&&!v[d]){const E=As(n,d,_);return E===!1&&ie(M.afterSanitizeElements,n,null),E}if((R?R(n):n.nodeType)===J.element&&!us(n)||(d==="noscript"||d==="noembed"||d==="noframes")&&X(bn,n.innerHTML))return de(n),!0;if(le&&n.nodeType===J.text){const E=ot(n.textContent);n.textContent!==E&&(we(e.removed,{element:n.cloneNode()}),n.textContent=E)}return ie(M.afterSanitizeElements,n,null),!1},Fr=function(n,_,d){if(mr[_]||ue&&_==="patchsrc"||ue&&_==="for"&&n!=="label"&&n!=="output"||Er&&(_==="id"||_==="name")&&(d in r||d in os))return!1;const p=x[_]||ce.attributeCheck instanceof Function&&ce.attributeCheck(_,n);if(!(bt&&X(Za,_))){if(!(Ar&&X(es,_))){if(p){if(!Mt[_]){if(!X(fr,Ye(d,dr,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&n!=="script"&&Br(d,"data:")===0&&Tr[n])){if(!(hr&&!X(ts,Ye(d,dr,"")))){if(d)return!1}}}}}else if(!(Mr(n)&&(G.tagNameCheck instanceof RegExp&&X(G.tagNameCheck,n)||G.tagNameCheck instanceof Function&&G.tagNameCheck(n))&&(G.attributeNameCheck instanceof RegExp&&X(G.attributeNameCheck,_)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(_,n))||_==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&X(G.tagNameCheck,d)||G.tagNameCheck instanceof Function&&G.tagNameCheck(d))))return!1}}return!0},hs=D({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Mr=function(n){return!hs[He(n)]&&X(rs,n)},ps=function(n,_,d,p){if(O&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!d)switch(A.getAttributeType(n,_)){case"TrustedHTML":return Se(p);case"TrustedScriptURL":return za(p)}return p},Es=function(n,_,d,p){try{d?n.setAttributeNS(d,_,p):n.setAttribute(_,p),_t(n)?de(n):Ur(e.removed)}catch{Ee(_,n)}},vr=function(n){ie(M.beforeSanitizeAttributes,n,null);const _=n.attributes;if(!_||_t(n))return;x=yr(M.uponSanitizeAttribute,x,Lt,et);const d={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:x,forceKeepAttr:void 0};let p=_.length;const E=N(n.nodeName);for(;p--;){const I=_[p],F=I.name,k=I.namespaceURI,K=I.value,Q=N(F),Wt=K;let q=F==="value"?Wt:un(Wt);
vendor: 3,656 bytes, lines 3-4
3if(d.attrName=Q,d.attrValue=q,d.keepAttr=!0,d.forceKeepAttr=void 0,ie(M.uponSanitizeAttribute,n,d),q=d.attrValue,Vr&&(Q==="id"||Q==="name")&&Br(q,Cr)!==0&&(Ee(F,n),q=Cr+q),ue&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,q)){Ee(F,n);continue}if(Q==="attributename"&&Gr(q,"href")){Ee(F,n);continue}if(!d.forceKeepAttr){if(!d.keepAttr){Ee(F,n);continue}if(!pr&&X(wn,q)){Ee(F,n);continue}if(le&&(q=ot(q)),!Fr(E,Q,q)){Ee(F,n);continue}q=ps(E,Q,k,q),q!==Wt&&Es(n,F,k,q)}}ie(M.afterSanitizeAttributes,n,null)},ct=function(n){let _=null;const d=wr(n);for(ie(M.beforeSanitizeShadowDOM,n,null);_=d.nextNode();)if(ie(M.uponSanitizeShadowNode,_,null),Dr(_,n),vr(_),Oe(_.content)&&ct(_.content),(R?R(_):_.nodeType)===J.element){const E=S(_);Oe(E)&&(Bt(E),ct(E))}ie(M.afterSanitizeShadowDOM,n,null)},Bt=function(n){const _=[{node:n,shadow:null}];for(;_.length>0;){const d=_.pop();if(d.shadow){ct(d.shadow);continue}const p=d.node,I=(R?R(p):p.nodeType)===J.element,F=w(p);if(F)for(let k=F.length-1;k>=0;--k)_.push({node:F[k],shadow:null});if(I){const k=$?$(p):null;if(typeof k=="string"&&N(k)==="template"){const K=p.content;Oe(K)&&_.push({node:K,shadow:null})}}if(I){const k=S(p);Oe(k)&&_.push({node:null,shadow:k},{node:k,shadow:null})}}};return e.sanitize=function(f){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,d=null,p=null,E=null;if(vt=!f,vt&&(f="<!-->"),typeof f!="string"&&!Xe(f)&&(f=hn(f),typeof f!="string"))throw Ve("dirty is not a string, aborting");if(!e.isSupported)return f;wt?(v=Ze,x=et):Ut(n),(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&(v=j(v)),M.uponSanitizeAttribute.length>0&&(x=j(x)),e.removed=[];const I=at&&typeof f!="string"&&Xe(f);if(I){fs(f);const K=$?$(f):f.nodeName;if(typeof K=="string"){const Q=N(K);if(!v[Q]||Ge[Q])throw it(f),Ve("root node is forbidden and cannot be sanitized in-place")}if(_t(f))throw it(f),Ve("root node is clobbered and cannot be sanitized in-place");try{Bt(f)}catch(Q){throw it(f),Q}}else if(Xe(f))_=br("<!---->"),d=_.ownerDocument.importNode(f,!0),d.nodeType===J.element&&d.nodeName==="BODY"||d.nodeName==="HTML"?_=d:_.appendChild(d),Bt(d);else{if(!Re&&!le&&!pe&&f.indexOf("<")===-1)return O&&rt?Se(f):f;if(_=br(f),!_)return Re?null:rt?B:""}_&&yt&&de(_.firstChild);const F=I?f:_;try{const K=wr(F);for(;p=K.nextNode();)Dr(p,F),vr(p),Oe(p.content)&&ct(p.content)}catch(K){throw I&&(it(f),be(e.removed,Q=>{Q.element&&We(Q.element)})),K}if(I)return be(e.removed,K=>{K.element&&We(K.element)}),le&&Gt(f),f;if(Re){if(le&&Gt(_),tt)for(E=$a.call(_.ownerDocument);_.firstChild;)E.appendChild(_.firstChild);else E=_;return(x.shadowroot||x.shadowrootmode)&&(E=qa.call(s,E,!0)),E}let k=pe?_.outerHTML:_.innerHTML;return pe&&v["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&X(On,_.ownerDocument.doctype.name)&&(k="<!DOCTYPE "+_.ownerDocument.doctype.name+`> 4`+k),le&&(k=ot(k)),O&&rt?Se(k):k},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ut(f),wt=!0,Ze=v,et=x},e.clearConfig=function(){Pe=null,wt=!1,Ze=null,et=null,O=te,B=""},e.isValidAttribute=function(f,n,_){Pe||Ut({});const d=N(f),p=N(n);return Fr(d,p,_)},e.addHook=function(f,n){typeof n=="function"&&Y(M,f)&&we(M[f],n)},e.removeHook=function(f,n){if(Y(M,f)){if(n!==void 0){const _=cn(M[f],n);return _===-1?void 0:ln(M[f],_,1)[0]}return Ur(M[f])}},e.removeHooks=function(f){Y(M,f)&&(M[f]=[])},e.removeAllHooks=function(){M=Qr()},e}Ma();var V=(t=>(t.NOT_IMPLEMENTED="EEE",t.LOGIC_ERR="E00",t.UNKNOWN_ERR="E01",t.IMAGE_ASSET_LOST="E02",t.VIDEO_ASSET_LOST="E03",t.FFMPEG_SPAWN_FAILED="E04",t.FILE_READ_E
4RROR="E05",t.VIDEO_FORMAT_ERR="E06",t.VIDEO_DECODE_ERR="E07",t.VIDEO_RENDER_ERR="E08",t.CANVAS_CTX_ERR="E09",t.VIDEO_ENCODE_ERR="E10",t.NO_SUPPORTED_CONFIG="E11",t.ENCODED_VIDEO_NOT_FOUND="E12",t.CHAR_ASSET_LOST="E13",t.SIMPLE_CHARACTER_ASSET_LOST="E14",t.WATERMARK_LOST="E15",t.DISK_WRITE_ERR="E16",t.DISK_NO_SPACE="E17",t.MUXER_ERR="E18",t.CANVAS_RENDER_EMPTY_BLOB="E19",t.MUXING_AUDIO_FAILED="E20",t.AUDIO_EXPORT_ERR="E21",t.SOURCE_LOST="E22",t.ALPHA_MODE_ERR="E23",t.ASSET_CHUNK_LOST="E24",t.CTX_LOST="E25",t.ENCODER_TIMEOUT="E26",t.ENCODER_OPERATION_ERR="E27",t.NETWORK_FAILED_ERR="E28",t.BITMAP_CREATION_ERR="E29",t.AUDIO_LOGIC_ERR="E30",t.AUDIO_DECODE_ERR="E31",t.AUDIO_ENCODE_ERR="E32",t.AUDIO_DECODER_CONFIG_ERR="E33",t.DECODER_WORKER_SPAWN_ERR="E34",t.AUDIO_FORMAT_ERR="E35",t.IMAGE_EXPORT_GENERAL_ERROR="E36",t.RENDERER_INIT_HWACCEL_UNAVAILABLE="E37",t.AUDIO_ENCODER_TIMEOUT="E38",t.AUDIO_ENCODER_CONFIG_ERR="E39",t))(V||{});class Fn{process=(e,r)=>{const s=[];for(let a=0;a<r;a++){const i=Math.min(a,e.data.length-1);s.push(e.data[i])}return{timelineIndex:e.timelineIndex,sampleRate:e.sampleRate,data:s}}}const $e=(t,e)=>Math.round(t/1e6*e),Mn=(t,e)=>
4Math.round(t/e*1e6),Jr=(t,e,r)=>Math.round(t*r/e);class vn{_targetSampleRate;_sourceSampleRate=0;_positionNumerator=0;_lastSamplePerChannel=new Float32Array(0);_currTimelineIdx=0;_sourceEndTimelineIdx=0;constructor(e){this._targetSampleRate=e.sampleRate}process(e){this._sourceSampleRate!==e.sampleRate&&(this.clear(),this._sourceSampleRate=e.sampleRate,this._lastSamplePerChannel=new Float32Array(e.data.length),this._currTimelineIdx=Jr(e.timelineIndex,e.sampleRate,this._targetSampleRate),this._positionNumerator=this._currTimelineIdx*e.sampleRate-e.timelineIndex*this._targetSampleRate);const r=[];if(this._sourceSampleRate===this._targetSampleRate)r.push(e),this._currTimelineIdx=this._currTimelineIdx+e.data[0].length;else{const s=this._resample(e.data);s[0].length>0&&r.push({timelineIndex:this._currTimelineIdx,data:s,sampleRate:this._targetSampleRate}),this._currTimelineIdx=this._currTimelineIdx+s[0].length}return this._sourceEndTimelineIdx=e.timelineIndex+e.data[0].length,r}flush(){if(this._sourceSampleRate===0||this._sourceSampleRate===this._targetSampleRate)return this.clear(),[];const r=Jr(this._sourceEndTimelineIdx,this._sourceSampleRate,this._targetSampleRate)-this._currTimelineIdx;if(r<=0)return this.clear(),[];const s=Array.from(this._lastSamplePerChannel,i=>new Float32Array(r).fill(i)),a={timelineIndex:this._currTimelineIdx,data:s,sampleRate:this._targetSampleRate};return this.clear(),[a]}clear(){this._positionNumerator=0,this._lastSamplePerChannel=new Float32Array(0),this._sourceSampleRate=0,this._currTimelineIdx=0,this._sourceEndTimelineIdx=0}_resample(e){const r=e.map(()=>[]),s=this._targetSampleRate;for(;Math.floor(this._positionNumerator/s)<e[0].length-1;){const a=Math.floor(this._positionNumerator/s),o=(this._positionNumerator-a*s)/s;for(let c=0;c<e.length;c++){const u=e[c];let m,h;a<0?(m=this._lastSamplePerChannel[c],h=u[0]):(m=u[a],h=u[a+1]),r[c].push(m+(h-m)*o)}this._positionNumerator+=this._sourceSampleRate}return this._positionNumerator-=e[0].length*s,this._updateLastSamplePerChannel(e),r.map(a=>new Float32Array(a))}_updateLastSamplePerChannel(e){e.length!==this._lastSamplePerChannel.length&&(this._lastSamplePerChannel=new Float32Array(e.length));const r=e[0].length-1;for(let s=0;s<e.length;s++)this._lastSamplePerChannel[s]=e[s][r]}}const va=t=>{switch(t){case"mp3":return["mp3","mp4a.69","mp4a.6B"];case"aac":return["mp4a.40.2","mp4a.40.02","mp4a.40.5","mp4a.40.05","mp4a.40.29","mp4a.67"];case"pcm-u8":return["pcm-u8"];case"pcm-s16":return["pcm-s16"];case"pcm-s24":return["pcm-s24"];case"pcm-s32":return["pcm-s32"];case"pcm-f32":return["pcm-f32"];case"opus":return["opus"];case"vorbis":return["vorbis"];default:throw new Error(`invalid codec: ${t}`)}},xn=t=>{const e=["mp3","aac","pcm-u8","pcm-s16","pcm-s24","pcm-s32","pcm-f32","opus","vorbis"];for(const r of e)if(va(r).includes(t.codec))return r;throw new Error(`invalid codec: ${t.codec}`)},ir=(t,e)=>Array.from({length:t},()=>new Float32Array(e));class Nn{constructor(e){this._numberOfChannels=e,this._buffer=ir(this._numberOfChannels,0),this._length=0}_numberOfChannels;_buffer;_length;get length(){return this._length}get numberOfChannels(){return this._numberOfChannels}destroy=()=>{this._buffer=[],this._length=0};push(e){const r=e[0].length;this._ensureCapacity(r+this._length);for(let s=0;s<this._numberOfChannels;s++)this._buffer[s].set(e[s],this._length);this._length+=r}shift(e){const r=Math.min(e,this._length),s=ir(this._numberOfChannels,r);for(let a=0;a<this._numberOfChannels;a++){const i=this._buffer[a].subarray(0,r);s[a].set(i),this._buffer[a].copyWithin(0,r)}return this._length-=r,s}subarray(e,r){const s=e??0,a=r??this._length;return Array.from({length:this._numberOfChannels},(i,o)=>this._buffer[o].subarray(s,a))}_ensureCapacity(e){const r=this._buffer[0].length;if(e-r>0)for(let a=0;a<this._numberOfChannels;a++){const i=new Float32Array(e);i.set(this._buffer[a]),this._buffer[a]=i}}}const kn=t=>{const e=t[0]?.data.length??0;if(e===0)return[];const r=t.reduce((i,o)=>i+(o.data[0]?.length??0),0),s=Array.from({length:e},()=>new Float32Array(r));let a=0;for(const i of t){const o=i.data[0]?.length??0;for(let c=0;c<e;c++)s[c].set(i.data[c]??new Float32Array(0),a);a+=o}return s},Un=(t,e)=>ha(t,e),xa=(t,e,r)=>({debug:r?(...s)=>t.debug(...s):()=>{}
4,verbose:(...s)=>t.verbose(...s),info:(...s)=>t.info(...s),warn:(...s)=>t.warn(...s),error:(...s)=>t.error(...s)}),gt=35,Na=gt/2.14,Gn=gt/4,Bn=1,Wn=1;class Xn{_input=null;_processIdx=0;_overlapIdx=0;_skipRemainder=0;_isFirstWindow=!0;_tempo=1;_currTimelineIdx=0;_inputSamples=0;_outputSamples=0;_sampleRate=0;process(e,r){if((this._input===null||this._sampleRate!==e.sampleRate||e.data.length!==this._input?.numberOfChannels||this._tempo!==r)&&(this.clear(),this._input=new Nn(e.data.length),this._processIdx=0,this._overlapIdx=0,this._skipRemainder=0,this._isFirstWindow=!0,this._tempo=r,this._currTimelineIdx=e.timelineIndex,this._inputSamples=0,this._outputSamples=0,this._sampleRate=e.sampleRate),r===1)return this._currTimelineIdx=e.timelineIndex+e.data[0].length,[e];{this._input.push(e.data),this._inputSamples+=e.data[0].length;const{output:s,overlapIdx:a,processIdx:i,skipRemainder:o}=Zr(this._input.subarray(),e.sampleRate,r,{mode:"stream",isFirstWindow:this._isFirstWindow,overlapIdx:this._overlapIdx,processIdx:this._processIdx,skipRemainder:this._skipRemainder}),c=Math.min(i,a);this._input.shift(c),this._overlapIdx=a-c,this._processIdx=i-c,this._skipRemainder=o,s[0].length>0&&(this._isFirstWindow=!1);const u=[];return s[0].length>0&&u.push({timelineIndex:this._currTimelineIdx,data:s.map(m=>new Float32Array(m)),sampleRate:e.sampleRate}),this._currTimelineIdx+=s[0].length,this._outputSamples+=s[0].length,u}}flush=()=>
4{if(this._input===null||this._tempo===1||this._inputSamples===0)return this.clear(),[];const r=Math.round(this._inputSamples/this._tempo)-this._outputSamples;if(r<=0)return this.clear(),[];const s=this._sampleRate,a=this._currTimelineIdx,i=Math.round(s*gt/1e3),o=Math.round(s*Na/1e3),c=i+o,{output:u}=Zr($n(this._input.subarray(),this._input.length+c),s,this._tempo,{mode:"drain",isFirstWindow:this._isFirstWindow,overlapIdx:this._overlapIdx,processIdx:this._processIdx,skipRemainder:this._skipRemainder}),m=u.map(h=>{const A=new Float32Array(r);return A.set(h.slice(0,r)),A});return this.clear(),[{timelineIndex:a,data:m,sampleRate:s}]};clear=()=>{this._input?.destroy(),this._input=null,this._processIdx=0,this._overlapIdx=0,this._skipRemainder=0,this._isFirstWindow=!0,this._tempo=1,this._currTimelineIdx=0,this._inputSamples=0,this._outputSamples=0,this._sampleRate=0}}const Zr=(t,e,r,s)=>{const a=Math.round(e*gt/1e3),i=Math.round(e*Na/1e3),o=Math.round(e*Gn/1e3),c=Array.from({length:t.length},()=>[]),u=a-o,m=Math.ceil(r*u),h=s.mode==="drain"?o:Math.max(m+o,a)+i;let A=s.processIdx,l=s.overlapIdx,T=s.skipRemainder,g=s.isFirstWindow;for(;A<t[0].length-h&&l<t[0].length-o;){let b;if(g){b=Math.round(i/2);for(let y=0;y<t.length;y++)c[y].push(...t[y].subarray(b,b+o))}else{const y=[A,Math.min(A+i,t[0].length-o)],S=[l,l+o];b=zn(t,y,S,Bn,Wn),Hn(c,t,l,b,o)}for(let y=0;y<t.length;y++)c[y].push(...t[y].subarray(b+o,b+a-o));l=b+a-o;const w=Yn(T,u,r);A+=w.skipSize,T=w.remainder,g=!1}return{output:c,overlapIdx:l,processIdx:A,skipRemainder:T}},Yn=(t,e,r)=>{const s=t+r*e,a=Math.floor(s);return{skipSize:a,remainder:s-a}},zn=(t,e,r,s,a)=>{let i=0,o=Number.POSITIVE_INFINITY;const[c,u]=e,[m,h]=r;for(let A=c;A<u;A+=s){let l=0;for(let T=m;T<h;T+=a)for(let g=0;g<t.length;g++)l+=Math.pow(t[g][A+T-m]-t[g][T],2);l<o&&(o=l,i=A)}return i},Hn=(t,e,r,s,a)=>{const i=1/a;for(let o=0;o<t.length;o++)for(let c=0;c<a;c++){const u=i*c,m=1-u,h=e[o][r+c]*m,A=e[o][s+c]*u;t[o].push(h+A)}},$n=(t,e)=>t.map(r=>{const s=Math.max(0,Math.floor(e));if(r.length>=s)return r.slice(0,s);if(s===0)return new Float32Array(0);const a=new Float32Array(s);if(a.set(r),r.length===0)return a;if(r.length===1)return a.fill(r[0],1),a;const i=2*(r.length-1);for(let o=r.length;o<s;o++){const c=Math.abs(r.length-1-(o-r.length+1)%i);a[o]=r[c]}return a});class ka{_results=[];_sampleRate=null;init(e){this._sampleRate=e}get length(){return this._results.length}get sampleRate(){if(!this._sampleRate)throw C(V.AUDIO_LOGIC_ERR,"AudioDecoderQueue is not initialized");return this._sampleRate}push(e){this._results.push(e)}get(e){const r=this.sampleRate;for(;this._results.length>0;){const s=this._results[0],a=s.timestamp+s.duration,i=$e(e,r),o=$e(a,r);if(i<o)return s.clone();this._results.shift().close()}return null}clear(){this._results.forEach(e=>e.close()),this._results.splice(0,this._results.length),this._results.length=0}}class qe{_origin;_format;constructor(e){this._origin=e,e instanceof AudioData?this._format=e.format:this._format=jn(e.data)}get sampleRate(){return this._origin.sampleRate}get timestamp(){return this._origin.timestamp}get format(){return this._format}get numberOfChannels(){return this._origin instanceof AudioData?this._origin.numberOfChannels:this._origin.data.length}get numberOfFrames(){return this._origin instanceof AudioData?this._origin.numberOfFrames:this._origin.data[0].length}get duration(){return this._origin instanceof AudioData?this._origin.duration:Mn(this.numberOfFrames,this.sampleRate)}clone(){return this._origin instanceof AudioData?new qe(this._origin.clone()):new qe({data:this._origin.data.map(e=>e.slice()),sampleRate:this.sampleRate,timestamp:this.timestamp})}close(){this._origin instanceof AudioData&&this._origin.close()}copyTo(e,r){if(this._origin instanceof AudioData)return this._origin.copyTo(e,{...r,format:"f32-planar"});const s=r.planeIndex,a=r.frameOffset||0,i=a+(r.frameCount||this.numberOfFrames),o=this._origin.data[s].subarray(a,i);qn(o,e)}}const jn=t=>t instanceof Uint8Array?"u8-planar":t instanceof Int16Array?"s16-planar":t instanceof Int32Array?"s32-planar":"f32-planar",qn=(t,e)=>{t instanceof Uint8Array?Kn(t,e):t instanceof Int16Array?Qn(t,e):t instanceof Int32Array?Jn(t,e):t instanceof Float32Array&&e.set(t)},Kn=(t,e)=>{for(let r=0;r<t.length;r++)e[r]=t[r]/255},Qn=(t,e)=>{for(let r=0;r<t.length;r++)e[r]=t[r]/32767},Jn=(t,e)=>{for(let r=0;r<t.length;r++)e[r]=t[r]/2147483647};
4class je{future=null;current=null;_isResolved=!1;promise(e=!1){return e&&this.reset(),this.current?this.current:this.current=new Promise((r,s)=>{this.future={resolve:r,reject:s}})}resolve(e,r=!0,s=!1){if(!this.future){if(s)return;throw new Error("No promise")}this._isResolved||(this.future.resolve(e),this._isResolved=!0,r&&this.reset())}reject(e,r=!0,s=!1){if(!this.future){if(s)return;throw new Error("No promise")}this._isResolved||(this.future.reject(e),this._isResolved=!0,r&&this.reset())}reset(){return this.current=null,this.future=null,this._isResolved=!1,this}}const Zn=1024*2,ei=1152*3,ti=0,Ua=(t,e)=>t.includes("aac")?Ht(Zn,e).as.us():t.includes("mp3")?Ht(ei,e).as.us():t.includes("pcm")?Ht(ti,e).as.us():t.includes("opus")?U.fromMS(80).as.us():0;async function Ga(t,e){let r;e.codecpar?r=await t.ff_copyout_codecpar(e.codecpar):r=e;const s=await t.avcodec_get_name(r.codec_id),a={codec:"",sampleRate:r.sample_rate,numberOfChannels:r.channels},i=r.extradata;switch(s){case"flac":a.codec="flac",a.description=i;break;case"mp3":a.codec="mp3";break;case"aac":{switch(r.profile){case 1:default:a.codec="mp4a.40.2";break;case 4:a.codec="mp4a.40.5";break;case 28:a.codec="mp4a.40.29";break}i&&(a.description=i);break}case"opus":a.codec="opus";break;case"vorbis":a.codec="vorbis",a.description=i;break;case"pcm_f32le":a.codec="pcm-f32";break;case"pcm_f32be":a.codec="pcm-f32be";break;case"pcm_s32le":a.codec="pcm-s32";break;case"pcm_s32be":a.codec="pcm-s32be";break;case"pcm_s24le":a.codec="pcm-s24";break;case"pcm_s24be":a.codec="pcm-s24be";break;case"pcm_s16le":a.codec="pcm-s16";break;case"pcm_s16be":a.codec="pcm-s16be";break;case"pcm_u8":a.codec="pcm-u8";break}if(a.codec)return a;throw new Error(`Unsupported audio codec: ${s}`)}function ri(t,e,r){let s=(t.durationhi||0)*4294967296+(t.duration||0),a=(t.ptshi||0)*4294967296+(t.pts||0);r&&r.i64tof64&&(s=r.i64tof64(t.duration||0,t.durationhi||0),a=r.i64tof64(t.pts||0,t.ptshi||0));let i=t.time_base_num,o=t.time_base_den;if(!i)if(e.length){const m=e;i=m[0],o=m[1]}else{const m=e;i=m.time_base_num,o=m.time_base_den}const c=Math.round(s*i/(o||1)*1e6);return{timestamp:Math.round(a*i/(o||1)*1e6),duration:c}}function ai(t,e,r){const{timestamp:s,duration:a}=ri(t,e,r);return new EncodedAudioChunk({type:"key",timestamp:s,duration:a,data:t.data.buffer})}const L={};(function(){function t(o){if(o=o||[0,97,115,109,1,0,0,0],typeof WebAssembly!="object"||typeof WebAssembly.instantiate!="function")return!1;try{var o=new WebAssembly.Module(new Uint8Array(o));if(o instanceof WebAssembly.Module)return new WebAssembly.Instance(o)instanceof WebAssembly.Instance}catch{}return!1}function e(){try{var o=new WebAssembly.Memory({initial:1,maximum:1,shared:!0});return o.buffer instanceof SharedArrayBuffer}catch{}return!1}var r=typeof process<"u";L.base||(L.base=import.meta.url,L.base=L.base.replace(/\/[^\/]*$/,"")),L.isWebAssemblySupported=t,L.isThreadingSupported=e;function s(o){o=o||{};var c=!o.nowasm&&t(),u=o.yesthreads&&c&&!o.nothreads&&e();return c?u?"thr":"wasm":"asm"}L.target=s,L.VER="0.18.8.0",L.CONFIG="vrew",L.DBG="",L.factories={};var a={};a.NULL=0,a.i64tof64=function(o,c){return!c&&o>=0||c===-1&&o<0?o:c*4294967296+o+(o<0?4294967296:0)},a.f64toi64=function(o){return[~~o,Math.floor(o/4294967296)]},a.i64ToBigInt=function(o,c){var u=new DataView(new ArrayBuffer(8));return u.setInt32(0,o,!0),u.setInt32(4,c,!0),u.getBigInt64(0,!0)},a.bigIntToi64=function(o){var c=new DataView(new ArrayBuffer(8));return c.setBigInt64(0,o,!0),[c.getInt32(0,!0),c.getInt32(4,!0)]},a.ff_channel_layout=function(o){return o.channel_layout?o.channel_layout:o.channels&&o.channels!==1?(1<<o.channels)-1:4},a.ff_channels=function(o){if(o.channels)return o.channels;if(o.channel_layout){for(var c=0,u=o.channel_layout;u;)c+=u&1,u>>=1;return c}else return 1},a.AV_VERSION_INT=function(o,c,u){return o<<16|c<<8|u};function i(o,c){typeof c===void 0&&(c=0);var u=c;o.forEach(function(m){a[m]=u++})}a.AV_TIME_BASE=1e6,a.AV_NOPTS_VALUE_I64=[0,-2147483648],a.AV_NOPTS_VALUE_LO=0,a.AV_NOPTS_VALUE_HI=-2147483648,a.AV_NOPTS_VALUE=a.i64tof64(0,-2147483648),a.AV_OPT_SEARCH_CHILDREN=1,i(["AVMEDIA_TYPE_UNKNOWN","AVMEDIA_TYPE_VIDEO","AVMEDIA_TYPE_AUDIO","AVMEDIA_TYPE_DATA","AVMEDIA_TYPE_SUBTITLE","AVMEDIA_TYPE_ATTACHMENT"],-1),i(["AV_SAMPLE_FMT_NONE","AV_SAMPLE_FMT_U8","AV_SAMPLE_FMT_S16","AV_SAMPLE_FMT_S32","AV_SAMPLE_FMT_FLT","AV_SAMPLE_FMT_DBL","AV_SAMPLE_FMT_U8P","AV_SAMPLE_FMT_S16P","AV_SAMPLE_FMT_S32P","AV_SAMPLE_FMT_FLTP","AV_SAMPLE_FMT_DBLP","AV_SAMPLE_FMT_S64","AV_SAMPLE_FMT_S64P","AV_SAMPLE_FMT_NB"],-1),i(["AV_PIX_FMT_NONE","AV_PIX_FMT_YUV420P","AV_PIX_FMT_YUYV422","AV_PIX_FMT_RGB24","AV_PIX_FMT_BGR24","AV_PIX_FMT_YUV422P","AV_PIX_FMT_YUV444P","AV_PIX_FMT_YUV410P","AV_PIX_FMT_YUV411P","AV_PIX_FMT_GRAY8","AV_PIX_FMT_MONOWHITE","AV_PIX_FMT_MONOBLACK","AV_PIX_FMT_PAL8","AV_PIX_FMT_YUVJ420P","AV_PIX_FMT_YUVJ422P","AV_PIX_FMT_YUVJ444P","AV_PIX_FMT_UYVY422","AV_PIX_FMT_UYYVYY411","AV_PIX_FMT_BGR8","AV_PIX_FMT_BGR4","AV_PIX_FMT_BGR4_BYTE","AV_PIX_FMT_RGB8","AV_PIX_FMT_RGB4","AV_PIX_FMT_RGB4_BYTE","AV_PIX_FMT_NV12","AV_PIX_FMT_NV21","AV_PIX_FMT_ARGB","AV_PIX_FMT_RGBA","AV_PIX_FMT_ABGR","AV_PIX_FMT_BGRA","AV_PIX_FMT_GRAY16BE","AV_PIX_FMT_GRAY16LE","AV_PIX_FMT_YUV440P","AV_PIX_FMT_YUVJ440P","AV_PIX_FMT_YUVA420P","AV_PIX_FMT_RGB48BE","AV_PIX_FMT_RGB48LE","AV_PIX_FMT_RGB565BE","AV_PIX_FMT_RGB565LE","AV_PIX_FMT_RGB555BE","AV_PIX_FMT_RGB555LE","AV_PIX_FMT_BGR565BE","AV_PIX_FMT_BGR565LE","AV_PIX_FMT_BGR555BE","AV_PIX_FMT_BGR555LE"],-1),a.AVCOL_PRI_RESERVED0=0,a.AVCOL_PRI_BT709=1,a.AVCOL_PRI_UNSPECIFIED=2,a.AVCOL_PRI_RESERVED=3,a.AVCOL_PRI_BT470M=4,a.AVCOL_PRI_BT470BG=5,a.AVCOL_PRI_SMPTE170M=6,a.AVCOL_PRI_SMPTE240M=7,a.AVCOL_PRI_FILM=8,a.AVCOL_PRI_BT2020=9,a.AVCOL_PRI_SMPTE428=10,a.AVCOL_PRI_SMPTEST428_1=a.AVCOL_PRI_SMPTE428,a.AVCOL_PRI_SMPTE431=11,a.AVCOL_PRI_SMPTE432=12,a.AVCOL_PRI_EBU3213=22,a.AVCOL_PRI_JEDEC_P22=a.AVCOL_PRI_EBU3213,a.AVCOL_TRC_RESERVED0=0,a.AVCOL_TRC_BT709=1,a.AVCOL_TRC_UNSPECIFIED=2,a.AVCOL_TRC_RESERVED=3,a.AVCOL_TRC_GAMMA22=4,a.AVCOL_TRC_GAMMA28=5,a.AVCOL_TRC_SMPTE170M=6,a.AVCOL_TRC_SMPTE240M=7,a.AVCOL_TRC_LINEAR=8,a.AVCOL_TRC_LOG=9,a.AVCOL_TRC_LOG_SQRT=10,a.AVCOL_TRC_IEC61966_2_4=11,a.AVCOL_TRC_BT1361_ECG=12,a.AVCOL_TRC_IEC61966_2_1=13,a.AVCOL_TRC_BT2020_10=14,a.AVCOL_TRC_BT2020_12=15,a.AVCOL_TRC_SMPTE2084=16,a.AVCOL_TRC_SMPTEST2084=a.AVCOL_TRC_SMPTE2084,a.AVCOL_TRC_SMPTE428=17,a.AVCOL_TRC_SMPTEST428_1=a.AVCOL_TRC_SMPTE428,a.AVCOL_TRC_ARIB_STD_B67=18,a.AVCOL_SPC_RGB=0,a.AVCOL_SPC_BT709=1,a.AVCOL_SPC_UNSPECIFIED=2,a.AVCOL_SPC_RESERVED=3,a.AVCOL_SPC_FCC=4,a.AVCOL_SPC_BT470BG=5,a.AVCOL_SPC_SMPTE170M=6,a.AVCOL_SPC_SMPTE240M=7,a.AVCOL_SPC_YCGCO=8,a.AVCOL_SPC_YCOCG=a.AVCOL_SPC_YCGCO,a.AVCOL_SPC_BT2020_NCL=9,a.AVCOL_SPC_BT2020_CL=10,a.AVCOL_SPC_SMPTE2085=11,a.AVCOL_SPC_CHROMA_DERIVED_NCL=12,a.AVCOL_SPC_CHROMA_DERIVED_CL=13,a.AVCOL_SPC_ICTCP=14,a.AVCOL_RANGE_UNSPECIFIED=0,a.AVCOL_RANGE_MPEG=1,a.AVCOL_RANGE_JPEG=2,a.AVIO_FLAG_READ=1,a.AVIO_FLAG_WRITE=2,a.AVIO_FLAG_READ_WRITE=3,a.AVIO_FLAG_NONBLOCK=8,a.AVIO_FLAG_DIRECT=32768,a.AVFMT_FLAG_NOBUFFER=64,a.AVFMT_FLAG_FLUSH_PACKETS=512,a.AVSEEK_FLAG_BACKWARD=1,a.AVSEEK_FLAG_BYTE=2,a.AVSEEK_FLAG_ANY=4,a.AVSEEK_FLAG_FRAME=8,a.AVDISCARD_NONE=-16,a.AVDISCARD_DEFAULT=0,a.AVDISCARD_NONREF=8,a.AVDISCARD_BIDIR=16,a.AVDISCARD_NONINTRA=24,a.AVDISCARD_NONKEY=32,a.AVDISCARD_ALL=48,a.AV_LOG_QUIET=-8,a.AV_LOG_PANIC=0,a.AV_LOG_FATAL=8,a.AV_LOG_ERROR=16,a.AV_LOG_WARNING=24,a.AV_LOG_INFO=32,a.AV_LOG_VERBOSE=40,a.AV_LOG_DEBUG=48,a.AV_LOG_TRACE=56,a.AV_PKT_FLAG_KEY=1,a.AV_PKT_FLAG_CORRUPT=2,a.AV_PKT_FLAG_DISCARD=4,a.AV_PKT_FLAG_TRUSTED=8,a.AV_PKT_FLAG_DISPOSABLE=16,a.SWS_FAST_BILINEAR=1,a.SWS_BILINEAR=2,a.SWS_BICUBIC=4,a.SWS_X=8,a.SWS_POINT=16,a.SWS_AREA=32,a.SWS_BICUBLIN=64,a.SWS_GAUSS=128,a.SWS_SINC=256,a.SWS_LANCZOS=512,a.SWS_SPLINE=1024,i(["E2BIG","EPERM","EADDRINUSE","EADDRNOTAVAIL","EAFNOSUPPORT","EAGAIN","EALREADY","
4EBADF","EBADMSG","EBUSY","ECANCELED","ECHILD","ECONNABORTED","ECONNREFUSED","ECONNRESET","EDEADLOCK","EDESTADDRREQ","EDOM","EDQUOT","EEXIST","EFAULT","EFBIG","EHOSTUNREACH","EIDRM","EILSEQ","EINPROGRESS","EINTR","EINVAL","EIO","EISCONN","EISDIR","ELOOP","EMFILE","EMLINK","EMSGSIZE","EMULTIHOP","ENAMETOOLONG","ENETDOWN","ENETRESET","ENETUNREACH","ENFILE","ENOBUFS","ENODEV","ENOENT"],1),a.AVERROR_EOF=-541478725,Object.assign(L,a),L.LibAV=function(o){o=o||{};var c=o.base||L.base,u=s(o),m=o.variant||L.variant||"vrew",h=!0;h&&(o.noes6||L.noes6)&&(h=!1);var A=o.toImport||L.toImport||c+"/libav-0.18.8.0-"+m+"."+u+"."+(h?"mjs":"js"),l,T="direct";return u==="thr"?T="threads":!r&&!o.noworker&&typeof Worker<"u"&&(T="worker"),Promise.all([]).then(function(){if(o.factory||L.factory)return o.factory||L.factory;if(L.factories[A])return L.factories[A];if(T!=="worker")return h?import(A).then(function(g){return L.factories[A]=g.default,g.default}):r?L.factories[A]=require(A):typeof importScripts<"u"?(importScripts(A),L.factories[A]=LibAVFactory):new Promise(function(g,b){var w=document.createElement("script");w.src=A,w.addEventListener("load",g),w.addEventListener("error",b),w.async=!0,document.body.appendChild(w)}).then(function(){return L.factories[A]=LibAVFactory})}).then(function(g){return T==="worker"?(l={},l.worker=new Worker(A,{type:h?"module":"classic"}),new Promise(function(b,w){l.worker.onerror=S=>{console.error(S),w(S.error||new Error(S.message))},l.worker.postMessage({config:{variant:o.variant||L.variant,wasmurl:o.wasmurl||L.wasmurl}}),l.on=1,l.handlers={error:[function(S){w(S)},null],onready:[function(){b()},null],onwrite:[function(S){l.onwrite&&l.onwrite.apply(l,S)},null],onread:[function(S){try{var P=null;l.onread&&(P=l.onread.apply(l,S)),P&&P.then&&P.catch&&P.catch(function(R){l.ff_reader_dev_send(S[0],null,{error:R})})}catch(R){l.ff_reader_dev_send(S[0],null,{error:R})}},null],onblockread:[function(S){try{var P=null;l.onblockread&&(P=l.onblockread.apply(l,S)),P&&P.then&&P.catch&&P.catch(function(R){l.ff_block_reader_dev_send(S[0],S[1],null,{error:R})})}catch(R){l.ff_block_reader_dev_send(S[0],S[1],null,{error:R})}},null]},l.c=function(){for(var S=Array.prototype.slice.call(arguments),P=[],R=0;R<S.length;R++)S[R]&&S[R].libavjsTransfer&&P.push.apply(P,S[R].libavjsTransfer);return new Promise(function($,ee){var O=l.on++;S=[O].concat(S),l.handlers[O]=[$,ee],l.worker.postMessage(S,P)})};function y(S){var P=S.data[0],R=l.handlers[P];R&&(S.data[2]?R[0](S.data[3]):R[1](S.data[3]),typeof P=="number"&&delete l.handlers[P])}l.worker.onmessage=y,l.terminate=function(){l.worker.terminate()}})):T==="threads"?Promise.all([]).then(function(){return g({wasmurl:o.wasmurl||L.wasmurl,variant:o.variant||L.variant})}).then(function(b){l=b;var w=l.libavjs_create_main_thread(),y=l.PThread.pthreads[w],S=1,P={},R=null,$=new Promise(function(O){R=O});l.c=function(){var O=Array.prototype.slice.call(arguments);return new Promise(function(B,te){var _e=S++;O=[_e].concat(O),P[_e]=[B,te],y.postMessage({c:"libavjs_run",a:O})})};var ee=y.onmessage;return y.onmessage=function(O){if(O.data&&O.data.c==="libavjs_ret"){var B=O.data.a,te=P[B[0]];te&&(B[2]?te[0](B[3]):te[1](B[3]),delete P[B[0]])}else if(O.data&&O.data.c==="libavjs_wait_reader")if(l.readerDevReady(O.data.fd))y.postMessage({c:"libavjs_wait_reader",fd:O.data.fd});else{var _e=l.fdName(O.data.fd),oe=l.ff_reader_dev_waiters[_e];oe||(oe=l.ff_reader_dev_waiters[_e]=[]),oe.push(function(){y.postMessage({c:"libavjs_wait_reader",fd:O.data.fd})})}else if(O.data&&O.data.c==="libavjs_ready")R();else return ee.apply(this,arguments)},l.terminate=function(){l.PThread.unusedWorkers.concat(l.PThread.runningWorkers).forEach(function(O){O.terminate()})},$}):Promise.all([]).then(function(){return g({wasmurl:o.wasmurl||L.wasmurl,variant:o.variant||L.variant})}).then(function(b){l=b,l.worker=!1,l.c=function(w){var y=Array.prototype.slice.call(arguments,1);return new Promise(function(S,P){try{S(l[w].apply(l,y))}catch(R){P(R)}})},l.terminate=function(){}})}).then(function(){function g(S){S.forEach(function(P){l[P]=function(){return l.c.apply(l,[P].concat(Array.prototype.slice.call(arguments)))}})}
4function b(S){S.forEach(function(P){var R=l[P+"_sync"]=l[P];l[P]=function(){var $=arguments;return new Promise(function(ee,O){try{var B=R.apply(l,$);typeof B=="object"&&B!==null&&B.then?B.then(ee).catch(O):ee(B)}catch(te){O(te)}})}})}var w=["calloc","close","dup2","free","malloc","mallinfo_uordblks","open","strerror","libavjs_create_main_thread","libavjs_with_swscale","ff_malloc_int32_list","ff_malloc_int64_list","av_compare_ts_js","av_dict_copy_js","av_dict_free","av_dict_set_js","av_log_get_level","av_log_set_level","av_opt_set","av_opt_set_int_list_js","av_strdup","ff_error","ff_nothing","LIBAVUTIL_VERSION_INT","av_dict_free_js","sws_getContext","sws_freeContext","sws_scale_frame","av_find_best_stream","av_find_input_format","avformat_alloc_context","avformat_alloc_output_context2_js","avformat_close_input","avformat_find_stream_info","avformat_flush","avformat_free_context","avformat_new_stream","avformat_open_input","avformat_open_input_js","avformat_seek_file","avformat_seek_file_min","avformat_seek_file_max","avformat_seek_file_approx","avformat_write_header","avformat_get_rotation","av_interleaved_write_frame","avio_open2_js","avio_close","avio_flush","av_read_frame","av_seek_frame","av_write_frame","av_write_trailer","avstream_get_frame_rate","avstream_get_sample_aspect_ratio_num","avstream_get_sample_aspect_ratio_den","ff_get_media_duration","ff_get_timecode","ff_get_input_format_name","ff_get_major_brand","ff_slice_audio","ff_extract_audio","ff_convert_audio_to_mp3","convert_to_hls","LIBAVFORMAT_VERSION_INT","ff_init_muxer","ff_free_muxer","ff_init_demuxer_file","ff_write_multi","ff_read_frame_multi","ff_read_multi","AVFormatContext_duration","AVFormatContext_duration_s","AVFormatContext_durationhi","AVFormatContext_durationhi_s","AVFormatContext_flags","AVFormatContext_flags_s","AVFormatContext_nb_streams","AVFormatContext_nb_streams_s","AVFormatContext_oformat","AVFormatContext_oformat_s","AVFormatContext_pb","AVFormatContext_pb_s","AVFormatContext_start_time","AVFormatContext_start_time_s","AVFormatContext_start_timehi","AVFormatContext_start_timehi_s","AVFormatContext_streams_a","AVFormatContext_streams_a_s","AVStream_codecpar","AVStream_codecpar_s","AVStream_discard","AVStream_discard_s","AVStream_duration","AVStream_duration_s","AVStream_durationhi","AVStream_durationhi_s","AVStream_start_time","AVStream_start_time_s","AVStream_start_timehi","AVStream_start_timehi_s","AVStream_time_base_num","AVStream_time_base_den","AVStream_time_base_num_s","AVStream_time_base_den_s","AVStream_time_base_s","avformat_close_input_js","avcodec_descriptor_get","avcodec_descriptor_get_by_name","avcodec_descriptor_next","av_grow_packet","av_packet_alloc","av_packet_clone","av_packet_free","av_packet_make_writable","av_packet_new_side_data","av_packet_ref","av_packet_rescale_ts_js","AVPacketSideData_data","AVPacketSideData_size","AVPacketSideData_type","av_packet_unref","av_shrink_packet","ff_codecpar_new_side_data","av_channel_layout_default_mask","LIBAVCODEC_VERSION_INT","ff_set_packet","ff_copyout_packet","ff_copyout_packet_ptr","ff_copyin_packet","AVCodecDescriptor_id","AVCodecDescriptor_id_s","AVCodecDescriptor_long_name","AVCodecDescriptor_mime_types_a","AVCodecDescriptor_mime_types_a_s","AVCodecDescriptor_name","AVCodecDescriptor_props","AVCodecDescriptor_props_s","AVCodecDescriptor_type","AVCodecDescriptor_type_s","AVCodecParameters_bit_rate","AVCodecParameters_bit_rate_s","AVCodecParameters_channel_layoutmask","AVCodecParameters_channel_layoutmask_s","AVCodecParameters_channels","AVCodecParameters_channels_s","AVCodecParameters_ch_layout_nb_channels","AVCodecParameters_ch_layout_nb_channels_s","AVCodecParameters_chroma_location","AVCodecParameters_chroma_location_s","AVCodecParameters_codec_id","AVCodecParameters_codec_id_s","AVCodecParameters_codec_tag","AVCodecParameters_codec_tag_s","AVCodecParameters_codec_type","AVCodecParameters_codec_type_s","AVCodecParameters_coded_side_data","AVCodecParameters_coded_side_data_s","AVCodecParameters_color_primaries","AVCodecParameters_color_primaries_s","AVCodecParameters_color_range","AVCodecParameters_color_range_s","AVCodecParameters_color_space","AVCodecParameters_color_space_s","AVCodecParameters_color_trc","AVCodecParameters_color_trc_s","AVCodecParameters_extradata","AVCodecParameters_extradata_s","AVCodecParameters_extradata_size","AVCodecParameters_extradata_size_s","AVCodecParameters_format","AVCodecParameters_format_s","AVCodecParameters_framerate_num","AVCodecParameters_framerate_den","AVCodecParameters_framerate_num_s","AVCodecParameters_framerate_den_s","AVCodecParameters_framerate_s","AVCodecParameters_height","AVCodecParameters_height_s","AVCodecParameters_level","AVCodecParameters_level_s","AVCodecParameters_nb_coded_side_data","AVCodecParameters_nb_coded_side_data_s","AVCodecParameters_profile","AVCodecParameters_profile_s","AVCodecParameters_sample_rate","AVCodecParameters_sample_rate_s","AVCodecParameters_width","AVCodecParameters_width_s","AVCodecParameters_block_align","AVCodecParameters_block_align_s","AVCodecParameters_frame_size","AVCodecParameters_frame_size_s","AVCodecParameters_initial_padding","AVCodecParameters_initial_padding_s","AVCodecParameters_trailing_padding","AVCodecParameters_trailing_padding_s","AVCodecParameters_seek_preroll","AVCodecParameters_seek_preroll_s","AVPacket_data","AVPacket_data_s","AVPacket_dts","AVPacket_dts_s","AVPacket_dtshi","AVPacket_dtshi_s","AVPacket_duration","AVPacket_duration_s","AVPacket_durationhi","AVPacket_durationhi_s","AVPacket_flags","AVPacket_flags_s","AVPacket_pos","AVPacket_pos_s","AVPacket_poshi","AVPacket_poshi_s","AVPacket_pts","AVPacket_pts_s","AVPacket_ptshi","AVPacket_ptshi_s","AVPacket_side_data","AVPacket_side_data_s","AVPacket_side_data_elems","AVPacket_side_data_elems_s","AVPacket_size","AVPacket_size_s","AVPacket_stream_index","AVPacket_stream_index_s","AVPacket_time_base_num","AVPacket_time_base_den","AVPacket_time_base_num_s","AVPacket_time_base_den_s","AVPacket_time_base_s","av_packet_free_js","avcodec_parameters_free_js","avcodec_alloc_context3","avcodec_find_decoder","avcodec_find_decoder_by_name","avcodec_find_encoder","avcodec_find_encoder_by_name","avcodec_flush_buffers","avcodec_free_context","avcodec_get_name","avcodec_open2","avcodec_open2_js","avcodec_parameters_alloc","avcodec_parameters_copy","avcodec_parameters_free","avcodec_parameters_from_context","avcodec_parameters_to_context","avcodec_receive_frame","avcodec_receive_packet","avcodec_send_frame","avcodec_send_packet","ff_get_colorspace_name","ff_get_pix_fmt_name","ff_get_color_range_name","ff_init_encoder","ff_init_decoder","ff_free_encoder","ff_free_decoder","ff_encode_multi","ff_decode_multi","ff_copyout_codecpar","ff_copyin_codecpar","AVCodec_name","AVCodec_sample_fmts","AVCodec_sample_fmts_s","AVCodec_sample_fmts_a","AVCodec_sample_fmts_a_s","AVCodec_supported_samplerates","AVCodec_supported_samplerates_s","AVCodec_supported_samplerates_a","AVCodec_supported_samplerates_a_s","AVCodec_type","AVCodec_type_s","AVCodecContext_codec_id","AVCodecContext_codec_id_s","AVCodecContext_codec_type","AVCodecContext_codec_type_s","AVCodecContext_bit_rate","AVCodecContext_bit_rate_s","AVCodecContext_bit_ratehi","AVCodecContext_bit_ratehi_s","AVCodecContext_channel_layout","AVCodecContext_channel_layout_s","AVCodecContext_channel_layouthi","AVCodecContext_channel_layouthi_s","AVCodecContext_channels","AVCodecContext_channels_s","AVCodecContext_channel_layoutmask","AVCodecContext_channel_layoutmask_s","AVCodecContext_ch_layout_nb_channels","AVCodecContext_ch_layout_nb_channels_s","AVCodecContext_coded_side_data","AVCodecContext_coded_side_data_s","AVCodecContext_compression_level","AVCodecContext_compression_level_s","AVCodecContext_extradata","AVCodecContext_extradata_s","AVCodecContext_extradata_size","AVCodecContext_extradata_size_s","AVCodecContext_frame_size","AVCodecContext_frame_size_s","AVCodecContext_framerate_num","AVCodecContext_framerate_den","AVCodecContext_framerate_num_s","AVCodecContext_framerate_den_s","AVCodecContext_framerate_s","AVCodecContext_gop_size","AVCodecContext_gop_size_s","AVCodecContext_height","AVCodecContext_height_s","AVCodecContext_keyint_min","AVCodecContext_keyint_min_s","AVCodecContext_level","AVCodecContext_level_s","AVCodecContext_max_b_frames","AVCodecContext_max_b_frames_s","AVCodecContext_nb_coded_side_data","AVCodecContext_nb_coded_side_data_s","AVCodecContext_pix_fmt","AVCodecContext_pix_fmt_s","AVCodecContext_profile","AVCodecContext_profile_s","AVCodecContext_rc_max_rate","AVCodecContext_rc_max_rate_s","AVCodecContext_rc_max_ratehi","AVCodecContext_rc_max_ratehi_s","AVCodecContext_rc_min_rate","AVCodecContext_rc_min_rate_s","AVCodecContext_rc_min_ratehi","AVCodecContext_rc_min_ratehi_s","AVCodecContext_sample_aspect_ratio_num","AVCodecContext_sample_aspect_ratio_den","AVCodecContext_sample_aspect_ratio_num_s","AVCodecContext_sample_aspect_ratio_den_s","AVCodecContext_sample_aspect_ratio_s","AVCodecContext_sample_fmt","AVCodecContext_sample_fmt_s","AVCodecContext_sample_rate","AVCodecContext_sample_rate_s","AVCodecContext_str
4ict_std_compliance","AVCodecContext_strict_std_compliance_s","AVCodecContext_time_base_num","AVCodecContext_time_base_den","AVCodecContext_time_base_num_s","AVCodecContext_time_base_den_s","AVCodecContext_time_base_s","AVCodecContext_pkt_timebase_num","AVCodecContext_pkt_timebase_den","AVCodecContext_pkt_timebase_num_s","AVCodecContext_pkt_timebase_den_s","AVCodecContext_pkt_timebase_s","AVCodecContext_qmax","AVCodecContext_qmax_s","AVCodecContext_qmin","AVCodecContext_qmin_s","AVCodecContext_width","AVCodecContext_width_s","avcodec_free_context_js","av_frame_alloc","av_frame_clone","av_frame_free","av_frame_get_buffer","av_frame_make_writable","av_frame_ref","av_frame_unref","av_get_bytes_per_sample","av_get_sample_fmt_name","av_pix_fmt_desc_get","AVPixFmtDescriptor_comp_depth","ff_frame_rescale_ts_js","ff_copyout_frame","ff_copyout_frame_video","ff_frame_video_packed_size","ff_copyout_frame_video_packed","ff_copyout_frame_video_imagedata","ff_copyout_frame_ptr","ff_copyin_frame","AVFrame_channel_layout","AVFrame_channel_layout_s","AVFrame_channel_layouthi","AVFrame_channel_layouthi_s","AVFrame_channels","AVFrame_channels_s","AVFrame_channel_layoutmask","AVFrame_channel_layoutmask_s","AVFrame_ch_layout_nb_channels","AVFrame_ch_layout_nb_channels_s","AVFrame_crop_bottom","AVFrame_crop_bottom_s","AVFrame_crop_left","AVFrame_crop_left_s","AVFrame_crop_right","AVFrame_crop_right_s","AVFrame_crop_top","AVFrame_crop_top_s","AVFrame_data_a","AVFrame_data_a_s","AVFrame_flags","AVFrame_flags_s","AVFrame_format","AVFrame_format_s","AVFrame_height","AVFrame_height_s","AVFrame_key_frame","AVFrame_key_frame_s","AVFrame_linesize_a","AVFrame_linesize_a_s","AVFrame_nb_samples","AVFrame_nb_samples_s","AVFrame_pict_type","AVFrame_pict_type_s","AVFrame_pts","AVFrame_pts_s","AVFrame_ptshi","AVFrame_ptshi_s","AVFrame_duration","AVFrame_duration_s","AVFrame_durationhi","AVFrame_durationhi_s","AVFrame_sample_aspect_ratio_num","AVFrame_sample_aspect_ratio_den","AVFrame_sample_aspect_ratio_num_s","AVFrame_sample_aspect_ratio_den_s","AVFrame_sample_aspect_ratio_s","AVFrame_sample_rate","AVFrame_sample_rate_s","AVFrame_time_base_num","AVFrame_time_base_den","AVFrame_time_base_num_s","AVFrame_time_base_den_s","AVFrame_time_base_s","AVFrame_width","AVFrame_width_s","AVPixFmtDescriptor_flags","AVPixFmtDescriptor_flags_s","AVPixFmtDescriptor_log2_chroma_h","AVPixFmtDescriptor_log2_chroma_h_s","AVPixFmtDescriptor_log2_chroma_w","AVPixFmtDescriptor_log2_chroma_w_s","AVPixFmtDescriptor_nb_components","AVPixFmtDescriptor_nb_components_s","av_frame_free_js","avcodec_descriptor_get","avcodec_descriptor_get_by_name","avcodec_descriptor_next","av_grow_packet","av_packet_alloc","av_packet_clone","av_packet_free","av_packet_make_writable","av_packet_new_side_data","av_packet_ref","av_packet_rescale_ts_js","AVPacketSideData_data","AVPacketSideData_size","AVPacketSideData_type","av_packet_unref","av_shrink_packet","ff_codecpar_new_side_data","av_channel_layout_default_mask","LIBAVCODEC_VERSION_INT","ff_set_packet","ff_copyout_packet","ff_copyout_packet_ptr","ff_copyin_packet","AVCodecDescriptor_id","AVCodecDescriptor_id_s","AVCodecDescriptor_long_name","AVCodecDescriptor_mime_types_a","AVCodecDescriptor_mime_types_a_s","AVCodecDescriptor_name","AVCodecDescriptor_props","AVCodecDescriptor_props_s","AVCodecDescriptor_type","AVCodecDescriptor_type_s","AVCodecParameters_bit_rate","AVCodecParameters_bit_rate_s","AVCodecParameters_channel_layoutmask","AVCodecParameters_channel_layoutmask_s","AVCodecParameters_channels","AVCodecParameters_channels_s","AVCodecParameters_ch_layout_nb_channels","AVCodecParameters_ch_layout_nb_channels_s","AVCodecParameters_chroma_location","AVCodecParameters_chroma_location_s","AVCodecParameters_codec_id","AVCodecParameters_codec_id_s","AVCodecParameters_codec_tag","AVCodecParameters_codec_tag_s","AVCodecParameters_codec_type","AVCodecParameters_codec_type_s","AVCodecParameters_coded_side_data","AVCodecParameters_coded_side_data_s","AVCodecParameters_color_primaries","AVCodecParameters_color_primaries_s","AVCodecParameters_color_range","AVCodecParameters_color_range_s","AVCodecParameters_color_space","AVCodecParameters_color_space_s","AVCodecParameters_color_trc","AVCodecParameters_color_trc_s","AVCodecParameters_extradata","AVCodecParameters_extradata_s","AVCodecParameters_extradata_size","AVCodecParameters_extradata_size_s","AVCodecParameters_format","AVCodecParameters_format_s","AVCodecParameters_framerate_num","AVCodecParameters_framerate_den","AVCodecParameters_framerate_num_s","AVCodecParameters_framerate_den_s","AVCodecParameters_framerate_s","AVCodecParameters_height","AVCodecParameters_height_s","AVCodecParameters_level","AVCodecParameters_level_s","AVCodecParameters_nb_coded_side_data","AVCodecParameters_nb_coded_side_data_s","AVCodecParameters_profile","AVCodecParameters_profile_s","AVCodecParameters_sample_rate","AVCodecParameters_sample_rate_s","AVCodecParameters_width","AVCodecParameters_width_s","AVCodecParameters_block_align","AVCodecParameters_block_align_s","AVCodecParameters_frame_size","AVCodecParameters_frame_size_s","AVCodecParameters_initial_padding","AVCodecParameters_initial_padding_s","AVCodecParameters_trailing_padding","AVCodecParameters_trailing_padding_s","AVCodecParameters_seek_preroll","AVCodecParameters_seek_preroll_s","AVPacket_data","AVPacket_data_s","AVPacket_dts","AVPacket_dts_s","AVPacket_dtshi","AVPacket_dtshi_s","AVPacket_duration","AVPacket_duration_s","AVPacket_durationhi","AVPacket_durationhi_s","AVPacket_flags","AVPacket_flags_s","AVPacket_pos","AVPacket_pos_s","AVPacket_poshi","AVPacket_poshi_s","AVPacket_pts","AVPacket_pts_s","AVPacket_ptshi","AVPacket_ptshi_s","AVPacket_side_data","AVPacket_side_data_s","AVPacket_side_data_elems","AVPacket_side_data_elems_s","AVPacket_size","AVPacket_size_s","AVPacket_stream_index","AVPacket_stream_index_s","AVPacket_time_base_num","AVPacket_time_base_den","AVPacket_time_base_num_s","AVPacket_time_base_den_s","AVPacket_time_base_s","av_packet_free_js","avcodec_parameters_free_js","av_bsf_flush","av_bsf_free","av_bsf_init","av_bsf_list_parse_str","av_bsf_list_parse_str_js","av_bsf_receive_packet","av_bsf_send_packet","ff_bsf_multi","AVBSFContext_par_in","AVBSFContext_par_in_s","AVBSFContext_par_out","AVBSFContext_par_out_s","AVBSFContext_time_base_in_num","AVBSFContext_time_base_in_den","AVBSFContext_time_base_in_num_s","AVBSFContext_time_base_in_den_s","AVBSFContext_time_base_in_s","AVBSFContext_time_base_out_num","AVBSFContext_time_base_out_den","AVBSFContext_time_base_out_num_s","AVBSFContext_time_base_out_den_s","AVBSFContext_time_base_out_s","av_bsf_free_js","av_buffersink_get_frame","av_buffersink_get_time_base_num","av_buffersink_get_time_base_den","av_buffersink_set_frame_size","ff_buffersink_set_ch_layout","av_buffersrc_add_frame_flags","avfilter_free","avfilter_get_by_name","avfilter_graph_alloc","avfilter_graph_config","avfilter_graph_create_filter_js","avfilter_graph_free","avfilter_graph_parse","avfilter_inout_alloc","avfilter_inout_free","avfilter_link","LIBAVFILTER_VERSION_INT","ff_init_filter_graph","ff_filter_multi","ff_decode_filter_multi","AVFilterInOut_filter_ctx","AVFilterInOut_filter_ctx_s","AVFilterInOut_name","AVFilterInOut_name_s","AVFilterInOut_next","AVFilterInOut_next_s","AVFilterInOut_pad_idx","AVFilterInOut_pad_idx_s","avfilter_graph_free_js","avfilter_inout_free_js"],y=["copyin_u8","copyout_u8","copyin_s16","copyout_s16","copyin_s32","copyout_s32","copyin_f32","copyout_f32","createLazyFile","ff_block_reader_dev_send","ff_reader_dev_send","ff_reader_dev_waiting","mkblockreaderdev","mkdev","mkfsfhfile","mkreadaheadfile","mkreaderdev","mkstreamwriterdev","mkworkerfsfile","mkwriterdev","mountwriterfs","readFile","unlink","unlinkfsfhfile","unlinkreadaheadfile","unlinkworkerfsfile","unmount","writeFile"];return l.libavjsMode=T,T==="worker"?(g(w),g(y)):T==="threads"?(g(w),b(y)):(b(w),b(y)),Object.assign(l,a),l})}})();const{base:Mi,isWebAssemblySupported:vi,isThreadingSupported:xi,target:Ni,VER:ki,CONFIG:Ui,DBG:Gi,factories:Bi,NULL:Wi,i64tof64:Xi,f64toi64:Yi,i64ToBigInt:zi,bigIntToi64:Hi,ff_channel_layout:$i,ff_channels:ji,AV_VERSION_INT:qi,AV_TIME_BASE:Ki,AV_NOPTS_VALUE_I64:Qi,AV_NOPTS_VALUE_LO:Ji,AV_
4NOPTS_VALUE_HI:Zi,AV_NOPTS_VALUE:eo,AV_OPT_SEARCH_CHILDREN:to,AVMEDIA_TYPE_UNKNOWN:ro,AVMEDIA_TYPE_VIDEO:ao,AVMEDIA_TYPE_AUDIO:so,AVMEDIA_TYPE_DATA:no,AVMEDIA_TYPE_SUBTITLE:io,AVMEDIA_TYPE_ATTACHMENT:oo,AV_SAMPLE_FMT_NONE:_o,AV_SAMPLE_FMT_U8:co,AV_SAMPLE_FMT_S16:lo,AV_SAMPLE_FMT_S32:uo,AV_SAMPLE_FMT_FLT:fo,AV_SAMPLE_FMT_DBL:mo,AV_SAMPLE_FMT_U8P:Ao,AV_SAMPLE_FMT_S16P:ho,AV_SAMPLE_FMT_S32P:po,AV_SAMPLE_FMT_FLTP:Eo,AV_SAMPLE_FMT_DBLP:Vo,AV_SAMPLE_FMT_S64:Co,AV_SAMPLE_FMT_S64P:To,AV_SAMPLE_FMT_NB:So,AV_PIX_FMT_NONE:Ro,AV_PIX_FMT_YUV420P:Io,AV_PIX_FMT_YUYV422:go,AV_PIX_FMT_RGB24:Po,AV_PIX_FMT_BGR24:Oo,AV_PIX_FMT_YUV422P:Lo,AV_PIX_FMT_YUV444P:bo,AV_PIX_FMT_YUV410P:wo,AV_PIX_FMT_YUV411P:yo,AV_PIX_FMT_GRAY8:Do,AV_PIX_FMT_MONOWHITE:Fo,AV_PIX_FMT_MONOBLACK:Mo,AV_PIX_FMT_PAL8:vo,AV_PIX_FMT_YUVJ420P:xo,AV_PIX_FMT_YUVJ422P:No,AV_PIX_FMT_YUVJ444P:ko,AV_PIX_FMT_UYVY422:Uo,AV_PIX_FMT_UYYVYY411:Go,AV_PIX_FMT_BGR8:Bo,AV_PIX_FMT_BGR4:Wo,AV_PIX_FMT_BGR4_BYTE:Xo,AV_PIX_FMT_RGB8:Yo,AV_PIX_FMT_RGB4:zo,AV_PIX_FMT_RGB4_BYTE:Ho,AV_PIX_FMT_NV12:$o,AV_PIX_FMT_NV21:jo,AV_PIX_FMT_ARGB:qo,AV_PIX_FMT_RGBA:Ko,AV_PIX_FMT_ABGR:Qo,AV_PIX_FMT_BGRA:Jo,AV_PIX_FMT_GRAY16BE:Zo,AV_PIX_FMT_GRAY16LE:e_,AV_PIX_FMT_YUV440P:t_,AV_PIX_FMT_YUVJ440P:r_,AV_PIX_FMT_YUVA420P:a_,AV_PIX_FMT_RGB48BE:s_,AV_PIX_FMT_RGB48LE:n_,AV_PIX_FMT_RGB565BE:i_,AV_PIX_FMT_RGB565LE:o_,AV_PIX_FMT_RGB555BE:__,AV_PIX_FMT_RGB555LE:c_,AV_PIX_FMT_BGR565BE:l_,AV_PIX_FMT_BGR565LE:u_,AV_PIX_FMT_BGR555BE:d_,AV_PIX_FMT_BGR555LE:f_,AVCOL_PRI_RESERVED0:m_,AVCOL_PRI_BT709:A_,AVCOL_PRI_UNSPECIFIED:h_,AVCOL_PRI_RESERVED:p_,AVCOL_PRI_BT470M:E_,AVCOL_PRI_BT470BG:V_,AVCOL_PRI_SMPTE170M:C_,AVCOL_PRI_SMPTE240M:T_,AVCOL_PRI_FILM:S_,AVCOL_PRI_BT2020:R_,AVCOL_PRI_SMPTE428:I_,AVCOL_PRI_SMPTEST428_1:g_,AVCOL_PRI_SMPTE431:P_,AVCOL_PRI_SMPTE432:O_,AVCOL_PRI_EBU3213:L_,AVCOL_PRI_JEDEC_P22:b_,AVCOL_TRC_RESERVED0:w_,AVCOL_TRC_BT709:y_,AVCOL_TRC_UNSPECIFIED:D_,AVCOL_TRC_RESERVED:F_,AVCOL_TRC_GAMMA22:M_,AVCOL_TRC_GAMMA28:v_,AVCOL_TRC_SMPTE170M:x_,AVCOL_TRC_SMPTE240M:N_,AVCOL_TRC_LINEAR:k_,AVCOL_TRC_LOG:U_,AVCOL_TRC_LOG_SQRT:G_,AVCOL_TRC_IEC61966_2_4:B_,AVCOL_TRC_BT1361_ECG:W_,AVCOL_TRC_IEC61966_2_1:X_,AVCOL_TRC_BT2020_10:Y_,AVCOL_TRC_BT2020_12:z_,AVCOL_TRC_SMPTE2084:H_,AVCOL_TRC_SMPTEST2084:$_,AVCOL_TRC_SMPTE428:j_,AVCOL_TRC_SMPTEST428_1:q_,AVCOL_TRC_ARIB_STD_B67:K_,AVCOL_SPC_RGB:Q_,AVCOL_SPC_BT709:J_,AVCOL_SPC_UNSPECIFIED:Z_,AVCOL_SPC_RESERVED:ec,AVCOL_SPC_FCC:tc,AVCOL_SPC_BT470BG:rc,AVCOL_SPC_SMPTE170M:ac,AVCOL_SPC_SMPTE240M:sc,AVCOL_SPC_YCGCO:nc,AVCOL_SPC_YCOCG:ic,AVCOL_SPC_BT2020_NCL:oc,AVCOL_SPC_BT2020_CL:_c,AVCOL_SPC_SMPTE2085:cc,AVCOL_SPC_CHROMA_DERIVED_NCL:lc,AVCOL_SPC_CHROMA_DERIVED_CL:uc,AVCOL_SPC_ICTCP:dc,AVCOL_RANGE_UNSPECIFIED:fc,AVCOL_RANGE_MPEG:mc,AVCOL_RANGE_JPEG:Ac,AVIO_FLAG_READ:hc,AVIO_FLAG_WRITE:pc,AVIO_FLAG_READ_WRITE:Ec,AVIO_FLAG_NONBLOCK:Vc,AVIO_FLAG_DIRECT:Cc,AVFMT_FLAG_NOBUFFER:Tc,AVFMT_FLAG_FLUSH_PACKETS:Sc,AVSEEK_FLAG_BACKWARD:Rc,AVSEEK_FLAG_BYTE:Ic,AVSEEK_FLAG_ANY:gc,AVSEEK_FLAG_FRAME:Pc,AVDISCARD_NONE:Oc,AVDISCARD_DEFAULT:Lc,AVDISCARD_NONREF:bc,AVDISCARD_BIDIR:wc,AVDISCARD_NONINTRA:yc,AVDISCARD_NONKEY:Dc,AVDISCARD_ALL:Fc,AV_LOG_QUIET:Mc,AV_LOG_PANIC:vc,AV_LOG_FATAL:xc,AV_LOG_ERROR:Nc,AV_LOG_WARNING:kc,AV_LOG_INFO:Uc,AV_LOG_VERBOSE:Gc,AV_LOG_DEBUG:Bc,AV_LOG_TRACE:Wc,AV_PKT_FLAG_KEY:Xc,AV_PKT_FLAG_CORRUPT:Yc,AV_PKT_FLAG_DISCARD:zc,AV_PKT_FLAG_TRUSTED:Hc,AV_PKT_FLAG_DISPOSABLE:$c,SWS_FAST_BILINEAR:jc,SWS_BILINEAR:qc,SWS_BICUBIC:Kc,SWS_X:Qc,SWS_POINT:Jc,SWS_AREA:Zc,SWS_BICUBLIN:el,SWS_GAUSS:tl,SWS_SINC:rl,SWS_LANCZOS:al,SWS_SPLINE:sl,E2BIG:nl,EPERM:il,EADDRINUSE:ol,EADDRNOTAVAIL:_l,EAFNOSUPPORT:cl,EAGAIN:ll,EALREADY:ul,EBADF:dl,EBADMSG:fl,EBUSY:ml,ECANCELED:Al,ECHILD:hl,ECONNABORTED:pl,ECONNREFUSED:El,ECONNRESET:Vl,EDEADLOCK:Cl,EDESTADDRREQ:Tl,EDOM:Sl,EDQUOT:Rl,EEXIST:Il,EFAULT:gl,EFBIG:Pl,EHOSTUNREACH:Ol,EIDRM:Ll,EILSEQ:bl,EINPROGRESS:wl,EINTR:yl,EINVAL:Dl,EIO:Fl,EISCONN:Ml,EISDIR:vl,ELOOP:xl,EMFILE:Nl,EMLINK:kl,EMSGSIZE:Ul,EMULTIHOP:Gl,ENAMETOOLONG:Bl,ENETDOWN:Wl,ENETRESET:Xl,ENETUNREACH:Yl,ENFILE:zl,ENOBUFS:Hl,ENODEV:$l,ENOENT:jl,AVERROR_EOF:ql,LibAV:si}=L;class ni{constructor(e){this._libAVSession=e}_libAVSession;_packets=[];_eof=!1;_isFetching=null;_stream=null;get eof(){return this._eof}init=async()=>(this._stream=await this._libAVSession.getAudioStream(),this);reset=async()=>{await this.clear(),this._stream=await this._libAVSession.getAudioStream()};clear=async()=>{try{this._isFetching&&await this._isFetching}finally{this._eof=!1,this._packets.splice(0,this._packets.length)}};async seek(e){if(this._stream===null)throw C(V.AUDIO_LOGIC_ERR,"LibAVContext is null in LibAVAudioDemuxer.seek()");await this.clear(),await this._libAVSession.seekFrame(e,this._stream?.index)}next=async()=>{this._packets.length===0&&(this._isFetching===null?await this._read():await this._isFetching);const e=this._packets.shift();return this._packets.length<10&&this._isFetching===null&&this._read(),e?this._toEncodedAudioChunk(e):null};toAudioDecoderConfig=async()=>
4{if(this._stream===null)throw C(V.AUDIO_LOGIC_ERR,"Stream is null in LibAVAudioDemuxer.toAudioDecoderConfig()");return await Ga(this._libAVSession.libav,this._stream)};_read=async()=>{const e=new je;this._isFetching=e.promise();try{if(this._stream===null)throw C(V.AUDIO_LOGIC_ERR,"LibAVContext is null in LibAVAudioDemuxer._read()");const[r,s]=await this._libAVSession.readPackets(this._stream.index,64*1024);this._eof=r,s.length>0&&this._packets.push(...s)}finally{e.resolve(),this._isFetching=null}};_toEncodedAudioChunk=e=>{if(this._stream===null)throw C(V.AUDIO_LOGIC_ERR,"LibAVContext is null in LibAVAudioDemuxer._toEncodedAudioChunk()");return ai(e,this._stream,this._libAVSession.libav)}}const ii=8,ea=4,oi=1e6,ta=5e3;class _i{_logger;_demuxer;_decoder;_queue;_config=null;_request=null;_lastRequestedTime=null;_isDecoding=null;_isSeeking=null;_wait=null;_lastDecodedTime=null;_lastError=null;_generation=0;_phase="idle";constructor(e,r){this._demuxer=new ni(e),this._queue=new ka,this._decoder=new AudioDecoder({output:this._onOutput,error:this._onError}),this._logger=r}get name(){return"webcodecs"}get config(){if(this._config===null)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in WebCodecsAudioDecoder.config");return this._config}get lastDecodedTime(){return this._lastDecodedTime}init=async()=>(await this._demuxer.init(),await this._configure(),this);reset=async()=>{this._clearRequestStates(),this._decoder.reset(),await this._demuxer.reset(),await this._configure()};decode=async e=>{const r=this._decode(e);try{return await It(r,ta,()=>{this._logger.warn(e,`[webcodecs] phase=${this._phase} not finished after ${ta}ms. decodeQueueSize: ${this._decoder.decodeQueueSize}, last decoded time: ${this._lastDecodedTime??"none"}`)})}finally{this._phase="idle"}};_decode=async e=>{if(this._request!==null)throw C(V.AUDIO_LOGIC_ERR,"Decoder is already processing in WebCodecsAudioDecoder.decode()");if(this._throwIfErrorAfterResolved(),this._needSeek(e)){this._clearRequestStates();const s=this._generation;return await this._seek(e),this._generation!==s?null:this._startDecodeLoop(e)}const r=this._queue.get(e);return r!==null?(this._lastRequestedTime=e,r):this._startDecodeLoop(e)};destroy=async()=>{const e=this._isSeeking,r=this._isDecoding;this._clearRequestStates();try{await e,await r,await this._demuxer.clear()}finally{this._close(),this._lastError=null}};_seek=async e=>{this._decoder.reset(),this._decoder.configure(this.config);const{codec:r,sampleRate:s}=this.config,a=Ua(r,s),i=Math.max(e-a,0);this._phase="seek";const o=this._demuxer.seek(i);this._isSeeking=o;try{await o}finally{this._isSeeking===o&&(this._isSeeking=null)}};_needSeek=e=>{if(this._lastRequestedTime===null)return!0;const r=e<this._lastRequestedTime;return e>this._lastRequestedTime+oi||r};_startDecodeLoop=async e=>{const r=new je,s=r.promise();return this._request={timestamp:e,future:r},this._lastRequestedTime=e,this._decodeLoop(this._generation),s};_decodeLoop=async e=>{if(this._isDecoding)return;const r=new je;for(this._isDecoding=r.promise();this._generation===e&&this._request;){const s=this._request,a=this._queue.get(s.timestamp);if(a){s.future.resolve(a),this._request=null;break}let i=!1,o=!0;for(;this._request===s&&this._generation===e&&this._decoder.decodeQueueSize<ii;){this._phase="demux";const h=await this._demuxer.next();if(this._generation!==e)break;if(h===null){if(this._demuxer.eof){i=!0;break}if(this._decoder.decodeQueueSize>0)break;o=!1;break}this._decoder.decode(h)}if(this._generation!==e)break;if(this._request!==s)continue;if(i){if(this._phase="flush",await this._decoder.flush(),this._generation!==e)break;if(this._request!==s)continue;const h=this._queue.get(s.timestamp)??null;s.future.resolve(h),this._request=null;break}if(!o){await wa(0);continue}const c=new je,u=c.promise();this._wait=c;const m=()=>{this._generation===e&&this._decoder.decodeQueueSize<ea&&c.resolve()};this._decoder.ondequeue=m,this._decoder.decodeQueueSize<ea&&c.resolve();try{this._phase="webcodecs-output",await u}finally{this._generation===e&&this._decoder.ondequeue===m&&(this._decoder.ondequeue=null),this._wait===c&&(this._wait=null)}}this._generation===e&&(this._decoder.ondequeue=null,this._isDecoding=null),r.resolve()};_onOutput=e=>{if(this._lastDecodedTime=e.timestamp+e.duration,this._isSeeking!==null||this._request&&this._request.timestamp>e.timestamp+e.duration)e.close();else if(this._queue.push(new qe(e)),this._request){const r=this._queue.get(this._request.timestamp);r&&(this._request.future.resolve(r),this._request=null)}this._wait?.resolve(),this._wait=null};_onError=e=>{const r=C(V.AUDIO_DECODE_ERR,e,"Failed to decode audio in WebCodecsAudioDecoder");this._request?.future?(this._request.future.reject(r),this._request=null):this._lastError=r,this._clearRequestStates()};_configure=async()=>{try{const e=await this._demuxer.toAudioDecoderConfig();this._config=await ci(e),this._decoder.configure(this._config),this._queue.init(this._config.sampleRate)}catch(e){throw C(V.AUDIO_DECODER_CONFIG_ERR,e,"Failed to configure webcodecs decoder")}};_clearRequestStates=()=>{this._generation++,this._lastRequestedTime=null,this._isDecoding=null,this._decoder.ondequeue=null,this._wait?.resolve(),this._wait=null,this._request?.future.resolve(null),this._request=null,this._queue.clear()};_close=()=>{this._decoder.state==="configured"&&this._decoder.close()};_throwIfErrorAfterResolved=()=>
4{if(this._lastError){const e=`last error ${C(void 0,this._lastError).message}`;throw C(V.AUDIO_DECODE_ERR,e)}}}const ci=async t=>{if(t.codec==="pcm-s24")throw new Error("pcm-s24 is not supported properly by webcodecs");const e=xn(t),r=[t.codec,...va(e)];for await(const s of r){const a={codec:s,sampleRate:t.sampleRate,numberOfChannels:t.numberOfChannels,description:t.description},i=await AudioDecoder.isConfigSupported(a);if(i.supported&&i.config!==void 0)return i.config}throw new Error(`No supported decoder config: ${JSON.stringify({...t,description:void 0})}`)},li=async(t,e)=>{for(const r of e)await t.av_packet_free_js(r)},Te=(t,e)=>t*4294967296+(e>>>0),ve=(t,e,r)=>e===0||r===0?U.fromSec(t):U.fromSec(t*e/r),ui=t=>{const e=t<0?-1:1,r=Math.abs(t),s=r>>>0;return[(r/4294967296>>>0)*e,s]},di=(t,e,r)=>t.mul(e/r).as.sec("round"),fi=async(t,e)=>{const r=performance.now(),s=Ba(t);return ya(async()=>{try{const i=await fetch(s,{signal:e});if(!i.ok)throw C(V.NETWORK_FAILED_ERR,"fetch response is not ok",`Details: 5 network: ${navigator.onLine} 6 response: ${i.status} ${i.statusText} 7 time: ${performance.now()-r}ms 8 url: ${t} 9 status: ${i.status} 10 statusText: ${i.statusText} 11 headers: ${JSON.stringify(Object.fromEntries(i.headers.entries()))} 12 disk: ${await or()} 13 `);return i}catch(i){throw i instanceof DOMException&&i.name==="AbortError"?i:C(V.NETWORK_FAILED_ERR,`fetch failed 14 Details: 15 time: ${performance.now()-r}ms 16 url: ${t} 17 err: ${xe(i)} 18 network: ${navigator.onLine} 19 disk: ${await or()} 20 `)}},1,()=>100+Math.random()*1e3)},or=async()=>{try{const t=await navigator.storage.estimate();return`storage estimation: ${t.usage} / ${t.quota}`}catch{return"storage estimation: failed to get storage estimation"}},ra=async(t,e)=>ya(async()=>{const s=await fi(t,e);try{return await s.blob()}catch(a){if(a instanceof Error&&a.name==="TypeError"){const i=await or();throw C(V.DISK_NO_SPACE,`blob() failed 21 Details: 22 url: ${t} 23 err: ${xe(a)} 24 disk: ${i} 25 `)}throw C(V.NETWORK_FAILED_ERR,a)}},1,()=>100+Math.random()*1e3),Ba=t=>{if(!t)return t;const e=t.toLowerCase(),r=/^\/(assets|worklet|libav|locales|src|@fs)\//,s=r.test(t)||t.startsWith("/try/")&&r.test(`/${t.slice(5)}`);if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("blob:")||e.startsWith("data:")||e.startsWith("vrew-file:")||s)return t;throw C(V.LOGIC_ERR,`[assertLoadableUrl] Unconverted path reached core: ${t}`)};function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mt={exports:{}},aa;function Wa(){if(aa)return mt.exports;aa=1;var t=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(t){var e=new Uint8Array(16);mt.exports=function(){return t(e),e}}else{var r=new Array(16);mt.exports=function(){for(var a=0,i;a<16;a++)(a&3)===0&&(i=Math.random()*4294967296),r[a]=i>>>((a&3)<<3)&255;return r}}return mt.exports}var Jt,sa;function Xa(){if(sa)return Jt;sa=1;for(var t=[],e=0;e<256;++e)t[e]=(e+256).toString(16).substr(1);function r(s,a){var i=a||0,o=t;return[o[s[i++]],o[s[i++]],o[s[i++]],o[s[i++]],"-",o[s[i++]],o[s[i++]],"-",o[s[i++]],o[s[i++]],"-",o[s[i++]],o[s[i++]],"-",o[s[i++]],o[s[i++]],o[s[i++]],o[s[i++]],o[s[i++]],o[s[i++]]].join("")}return Jt=r,Jt}var Zt,na;function Ai(){if(na)return Zt;na=1;var t=Wa(),e=Xa(),r,s,a=0,i=0;function o(c,u,m){var h=u&&m||0,A=u||[];c=c||{};var l=c.node||r,T=c.clockseq!==void 0?c.clockseq:s;if(l==null||T==null){var g=t();l==null&&(l=r=[g[0]|1,g[1],g[2],g[3],g[4],g[5]]),T==null&&(T=s=(g[6]<<8|g[7])&16383)}var b=c.msecs!==void 0?c.msecs:new Date().getTime(),w=c.nsecs!==void 0?c.nsecs:i+1,y=b-a+(w-i)/1e4;if(y<0&&c.clockseq===void 0&&(T=T+1&16383),(y<0||b>a)&&c.nsecs===void 0&&(w=0),w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=b,i=w,s=T,b+=122192928e5;var S=((b&268435455)*1e4+w)%4294967296;A[h++]=S>>>24&255,A[h++]=S>>>16&255,A[h++]=S>>>8&255,A[h++]=S&255;var P=b/4294967296*1e4&268435455;A[h++]=P>>>8&255,A[h++]=P&255,A[h++]=P>>>24&15|16,A[h++]=P>>>16&255,A[h++]=T>>>8|128,A[h++]=T&255;for(var R=0;R<6;++R)A[h+R]=l[R];return u||e(A)}return Zt=o,Zt}var er,ia;function hi(){if(ia)return er;ia=1;var t=Wa(),e=Xa();function r(s,a,i){var o=a&&i||0;typeof s=="string"&&(a=s==="binary"?new Array(16):null,s=null),s=s||{};var c=s.random||(s.rng||t)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,a)for(var u=0;u<16;++u)a[o+u]=c[u];return a||e(c)}return er=r,er}var tr,oa;function pi(){if(oa)return tr;oa=1;var t=Ai(),e=hi(),r=e;
25return r.v1=t,r.v4=e,tr=r,tr}var Ei=pi(),Vi=mi(Ei);const _a="jsfetch:";class Ci{constructor(e,r,s){this._mjsUrl=e,this._wasmUrl=r,this._logger=s}_mjsUrl;_wasmUrl;_logger;_libav=null;_libAVState=null;_lastError=null;get libav(){if(!this._libav)throw C(V.LOGIC_ERR,"LibAV is null");return this._libav}get lastError(){return this._lastError?C(void 0,this._lastError).message:""}async init(){return this._libav=await si({toImport:this._mjsUrl,wasmurl:this._wasmUrl,noworker:!0}),this}get containerStart(){if(!this._libAVState)throw C(V.LOGIC_ERR,"LibAVState is null");return this._libAVState.containerStart}getContainerVideoColorSpace(e){return this._libAVState?.containerVideoColorSpaces.get(e)}async clear(){if(!this._libAVState)return;const e=this._libav;if(!e){this._libAVState=null;return}try{this._libAVState.pkt&&await e.av_packet_free_js(this._libAVState.pkt),this._libAVState.fmt_ctx&&await e.avformat_close_input_js(this._libAVState.fmt_ctx),this._libAVState.filename&&!this._libAVState.filename.startsWith(_a)&&await e.unlinkreadaheadfile(this._libAVState.filename),this._lastError=null}catch(r){this._logger.warn(null,"Error while clearing libAV resources:",C(void 0,r).message),this._lastError=r}finally{this._libAVState=null}}async destroy(){await this.clear(),this._libav?.terminate(),this._libav=null,this._lastError=null}async openFileWithUri(e){if(!this._libav)throw C(V.LOGIC_ERR,"LibAV is null while opening file with uri");const r=Ba(e),s=_a+r;try{await this.openFile(s)}catch(a){throw C(navigator.onLine?V.FILE_READ_ERROR:V.NETWORK_FAILED_ERR,a,`openFileWithUri failed (navigator.onLine: ${navigator.onLine})`)}}async openFileWithBlob(e){if(!this._libav)throw C(V.LOGIC_ERR,"LibAV is null while opening file with blob");const r=Vi.v4();await this._libav.mkreadaheadfile(r,e),await this.openFile(r)}async openFile(e){return this._handleErrorAsync("openFile",async()=>{if(!this._libav)throw C(V.LOGIC_ERR,"LibAV is null while opening file");const r=this._libav;let s=0;try{if(s=await r.avformat_open_input_js(e,0,0),s===0)throw new Error("Could not open source file");const a=await this.snapshotPreAnalysisContainerVideoColorSpaces(r,s);await r.avformat_find_stream_info(s,0);const i=await this.parseStreams(r,s),o=ve(Te(await r.AVFormatContext_start_timehi(s),await r.AVFormatContext_start_time(s)),1,1e6);this._libAVState={filename:e,fmt_ctx:s,streams:i,pkt:await r.av_packet_alloc(),containerStart:o,containerVideoColorSpaces:a}}catch(a){if(s!==0)try{await r.avformat_close_input_js(s)}catch(i){this._logger.warn(null,"Error while closing failed libAV input:",C(void 0,i).message)}throw a}})}async snapshotPreAnalysisContainerVideoColorSpaces(e,r){const s=new Map,a=await e.AVFormatContext_nb_streams(r);for(let i=0;i<a;i++){const o=await e.AVFormatContext_streams_a(r,i),c=await e.AVStream_codecpar(o);if(await e.AVCodecParameters_codec_type(c)===e.AVMEDIA_TYPE_VIDEO){const[u,m,h,A]=await Promise.all([e.AVCodecParameters_color_range(c),e.AVCodecParameters_color_primaries(c),e.AVCodecParameters_color_trc(c),e.AVCodecParameters_color_space(c)]);s.set(i,{range:u,primaries:m,trc:h,matrix:A})}}return s}async parseStreams(e,r){const s=[],a=await e.AVFormatContext_nb_streams(r);for(let i=0;i<a;i++){const o=await e.AVFormatContext_streams_a(r,i),c=await e.AVStream_codecpar(o),[u,m,h,A,l,T,g,b,w]=await Promise.all([e.AVCodecParameters_codec_type(c),e.AVCodecParameters_codec_id(c),e.AVStream_start_time(o),e.AVStream_start_timehi(o),e.AVStream_time_base_num(o),e.AVStream_time_base_den(o),e.AVStream_duration(o),e.AVStream_durationhi(o),e.avformat_get_rotation(o)]),y=Te(b,g);s.push({ptr:o,index:i,codecpar:c,codec_type:u,codec_id:m,start_time:h,start_timehi:A,time_base_num:l,time_base_den:T,duration_time_base:y,duration:y*l/T,rotation:w})}return s}getVideoStream(){return this._handleError("getVideoStream",()=>{if(!this._libav||!this._libAVState?.streams)throw C(V.LOGIC_ERR,"libav or stream is null while getting video stream");const e=this._libav,r=this._libAVState.streams.find(s=>s.codec_type===e.AVMEDIA_TYPE_VIDEO);if(!r)throw C(V.VIDEO_FORMAT_ERR,`no video stream found, streams length: ${this._libAVState.streams.length}`);return{...r,rotation:r.rotation===-2147483648?0:r.rotation}})}async getAudioStream(){return this._handleErrorAsync("getAudioStream",async()=>
25{if(!this._libav||!this._libAVState?.streams)throw C(V.LOGIC_ERR,"libav or stream is null while getting audio stream");const e=this._libav,r=this._libAVState.fmt_ctx,s=this._libAVState.streams.find(a=>a.codec_type===e.AVMEDIA_TYPE_AUDIO);if(!s)throw C(V.AUDIO_FORMAT_ERR,`no audio stream found, streams length: ${this._libAVState.streams.length}`);return s.duration<0&&(s.duration=await this._libav.ff_get_media_duration(r)),s})}async estimateDuration(){return this._handleErrorAsync("estimateDuration",async()=>{if(!this._libav||!this._libAVState)throw C(V.LOGIC_ERR,"LibAV or LibAVState is null");const e=this.getVideoStream(),r=await this._libav.av_seek_frame(this._libAVState.fmt_ctx,e.index,4294967295,2147483647,this._libav.AVSEEK_FLAG_BACKWARD);if(r<0)throw C(V.VIDEO_FORMAT_ERR,`error seeking in estimateDuration(): [${r}] 26 ff_error: ${await this._libav.ff_error(r)} 27 strerror: ${await this._libav.strerror(r)}`);const[,s]=await this.readPackets(e.index,2147483647);return await this._libav.av_seek_frame(this._libAVState.fmt_ctx,e.index,0,0,this._libav.AVSEEK_FLAG_BACKWARD),U.max(...s.map(a=>ve(Te(a.ptshi,a.pts),e.time_base_num,e.time_base_den).add(ve(Te(a.durationhi,a.duration),e.time_base_num,e.time_base_den))))})}async seekFrame(e,r){return this._handleErrorAsync("seekFrame",async()=>{if(!this._libav||!this._libAVState)throw C(V.LOGIC_ERR,"LibAV or LibAVState is null");const[s,a]=ui(di(U.fromUS(e),this._libAVState.streams[r].time_base_den,this._libAVState.streams[r].time_base_num)),i=this._libAVState.streams[r].codec_type===this._libav.AVMEDIA_TYPE_VIDEO,o=this._libav.AVSEEK_FLAG_BACKWARD|(i?0:this._libav.AVSEEK_FLAG_ANY),c=await this._libav.av_seek_frame(this._libAVState.fmt_ctx,r,a,s,o);if(c<0)throw C(i?V.VIDEO_FORMAT_ERR:V.AUDIO_FORMAT_ERR,`error in av_seek_frame: [${c}] 28 ff_error: ${await this._libav.ff_error(c)} 29 strerror: ${await this._libav.strerror(c)}`)})}async readPackets(e,r){return this._handleErrorAsync("readPackets",async()=>{if(!this._libav||!this._libAVState)throw C(V.LOGIC_ERR,"LibAV or LibAVState is null");const[s,a]=await this._libav.ff_read_frame_multi(this._libAVState.fmt_ctx,this._libAVState.pkt,{index:e,limit:r});if(s<0&&s!==-this._libav.EAGAIN&&s!==this._libav.AVERROR_EOF){const c=this._libAVState.streams[e].codec_type===this._libav.AVMEDIA_TYPE_VIDEO;throw C(c?V.VIDEO_FORMAT_ERR:V.AUDIO_FORMAT_ERR,`error in ff_read_frame_multi: [${s}] 30 ff_error: ${await this._libav.ff_error(s)} 31 strerror: ${await this._libav.strerror(s)}`)}const i=a[e]??[];return[s===this._libav.AVERROR_EOF,i]})}async readPacketsPtr(e,r){return this._handleErrorAsync("readPacketsPtr",async()=>{if(!this._libav||!this._libAVState)throw C(V.LOGIC_ERR,"LibAV or LibAVState is null");const[s,a]=await this._libav.ff_read_frame_multi(this._libAVState.fmt_ctx,this._libAVState.pkt,{index:e,limit:r,copyoutPacket:"ptr"}),i=a[e]??[],o=s===this._libav.AVERROR_EOF;if(s<0&&s!==-this._libav.EAGAIN&&s!==this._libav.AVERROR_EOF){const c=this._libAVState.streams[e].codec_type===this._libav.AVMEDIA_TYPE_VIDEO;throw C(c?V.VIDEO_FORMAT_ERR:V.AUDIO_FORMAT_ERR,`error in ff_read_frame_multi: [${s}] 32 ff_error: ${await this._libav.ff_error(s)} 33 strerror: ${await this._libav.strerror(s)}`)}return[o,i]})}_handleError(e,r){try{return r()}catch(s){throw this._lastError=s,this._logger.error(null,`error while ${e}`,C(void 0,s).message),s}}async _handleErrorAsync(e,r){try{return await r()}catch(s){throw this._lastError=s,this._logger.error(null,`error while ${e}`,C(void 0,s).message),s}}}const Ti="3c00a4f8";let At=null,ht=null,Ae=null;const ca=Ti,Si=async()=>{if(At&&ht)return{mjsUrl:At,wasmUrl:ht};if(Ae)return Ae.promise();Ae=new je,Ae.promise();try{const t="/try/",e=new URL(`${t}libav/libav-vrew-${ca}.mjs`,import.meta.url).href,r=new URL(`${t}libav/libav-vrew-${ca}.wasm`,import.meta.url).href,[s,a]=await Promise.all([ra(e),ra(r)]);At=URL.createObjectURL(s),ht=URL.createObjectURL(a);const i={mjsUrl:At,wasmUrl:ht};return Ae.resolve(i),i}catch(t){throw Ae&&Ae.reject(t),t}finally{Ae=null}},Ri=8;class Ii{_logger;_libavSession;_queue;_packets=[];_context=null;_config=null;_lastDecodedTime=null;_lastRequestedTime=null;_eof=!1;constructor(e,r){this._libavSession=e,this._queue=new ka,this._logger=r}get name(){return"libav"}get config(){if(this._config===null)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in LibAVAudioDecoder.config");return this._config}get context(){if(!this._context)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in LibAVAudioDecoder.context");return this._context}get lastDecodedTime(){return this._lastDecodedTime}
33async init(){return await this._configure(),this}reset=async()=>{await this._clear(),await this._configure()};async decode(e){if(this._needSeek(e))return await this._seek(e),this._startDecodeLoop(e);const r=this._queue.get(e);return r!==null?(this._lastRequestedTime=e,r):await this._startDecodeLoop(e)}destroy=async()=>{await this._clear()};_seek=async e=>{const r=this.context.stream.index,{codec:s,sampleRate:a}=this.config,i=Ua(s,a),o=Math.max(e-i,0);await It(this._libavSession.seekFrame(o,r),3e3,()=>{this._logger.verbose(e,`seeking to ${o} not finished after 3 seconds`)}),await this._flushDecoder()};_needSeek=e=>{if(this._lastRequestedTime===null||this._lastDecodedTime===null)return!0;const r=e<this._lastRequestedTime;return e>this._lastDecodedTime||r};async _startDecodeLoop(e){this._lastRequestedTime=e;const r=this._libavSession.libav,{index:s}=this.context.stream;if(this._packets.length===0){const[o,c]=await this._libavSession.readPacketsPtr(s,65536);if(this._packets.push(...c),o&&(this._eof=!0),o&&c.length===0)return null}const a=this._packets.splice(0,Ri),i=await r.ff_decode_multi(this.context.codec_ctx,this.context.pkt,this.context.frame,a,{ignoreErrors:!0,copyoutFrame:"ptr",fin:this._eof&&this._packets.length===0});for(const o of i){const c=await this._toAudioFrame(o,e);c&&(this._lastDecodedTime=c.timestamp+c.duration,this._queue.push(c))}return this._queue.get(e)}async _resetState(){this._lastDecodedTime=null,this._lastRequestedTime=null,this._eof=!1;const e=this._packets.splice(0,this._packets.length);this._queue.clear(),e.length!==0&&await li(this._libavSession.libav,e)}async _flushDecoder(){if(!this._context)return;await this._libavSession.libav.avcodec_flush_buffers(this._context.codec_ctx),await this._resetState()}_clear=async()=>{if(this._context)try{await this._libavSession.libav.ff_free_decoder(this._context.codec_ctx,this._context.pkt,this._context.frame)}finally{this._context=null,this._config=null,await this._resetState()}};async _getTimestampAndDuration(e){if(!this._context)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in LibAVAudioDecoder._getTimestampAndDuration()");const r=this._libavSession.libav,s=this._context.stream.time_base_num,a=this._context.stream.time_base_den,i=await r.AVFrame_pts(e),o=await r.AVFrame_ptshi(e),c=await r.AVFrame_duration(e),u=await r.AVFrame_durationhi(e),m=ve(Te(o,i),s,a).as.us("floor"),h=ve(Te(u,c),s,a).as.us("floor");return[m,h]}async _toAudioFrame(e,r){const s=this._libavSession.libav,[a,i]=await this._getTimestampAndDuration(e);if(a+i<r&&!this._eof)return await s.av_frame_free_js(e),null;const o=await s.ff_copyout_frame(e);await s.av_frame_free_js(e);const c=gi(o),u=ve(Te(o.ptshi,o.pts),this.context.stream.time_base_num,this.context.stream.time_base_den).as.us("round");return new qe({data:c,sampleRate:o.sample_rate,timestamp:u})}_configure=async()=>{try{const e=this._libavSession.libav,r=await this._libavSession.getAudioStream(),[,s,a,i]=await e.ff_init_decoder(r.codec_id,{codecpar:r.codecpar,time_base:[r.time_base_num,r.time_base_den]});this._context={stream:r,codec_ctx:s,pkt:a,frame:i},this._config=await Ga(e,r),this._queue.init(this._config.sampleRate)}catch(e){throw C(V.AUDIO_DECODER_CONFIG_ERR,e,"Failed to configure libav decoder")}}}const gi=t=>{const e=t.channels,r=t.nb_samples;switch(t.format){case L.AV_SAMPLE_FMT_FLT:return pt(t.data,e,r);case L.AV_SAMPLE_FMT_S32:return pt(t.data,e,r);case L.AV_SAMPLE_FMT_S16:return pt(t.data,e,r);case L.AV_SAMPLE_FMT_U8:return pt(t.data,e,r);case L.AV_SAMPLE_FMT_FLTP:return t.data;case L.AV_SAMPLE_FMT_S32P:return t.data;case L.AV_SAMPLE_FMT_S16P:return t.data;case L.AV_SAMPLE_FMT_U8P:return t.data;default:throw C(V.AUDIO_DECODE_ERR,`Invalid decoded frame format on getFrameData() ${t.format}`)}},pt=(t,e,r)=>{const s=[];for(let a=0;a<e;a++){let i;t instanceof Int32Array?i=new Int32Array(r):t instanceof Int16Array?i=new Int16Array(r):t instanceof Uint8Array?i=new Uint8Array(r):i=new Float32Array(r);for(let o=0,c=a;o<r;o++,c+=e)i[o]=t[c];s.push(i)}return s},Pi=5e3;let Oi=class{_session=null;_logger=null;_factories=[];_current=null;_state="idle";get decoderName(){return this._current?.name??"none"}get config(){if(!this._current)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in AudioDecoder.config");return this._current.config}get state(){return this._state}init=async(e,r)=>{if(this._logger=r,this._session)this._session.lastError?this._logger.warn(null,`trying to reuse error-occurred libAVSession : ${this._session.lastError}`):this._logger.verbose(null,"clear existing libav session"),await this._session.clear(),this._state="session_cleared",this._logger.verbose(null,"libav session cleared");else{const{mjsUrl:a,wasmUrl:i}=await Si();this._state="libav_initialized",this._logger.verbose(null,"create new libav session"),this._session=new Ci(a,i,this._logger),await this._session.init(),this._state="session_initialized",this._logger.verbose(null,"libav session initialized")}e.kind==="uri"?(await this._session.openFileWithUri(e.uri),this._logger.verbose(null,"opened file with uri")):(await this._session.openFileWithBlob(e.blob),this._logger.verbose(null,"opened file with blob")),this._state="file_opened",this._factories.push(()=>new _i(this._session,r)),this._factories.push(()=>new Ii(this._session,r));let s=null;for(;this._factories.length>0;)try{const i=this._factories.shift()();return this._current=i,await this._current.init(),this._state="decoder_initialized",this}catch(a){s=a,await this._current?.destroy(),this._current=null;const i=C(void 0,a);if(i.type===V.AUDIO_DECODER_CONFIG_ERR)continue;throw i}throw C(V.AUDIO_DECODER_CONFIG_ERR,s,"Failed to initialize AudioDecoder")};decode=async(e,r)=>{if(!this._current)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in AudioDecoder.decode()");return It(this._decodeLoop(e,r),5e3,()=>this._logger?.warn(null,`[${this.decoderName}] _decodeLoop() is not finished after 5 seconds. last decoded time: ${this._current?.lastDecodedTime??"none"}`))};clear=async()=>{try{await this._current?.destroy(),await this._session?.clear()}finally{this._logger=null,this._current=null,this._factories.splice(0,this._factories.length),this._state="session_cleared"}};destroy=async()=>{try{await this._current?.destroy(),await this._session?.destroy()}finally{this._logger=null,this._current=null,this._factories.splice(0,this._factories.length),this._session=null,this._state="destroyed"}};_decodeLoop=async(e,r)=>{if(!this._current)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in AudioDecoder._decodeLoop");const{sampleRate:s,numberOfChannels:a}=this.config,i=$e(r,s),o=ir(a,i);let c=e,u=0;for(;u<i;){const m=await this._decode(c);if(m===null)break;const h=$e(c,s),A=$e(m.timestamp,s),l=Math.min(Math.max(0,A-h),i-u);if(u+=l,u>=i){m.close();break}const T=Math.max(0,h-A),g=Math.min(m.numberOfFrames-T,i-u);for(let b=0;b<a;b++)m.copyTo(o[b].subarray(u,u+g),{planeIndex:b,frameOffset:T,frameCount:g});c=m.timestamp+m.duration,u+=g,m.close()}return o};_decode=async e=>{if(!this._current)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in AudioDecoder._decode");const r=this._current;try{return await r.decode(e)}catch(s){this._logger?.warn(null,`[${r.name}] Failed to decode at ${e}
33us. try next... last decoded time: ${r.lastDecodedTime??"none"}, ${xe(s)}`);const a=await this._destroyCurrent(),i=this._factories.shift();if(!a||!i)throw s;const o=i();return this._current=await o.init(),this._decode(e)}};_destroyCurrent=async()=>{const e=this._current;if(this._current=null,!e)return!0;try{return await Zs(e.destroy(),Pi),!0}catch(r){return this._logger?.warn(null,`error while destroying ${e.name} decoder: ${xe(r)}`),!1}}};class Li{_decoder;_config=null;_source=null;_sourceId=null;_logger=null;get config(){if(!this._config)throw C(V.AUDIO_LOGIC_ERR,"Decoder not initialized in WebCodecsAudioRenderer.config");return this._config}constructor(){this._decoder=new Oi}get decoderState(){return this._decoder.state}init=async(e,r,s)=>(this._source=e,this._sourceId=r,this._logger=s,await It(this._decoder.init(this._source,s),3e3,()=>{this._logger?.warn(null,`decoder is not initialized after 3 seconds. state: ${this._decoder.state}`)}),this._config=this._decoder.config,this);render=async(e,r)=>{try{return await this._decoder.decode(e.as.us(),r.as.us())}catch(s){throw C(V.AUDIO_DECODE_ERR,s,`error occurred while rendering audio frame. sourceId: ${this._sourceId}, at: ${e.as.us()} us`)}};clear=async()=>{await this._decoder.clear(),this._config=null,this._source=null,this._sourceId=null,this._logger=null};destroy=async()=>{await this._decoder.destroy(),this._source=null,this._sourceId=null,this._logger=null,this._config=null}}let ae=null;const bi=async(t,e,r,s=!1,a=!1)=>{if(!ae){const i=xa(r,s,a);ae=new Ya(t,e,i)}await ae.init()},wi=async(t,e,r,s=!1,a=!1)=>{const i=xa(r,s,a);if(!ae){ae=new Ya(t,e,i),await ae.init();return}await ae.reset(t,e,i)},yi=async(t,e,r,s,a)=>{if(ae===null)throw new Error("MediaSourceAudioReaderWorker is not initialized");const i=await ae.readAudio(t,e,r,s,a);return Un(i,i.map(o=>o.buffer))},Di=async()=>{try{await ae?.destroy()}finally{ae=null,globalThis.close()}};let Ya=class{_audioRenderer=new Li;_audioChannelMixer;_logger;_readQueue=Promise.resolve();_infoId;_source;constructor(e,r,s){this._logger=s,this._infoId=e,this._source=r,this._audioChannelMixer=new Fn}
33async init(){await this._audioRenderer.init(this._source,this._infoId,this._logger)}async reset(e,r,s){await this.clear(),this._infoId=e,this._source=r,this._logger=s,await this.init()}async readAudio(e,r,s,a,i){const o=async()=>{const u=U.fromMS(e),m=this._audioRenderer.config.sampleRate,h=await this._audioRenderer.render(u,U.fromMS(r)),A=this._audioChannelMixer.process({timelineIndex:Js(u,m),sampleRate:m,data:h},a),l=i!==1;let T=[A];if(l){const w=new Xn;T=w.process(A,i),T.push(...w.flush())}const g=new vn({sampleRate:s}),b=T.map(w=>g.process(w)).flat();return b.push(...g.flush()),kn(b)},c=this._readQueue.catch(()=>{}).then(o);return this._readQueue=c,c}async clear(){await this._readQueue.catch(()=>{}),await this._audioRenderer.clear()}async destroy(){await this._readQueue.catch(()=>{}),await this._audioRenderer.destroy()}};var Fi=Object.freeze({__proto__:null,destroy:Di,init:bi,readAudio:yi,reset:wi});_r(Fi); 34//# sourceMappingURL=mediaSourceAudioReader.worker-DURWn3HP.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.